15768: back to previous multiselect state, but now with arrays Arvados-DCO-1.1-Signed...
authorLisa Knox <lisaknox83@gmail.com>
Wed, 19 Jul 2023 15:14:28 +0000 (11:14 -0400)
committerLisa Knox <lisaknox83@gmail.com>
Wed, 19 Jul 2023 15:14:28 +0000 (11:14 -0400)
src/components/multiselectToolbar/MultiselectToolbar.tsx

index 1092cf984907c39da1920ccd6b20875cb5c4c358..0ef7240b729f518c754e7db7811998a1423d02f1 100644 (file)
@@ -174,16 +174,19 @@ function mapDispatchToProps(dispatch: Dispatch) {
         //     });
         // },
         executeMulti: (selectedAction: ContextMenuAction, checkedList: TCheckedList, resources: ResourcesState) => {
-            console.log(groupByKind(checkedList, resources));
             // selectedToArray(checkedList).forEach((uuid) => {
             //     const resource = getResource(uuid)(resources);
             //     executeSpecific(dispatch, action.name, resource);
             // });
             const kindGroups = groupByKind(checkedList, resources);
+            // console.log(kindGroups);
             for (const kind in kindGroups) {
                 const actionSet = kindToActionSet[kind];
                 const action = findActionByName(selectedAction.name as string, actionSet);
-                // if (action) action.execute(dispatch, kindGroups[kind]);
+                console.log(action?.execute);
+                console.log(kindGroups[kind]);
+
+                if (action) action.execute(dispatch, kindGroups[kind]);
                 // if (action && action.name === 'ToggleTrashAction') action.execute(dispatch, kindGroups[kind]);
             }
         },
@@ -202,7 +205,8 @@ function executeSpecific(dispatch: Dispatch, actionName, resource) {
     if (action) action.execute(dispatch, resource);
 }
 
-function groupByKind(checkedList: TCheckedList, resources: ResourcesState): Record<string, Array<Resource | undefined>> {
+function groupByKind(checkedList: TCheckedList, resources: ResourcesState): Record<string, ContextMenuResource[]> {
+    // function groupByKind(checkedList: TCheckedList, resources: ResourcesState): Record<string, Array<Resource | undefined>> {
     const result = {};
     selectedToArray(checkedList).forEach((uuid) => {
         const resource = getResource(uuid)(resources) as Resource;