Merge branch '14424-storing-splitter-in-local-storage'
authorPawel Kromplewski <pawel.kromplewski@contractors.roche.com>
Mon, 5 Nov 2018 13:43:37 +0000 (14:43 +0100)
committerPawel Kromplewski <pawel.kromplewski@contractors.roche.com>
Mon, 5 Nov 2018 13:43:37 +0000 (14:43 +0100)
refs #14424

Arvados-DCO-1.1-Signed-off-by: Pawel Kromplewski <pawel.kromplewski@contractors.roche.com>

12 files changed:
src/index.tsx
src/store/context-menu/context-menu-actions.ts
src/views-components/collection-panel-files/collection-panel-files.ts
src/views-components/context-menu/action-sets/collection-files-not-selected-action-set.ts [new file with mode: 0644]
src/views-components/context-menu/context-menu.tsx
src/views-components/snackbar/snackbar.tsx
src/views/favorite-panel/favorite-panel.tsx
src/views/process-panel/process-information-card.tsx
src/views/project-panel/project-panel.tsx
src/views/search-results-panel/search-results-panel.tsx
src/views/shared-with-me-panel/shared-with-me-panel.tsx
src/views/trash-panel/trash-panel.tsx

index d9235d0ffc6665edb8a6a40ba4b747b95c69aafb..efe3a576df3a7ca03bcade88819442f90c0a8663 100644 (file)
@@ -25,6 +25,7 @@ import { resourceActionSet } from './views-components/context-menu/action-sets/r
 import { favoriteActionSet } from "./views-components/context-menu/action-sets/favorite-action-set";
 import { collectionFilesActionSet } from './views-components/context-menu/action-sets/collection-files-action-set';
 import { collectionFilesItemActionSet } from './views-components/context-menu/action-sets/collection-files-item-action-set';
+import { collectionFilesNotSelectedActionSet } from './views-components/context-menu/action-sets/collection-files-not-selected-action-set';
 import { collectionActionSet } from './views-components/context-menu/action-sets/collection-action-set';
 import { collectionResourceActionSet } from './views-components/context-menu/action-sets/collection-resource-action-set';
 import { processActionSet } from './views-components/context-menu/action-sets/process-action-set';
@@ -55,6 +56,7 @@ addMenuActionSet(ContextMenuKind.PROJECT, projectActionSet);
 addMenuActionSet(ContextMenuKind.RESOURCE, resourceActionSet);
 addMenuActionSet(ContextMenuKind.FAVORITE, favoriteActionSet);
 addMenuActionSet(ContextMenuKind.COLLECTION_FILES, collectionFilesActionSet);
+addMenuActionSet(ContextMenuKind.COLLECTION_FILES_NOT_SELECTED, collectionFilesNotSelectedActionSet);
 addMenuActionSet(ContextMenuKind.COLLECTION_FILES_ITEM, collectionFilesItemActionSet);
 addMenuActionSet(ContextMenuKind.COLLECTION, collectionActionSet);
 addMenuActionSet(ContextMenuKind.COLLECTION_RESOURCE, collectionResourceActionSet);
index 3ae79db40515e3381a421930095783b70a925812..32bc47b6b8cd04f6e884614abe1d7fb46bfbe0c5 100644 (file)
@@ -48,6 +48,18 @@ export const openContextMenu = (event: React.MouseEvent<HTMLElement>, resource:
         );
     };
 
+export const openCollectionFilesContextMenu = (event: React.MouseEvent<HTMLElement>) =>
+    (dispatch: Dispatch, getState: () => RootState) => {
+        const isCollectionFileSelected = JSON.stringify(getState().collectionPanelFiles).includes('"selected":true');
+        dispatch<any>(openContextMenu(event, {
+            name: '',
+            uuid: '',
+            ownerUuid: '',
+            kind: ResourceKind.COLLECTION,
+            menuKind: isCollectionFileSelected ? ContextMenuKind.COLLECTION_FILES : ContextMenuKind.COLLECTION_FILES_NOT_SELECTED
+        }));
+    };
+
 export const openRootProjectContextMenu = (event: React.MouseEvent<HTMLElement>, projectUuid: string) =>
     (dispatch: Dispatch, getState: () => RootState) => {
         const res = getResource<UserResource>(projectUuid)(getState().resources);
index edc100f783d282745172da4bf68cfe6873436b84..294bd6d5d2858c667b3979d6876fb0d3c3e3746e 100644 (file)
@@ -20,7 +20,7 @@ import { collectionPanelFilesAction } from "~/store/collection-panel/collection-
 import { ContextMenuKind } from "../context-menu/context-menu";
 import { getNode, getNodeChildrenIds, Tree } from "~/models/tree";
 import { CollectionFileType } from "~/models/collection-file";
-import { openContextMenu } from '~/store/context-menu/context-menu-actions';
+import { openContextMenu, openCollectionFilesContextMenu } from '~/store/context-menu/context-menu-actions';
 import { openUploadCollectionFilesDialog } from '~/store/collections/collection-upload-actions';
 import { ResourceKind } from "~/models/resource";
 
@@ -54,7 +54,7 @@ const mapDispatchToProps = (dispatch: Dispatch): Pick<CollectionPanelFilesProps,
         dispatch<any>(openContextMenu(event, { menuKind: ContextMenuKind.COLLECTION_FILES_ITEM, kind: ResourceKind.COLLECTION, name: item.data.name, uuid: item.id, ownerUuid: '' }));
     },
     onOptionsMenuOpen: (event) => {
-        dispatch<any>(openContextMenu(event, { menuKind: ContextMenuKind.COLLECTION_FILES, kind: ResourceKind.COLLECTION, name: '', uuid: '', ownerUuid: '' }));
+        dispatch<any>(openCollectionFilesContextMenu(event));
     },
 });
 
diff --git a/src/views-components/context-menu/action-sets/collection-files-not-selected-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-not-selected-action-set.ts
new file mode 100644 (file)
index 0000000..ab31566
--- /dev/null
@@ -0,0 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
+import { collectionPanelFilesAction } from "~/store/collection-panel/collection-panel-files/collection-panel-files-actions";
+
+export const collectionFilesNotSelectedActionSet: ContextMenuActionSet = [[{
+    name: "Select all",
+    execute: dispatch => {
+        dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
+    }
+}]];
\ No newline at end of file
index ad6f7e306030b5eedea8309dd2d2b931fccc6bab..b6d2b91b1a5e58dd07353ed19eb024e48425c629 100644 (file)
@@ -62,6 +62,7 @@ export enum ContextMenuKind {
     TRASH = "Trash",
     COLLECTION_FILES = "CollectionFiles",
     COLLECTION_FILES_ITEM = "CollectionFilesItem",
+    COLLECTION_FILES_NOT_SELECTED = "CollectionFilesNotSelected",
     COLLECTION = 'Collection',
     COLLECTION_RESOURCE = 'CollectionResource',
     TRASHED_COLLECTION = 'TrashedCollection',
index f3149e63aa2eee0a107177fb4cf78dc22d82faba..4250dcdfb3d7a7cdf35a41ed2240068daadd60b9 100644 (file)
@@ -70,7 +70,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         backgroundColor: theme.palette.error.dark
     },
     info: {
-        backgroundColor: theme.palette.primary.dark
+        backgroundColor: theme.palette.primary.main
     },
     warning: {
         backgroundColor: amber[700]
index 948885f7081a9e1e691379cf99266e512618bdb2..33c901cb784e19e51b03051cfaa640d1facd571b 100644 (file)
@@ -146,6 +146,7 @@ const mapDispatchToProps = (dispatch: Dispatch): FavoritePanelActionProps => ({
                 menuKind: kind
             }));
         }
+        dispatch<any>(loadDetailsPanel(resourceUuid));
     },
     onDialogOpen: (ownerUuid: string) => { return; },
     onItemClick: (resourceUuid: string) => {
index 08131266fe69d0af6cf2032f0876c17e8dbda98a..9b21ce5e27e4f38c908eed42fb6497bc9884c6bb 100644 (file)
@@ -75,6 +75,7 @@ type ProcessInformationCardProps = ProcessInformationCardDataProps & WithStyles<
 export const ProcessInformationCard = withStyles(styles, { withTheme: true })(
     ({ classes, process, onContextMenu, theme }: ProcessInformationCardProps) =>
         <Card className={classes.card}>
+        {console.log(process)}
             <CardHeader
                 classes={{
                     content: classes.title,
index 2b2be2e8905ec5d111faf8c121da72dddba94371..1221d0d1fba4df866500dc7ed4669a7fe8f58f38 100644 (file)
@@ -170,6 +170,7 @@ export const ProjectPanel = withStyles(styles)(
                         menuKind
                     }));
                 }
+                this.props.dispatch<any>(loadDetailsPanel(resourceUuid));
             }
 
             handleRowDoubleClick = (uuid: string) => {
index fd322d75fc2877f40bc405bde1a037f1505a3531..65999a5cbb30aea18b1c7ff66b9227b0cab5e7c0 100644 (file)
@@ -23,6 +23,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps =
                 menuKind: kind
             }));
         }
+        dispatch<any>(loadDetailsPanel(resourceUuid));
     },
     onDialogOpen: (ownerUuid: string) => { return; },
     onItemClick: (resourceUuid: string) => {
index 4aee73a6fd26cd33fb86276a406abaf7ea8e6d52..582aa9c7416f50917c94aa32afc00be5ee96fa42 100644 (file)
@@ -63,6 +63,7 @@ export const SharedWithMePanel = withStyles(styles)(
                         menuKind
                     }));
                 }
+                this.props.dispatch<any>(loadDetailsPanel(resourceUuid));
             }
 
             handleRowDoubleClick = (uuid: string) => {
index 92febd8acf55467f960eb234ac1ecee99c6ea28a..4d5df5cdbc3a304ca9573f8bb56a92e612d91bba 100644 (file)
@@ -180,6 +180,7 @@ export const TrashPanel = withStyles(styles)(
                         menuKind: ContextMenuKind.TRASH
                     }));
                 }
+                this.props.dispatch<any>(loadDetailsPanel(resourceUuid));
             }
 
             handleRowDoubleClick = (uuid: string) => {