1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { MoveToIcon, RemoveIcon, ReRunProcessIcon, OutputIcon, RenameIcon } from "components/icon/icon";
6 import { openMoveProcessDialog } from "store/processes/process-move-actions";
7 import { openCopyProcessDialog } from "store/processes/process-copy-actions";
8 import { openRemoveProcessDialog } from "store/processes/processes-actions";
9 import { MultiSelectMenuAction, MultiSelectMenuActionSet, msCommonActionSet } from "./ms-menu-actions";
10 import { MultiSelectMenuActionNames } from "views-components/multiselect-toolbar/ms-menu-actions";
11 import { openProcessUpdateDialog } from "store/processes/process-update-actions";
12 import { msNavigateToOutput } from "store/multiselect/multiselect-actions";
14 const msCopyAndRerunProcess: MultiSelectMenuAction = {
15 name: MultiSelectMenuActionNames.COPY_AND_RERUN_PROCESS,
16 icon: ReRunProcessIcon,
19 execute: (dispatch, resources) => {
20 for (const resource of [...resources]) {
21 dispatch<any>(openCopyProcessDialog(resource));
26 const msRemoveProcess: MultiSelectMenuAction = {
27 name: MultiSelectMenuActionNames.REMOVE,
31 execute: (dispatch, resources) => {
32 dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
36 const msMoveTo: MultiSelectMenuAction = {
37 name: MultiSelectMenuActionNames.MOVE_TO,
41 execute: (dispatch, resources) => {
42 dispatch<any>(openMoveProcessDialog(resources[0]));
46 const msViewOutputs: MultiSelectMenuAction = {
47 name: MultiSelectMenuActionNames.OUTPUTS,
51 execute: (dispatch, resources) => {
53 dispatch<any>(msNavigateToOutput(resources[0]));
58 const msEditProcess: MultiSelectMenuAction = {
59 name: MultiSelectMenuActionNames.EDIT_PROCESS,
63 execute: (dispatch, resources) => {
64 dispatch<any>(openProcessUpdateDialog(resources[0]));
68 export const msProcessActionSet: MultiSelectMenuActionSet = [
71 msCopyAndRerunProcess,
79 const { MOVE_TO, REMOVE, COPY_AND_RERUN_PROCESS, ADD_TO_FAVORITES, OPEN_IN_NEW_TAB, VIEW_DETAILS, API_DETAILS, SHARE, ADD_TO_PUBLIC_FAVORITES, OUTPUTS, EDIT_PROCESS } = MultiSelectMenuActionNames
81 export const msCommonProcessActionFilter = new Set([MOVE_TO, REMOVE, COPY_AND_RERUN_PROCESS, ADD_TO_FAVORITES, OPEN_IN_NEW_TAB, VIEW_DETAILS, API_DETAILS, SHARE, ADD_TO_PUBLIC_FAVORITES, OUTPUTS, EDIT_PROCESS ]);