1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { openRunProcess, openRemoveWorkflowDialog } from 'store/workflow-panel/workflow-panel-actions';
6 import { StartIcon, DeleteForever, 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 for (const resource of [...resources]){
32 dispatch<any>(openRemoveWorkflowDialog(resource, resources.length));
37 const msCopyToClipboardMenuAction: MultiSelectMenuAction = {
38 name: COPY_LINK_TO_CLIPBOARD,
42 execute: (dispatch, resources) => {
43 dispatch<any>(copyToClipboardAction(resources));
47 const msShareAction: MultiSelectMenuAction = {
52 execute: (dispatch, resources) => {
53 dispatch<any>(openSharingDialog(resources[0].uuid));
57 export const msWorkflowActionSet: MultiSelectMenuActionSet = [[...msCommonActionSet, msRunWorkflow, msDeleteWorkflow, msCopyToClipboardMenuAction, msShareAction]];
59 export const msReadOnlyWorkflowActionFilter = new Set([OPEN_IN_NEW_TAB, COPY_LINK_TO_CLIPBOARD, VIEW_DETAILS, API_DETAILS, RUN_WORKFLOW ]);
60 export const msWorkflowActionFilter = new Set([OPEN_IN_NEW_TAB, COPY_LINK_TO_CLIPBOARD, VIEW_DETAILS, API_DETAILS, RUN_WORKFLOW, DELETE_WORKFLOW]);