15768: made new dialog for multi-copy Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa...
[arvados.git] / src / views-components / context-menu / action-sets / collection-action-set.ts
index d40cffb66ef0ca8d362eea249437b0769c107d86..c63144e8b96316c6ade88855fcf7d2d36b80c354 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";
@@ -51,22 +51,23 @@ const commonActionSet: ContextMenuActionSet = [
         {
             icon: OpenIcon,
             name: "Open in new tab",
-            execute: (dispatch, resource) => {
-                dispatch<any>(openInNewTabAction(resource));
+            execute: (dispatch, resources) => {
+                dispatch<any>(openInNewTabAction(resources[0]));
             },
         },
         {
             icon: Link,
             name: "Copy to clipboard",
-            execute: (dispatch, resource) => {
-                dispatch<any>(copyToClipboardAction(resource));
+            execute: (dispatch, resources) => {
+                dispatch<any>(copyToClipboardAction(resources));
             },
         },
         {
             icon: CopyIcon,
             name: "Make a copy",
             execute: (dispatch, resources) => {
-                resources.forEach(resource => dispatch<any>(openCollectionCopyDialog(resource)));
+                if (resources[0].isSingle) dispatch<any>(openCollectionCopyDialog(resources[0]));
+                else dispatch<any>(openMultiCollectionCopyDialog(resources[0]));
             },
         },
         {