15768: collection copy dialog mostly works Arvados-DCO-1.1-Signed-off-by: Lisa Knox...
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-action-set.ts
index f1250582c1b7c64b8e76f58d5221494fb7afba81..b63497f20f067b52a7884ec1fe77271a4aab87e9 100644 (file)
@@ -20,7 +20,7 @@ import {
 import { openCollectionUpdateDialog } from "store/collections/collection-update-actions";
 import { favoritePanelActions } from "store/favorite-panel/favorite-panel-action";
 import { openMoveCollectionDialog } from "store/collections/collection-move-actions";
-import { openCollectionCopyDialog } from "store/collections/collection-copy-actions";
+import { openCollectionCopyDialog, openMultiCollectionCopyDialog } from "store/collections/collection-copy-actions";
 import { openWebDavS3InfoDialog } from "store/collections/collection-info-actions";
 import { ToggleTrashAction } from "views-components/context-menu/actions/trash-action";
 import { toggleCollectionTrashed } from "store/trash/trash-actions";
@@ -66,7 +66,10 @@ const commonActionSet: ContextMenuActionSet = [
             icon: CopyIcon,
             name: "Make a copy",
             execute: (dispatch, resources) => {
-                dispatch<any>(openCollectionCopyDialog(resources[0]));
+                console.log(resources[0]);
+                //here fix single vs one
+                if (resources[0].isSingle) dispatch<any>(openCollectionCopyDialog(resources[0]));
+                else dispatch<any>(openMultiCollectionCopyDialog(resources[0]));
             },
         },
         {
@@ -126,6 +129,7 @@ export const collectionActionSet: ContextMenuActionSet = [
             component: ToggleTrashAction,
             name: "ToggleTrashAction",
             execute: (dispatch, resources: ContextMenuResource[]) => {
+                //here fix  multi?
                 resources.forEach(resource => dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!)));
             },
         },