1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { openRunProcess, deleteWorkflow } from 'store/workflow-panel/workflow-panel-actions';
6 import { StartIcon, TrashIcon, Link } from 'components/icon/icon';
7 import { MultiSelectMenuAction, MultiSelectMenuActionSet, msCommonActionSet } from './ms-menu-actions';
8 import { ContextMenuActionNames } from 'views-components/context-menu/context-menu-action-set';
9 import { copyToClipboardAction } from 'store/open-in-new-tab/open-in-new-tab.actions';
10 import { openSharingDialog } from 'store/sharing-dialog/sharing-dialog-actions';
11 import { ShareIcon } from 'components/icon/icon';
13 const { OPEN_IN_NEW_TAB, COPY_LINK_TO_CLIPBOARD, VIEW_DETAILS, API_DETAILS, RUN_WORKFLOW, DELETE_WORKFLOW, SHARE } = ContextMenuActionNames;
15 const msRunWorkflow: MultiSelectMenuAction = {
20 execute: (dispatch, resources) => {
21 dispatch<any>(openRunProcess(resources[0].uuid, resources[0].ownerUuid, resources[0].name));
25 const msDeleteWorkflow: MultiSelectMenuAction = {
26 name: DELETE_WORKFLOW,
30 execute: (dispatch, resources) => {
31 dispatch<any>(deleteWorkflow(resources[0].uuid, resources[0].ownerUuid));
35 const msCopyToClipboardMenuAction: MultiSelectMenuAction = {
36 name: COPY_LINK_TO_CLIPBOARD,
40 execute: (dispatch, resources) => {
41 dispatch<any>(copyToClipboardAction(resources));
45 const msShareAction: MultiSelectMenuAction = {
50 execute: (dispatch, resources) => {
51 dispatch<any>(openSharingDialog(resources[0].uuid));
55 export const msWorkflowActionSet: MultiSelectMenuActionSet = [[...msCommonActionSet, msRunWorkflow, msDeleteWorkflow, msCopyToClipboardMenuAction, msShareAction]];
57 export const msReadOnlyWorkflowActionFilter = new Set([OPEN_IN_NEW_TAB, COPY_LINK_TO_CLIPBOARD, VIEW_DETAILS, API_DETAILS, RUN_WORKFLOW ]);
58 export const msWorkflowActionFilter = new Set([OPEN_IN_NEW_TAB, COPY_LINK_TO_CLIPBOARD, VIEW_DETAILS, API_DETAILS, RUN_WORKFLOW, DELETE_WORKFLOW]);