Merge branch 'main' into 15768-multi-select-operations Arvados-DCO-1.1-Signed-off...
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / link-action-set.ts
index 326741a245697ffde7737e36571a9100420a6b46..4f0b330ec3f7e6660170180c62a4169d29770295 100644 (file)
@@ -2,27 +2,33 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { openLinkAttributesDialog, openLinkRemoveDialog } from '~/store/link-panel/link-panel-actions';
-import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
-import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
-import { AdvancedIcon, RemoveIcon, AttributesIcon } from "~/components/icon/icon";
+import { openLinkAttributesDialog, openLinkRemoveDialog } from 'store/link-panel/link-panel-actions';
+import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
+import { ContextMenuActionSet } from 'views-components/context-menu/context-menu-action-set';
+import { AdvancedIcon, RemoveIcon, AttributesIcon } from 'components/icon/icon';
 
-export const linkActionSet: ContextMenuActionSet = [[{
-    name: "Attributes",
-    icon: AttributesIcon,
-    execute: (dispatch, { uuid }) => {
-        dispatch<any>(openLinkAttributesDialog(uuid));
-    }
-}, {
-    name: "Advanced",
-    icon: AdvancedIcon,
-    execute: (dispatch, { uuid }) => {
-        dispatch<any>(openAdvancedTabDialog(uuid));
-    }
-}, {
-    name: "Remove",
-    icon: RemoveIcon,
-    execute: (dispatch, { uuid }) => {
-        dispatch<any>(openLinkRemoveDialog(uuid));
-    }
-}]];
+export const linkActionSet: ContextMenuActionSet = [
+    [
+        {
+            name: 'Attributes',
+            icon: AttributesIcon,
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(openLinkAttributesDialog(resource.uuid)));
+            },
+        },
+        {
+            name: 'API Details',
+            icon: AdvancedIcon,
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+            },
+        },
+        {
+            name: 'Remove',
+            icon: RemoveIcon,
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(openLinkRemoveDialog(resource.uuid)));
+            },
+        },
+    ],
+];