15768: changed all context menu actions to take an array of resources Arvados-DCO...
[arvados.git] / src / views-components / context-menu / action-sets / workflow-action-set.ts
index 2aa78904e4cfa8938aa5f8e2de3e77554bea1013..7902e1c0629319553a7e63b96e5ab4300b6a77de 100644 (file)
@@ -2,14 +2,49 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
-import { openRunProcess } from "store/workflow-panel/workflow-panel-actions";
+import { ContextMenuActionSet } from 'views-components/context-menu/context-menu-action-set';
+import { openRunProcess } from 'store/workflow-panel/workflow-panel-actions';
+import { DetailsIcon, AdvancedIcon, OpenIcon, Link, StartIcon } from 'components/icon/icon';
+import { copyToClipboardAction, openInNewTabAction } from 'store/open-in-new-tab/open-in-new-tab.actions';
+import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
+import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
 
-export const workflowActionSet: ContextMenuActionSet = [[
-    {
-        name: "Run",
-        execute: (dispatch, resource) => {
-            dispatch<any>(openRunProcess(resource.uuid, resource.ownerUuid, resource.name));
-        }
-    },
-]];
+export const workflowActionSet: ContextMenuActionSet = [
+    [
+        {
+            icon: OpenIcon,
+            name: 'Open in new tab',
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(openInNewTabAction(resource)));
+            },
+        },
+        {
+            icon: Link,
+            name: 'Copy to clipboard',
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(copyToClipboardAction(resource)));
+            },
+        },
+        {
+            icon: DetailsIcon,
+            name: 'View details',
+            execute: (dispatch) => {
+                dispatch<any>(toggleDetailsPanel());
+            },
+        },
+        {
+            icon: AdvancedIcon,
+            name: 'API Details',
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(openAdvancedTabDialog(resource.uuid)));
+            },
+        },
+        {
+            icon: StartIcon,
+            name: 'Run Workflow',
+            execute: (dispatch, resources) => {
+                resources.forEach((resource) => dispatch<any>(openRunProcess(resource.uuid, resource.ownerUuid, resource.name)));
+            },
+        },
+    ],
+];