X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b4f14437823e9201e9cd952a4f6f3b1502b583bd..3612a36e473bf1599180a9b3b90b03ca0aaafb45:/src/views-components/context-menu/action-sets/workflow-action-set.ts?ds=sidebyside diff --git a/src/views-components/context-menu/action-sets/workflow-action-set.ts b/src/views-components/context-menu/action-sets/workflow-action-set.ts index 1baf04228c..4a1460bfc9 100644 --- a/src/views-components/context-menu/action-sets/workflow-action-set.ts +++ b/src/views-components/context-menu/action-sets/workflow-action-set.ts @@ -4,63 +4,60 @@ import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set"; import { openRunProcess, deleteWorkflow } from "store/workflow-panel/workflow-panel-actions"; -import { - DetailsIcon, - AdvancedIcon, - OpenIcon, - Link, - StartIcon, - TrashIcon -} from "components/icon/icon"; +import { DetailsIcon, AdvancedIcon, OpenIcon, Link, StartIcon, TrashIcon } 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 { toggleDetailsPanel } from "store/details-panel/details-panel-action"; import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab"; -export const readOnlyWorkflowActionSet: ContextMenuActionSet = [[ - { - icon: OpenIcon, - name: "Open in new tab", - execute: (dispatch, resource) => { - dispatch(openInNewTabAction(resource)); - } - }, - { - icon: Link, - name: "Copy to clipboard", - execute: (dispatch, resource) => { - dispatch(copyToClipboardAction(resource)); - } - }, - { - icon: DetailsIcon, - name: "View details", - execute: dispatch => { - dispatch(toggleDetailsPanel()); - } - }, - { - icon: AdvancedIcon, - name: "API Details", - execute: (dispatch, resource) => { - dispatch(openAdvancedTabDialog(resource.uuid)); - } - }, - { - icon: StartIcon, - name: "Run Workflow", - execute: (dispatch, resource) => { - dispatch(openRunProcess(resource.uuid, resource.ownerUuid, resource.name)); - } - } -]]; +export const readOnlyWorkflowActionSet: ContextMenuActionSet = [ + [ + { + icon: OpenIcon, + name: "Open in new tab", + execute: (dispatch, resources) => { + dispatch(openInNewTabAction(resources[0])); + }, + }, + { + icon: Link, + name: "Copy to clipboard", + execute: (dispatch, resources) => { + dispatch(copyToClipboardAction(resources)); + }, + }, + { + icon: DetailsIcon, + name: "View details", + execute: dispatch => { + dispatch(toggleDetailsPanel()); + }, + }, + { + icon: AdvancedIcon, + name: "API Details", + execute: (dispatch, resources) => { + dispatch(openAdvancedTabDialog(resources[0].uuid)); + }, + }, + { + icon: StartIcon, + name: "Run Workflow", + execute: (dispatch, resources) => { + dispatch(openRunProcess(resources[0].uuid, resources[0].ownerUuid, resources[0].name)); + }, + }, + ], +]; -export const workflowActionSet: ContextMenuActionSet = [[ - ...readOnlyWorkflowActionSet[0], - { - icon: TrashIcon, - name: "Delete Workflow", - execute: (dispatch, resource) => { - dispatch(deleteWorkflow(resource.uuid, resource.ownerUuid)); - } - }, -]]; +export const workflowActionSet: ContextMenuActionSet = [ + [ + ...readOnlyWorkflowActionSet[0], + { + icon: TrashIcon, + name: "Delete Workflow", + execute: (dispatch, resources) => { + dispatch(deleteWorkflow(resources[0].uuid, resources[0].ownerUuid)); + }, + }, + ], +];