[ARVADOS-WORKBENCH2] updated: 1.1.4-448-g7eed338

Git user git at public.curoverse.com
Mon Jul 30 10:53:13 EDT 2018


Summary of changes:
 .../collection-panel-files/collection-panel-files-actions.ts     | 4 +++-
 .../collection-panel-files/collections-panel-files-reducer.ts    | 2 ++
 .../context-menu/action-sets/collection-files-action-set.ts      | 9 +++++----
 3 files changed, 10 insertions(+), 5 deletions(-)

       via  7eed338e122d5c5f16988acae10d304de15761bf (commit)
      from  c3b3bdb39e8e0a8ec7368f06a95450a0ef5e572e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 7eed338e122d5c5f16988acae10d304de15761bf
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Mon Jul 30 16:52:56 2018 +0200

    Implement 'select/unselect all' actions
    
    Feature #13855
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts b/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
index 6997f08..caaa426 100644
--- a/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
+++ b/src/store/collection-panel/collection-panel-files/collection-panel-files-actions.ts
@@ -8,7 +8,9 @@ import { CollectionPanelFilesState, CollectionPanelFile } from "./collection-pan
 export const collectionPanelFilesAction = unionize({
     SET_COLLECTION_FILES: ofType<{ files: CollectionPanelFilesState }>(),
     TOGGLE_COLLECTION_FILE_COLLAPSE: ofType<{ id: string }>(),
-    TOGGLE_COLLECTION_FILE_SELECTION: ofType<{ id: string }>()
+    TOGGLE_COLLECTION_FILE_SELECTION: ofType<{ id: string }>(),
+    SELECT_ALL_COLLECTION_FILES: ofType<{}>(),
+    UNSELECT_ALL_COLLECTION_FILES: ofType<{}>(),
 }, { tag: 'type', value: 'payload' });
 
 export type CollectionPanelFilesAction = UnionOf<typeof collectionPanelFilesAction>;
\ No newline at end of file
diff --git a/src/store/collection-panel/collection-panel-files/collections-panel-files-reducer.ts b/src/store/collection-panel/collection-panel-files/collections-panel-files-reducer.ts
index 1e62bad..408779c 100644
--- a/src/store/collection-panel/collection-panel-files/collections-panel-files-reducer.ts
+++ b/src/store/collection-panel/collection-panel-files/collections-panel-files-reducer.ts
@@ -60,6 +60,8 @@ export const collectionPanelFilesReducer = (state: CollectionPanelFilesState = i
         SET_COLLECTION_FILES: data => data.files,
         TOGGLE_COLLECTION_FILE_COLLAPSE: data => toggleCollapsed(state, data.id),
         TOGGLE_COLLECTION_FILE_SELECTION: data => toggleSelected(state, data.id),
+        SELECT_ALL_COLLECTION_FILES: () => state.map(file => ({...file, selected: true})),
+        UNSELECT_ALL_COLLECTION_FILES: () => state.map(file => ({...file, selected: false})),
         default: () => state
     });
 };
diff --git a/src/views-components/context-menu/action-sets/collection-files-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-action-set.ts
index 1e183d5..dc17e69 100644
--- a/src/views-components/context-menu/action-sets/collection-files-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-files-action-set.ts
@@ -3,17 +3,18 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ContextMenuActionSet } from "../context-menu-action-set";
+import { collectionPanelFilesAction } from "../../../store/collection-panel/collection-panel-files/collection-panel-files-actions";
 
 
 export const collectionFilesActionSet: ContextMenuActionSet = [[{
     name: "Select all",
-    execute: (dispatch, resource) => {
-        return;
+    execute: (dispatch) => {
+        dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
     }
 },{
     name: "Unselect all",
-    execute: (dispatch, resource) => {
-        return;
+    execute: (dispatch) => {
+        dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
     }
 },{
     name: "Remove selected",

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list