cf629993989c299ed3cea16ce1bc572428663104
[arvados-workbench2.git] / src / views-components / multiselect-toolbar / ms-process-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
6 import { MoveToIcon, RemoveIcon, ReRunProcessIcon } from "components/icon/icon";
7 import { openMoveProcessDialog } from "store/processes/process-move-actions";
8 import { openCopyProcessDialog } from "store/processes/process-copy-actions";
9 import { openRemoveProcessDialog } from "store/processes/processes-actions";
10
11 export const msProcessActionSet: ContextMenuActionSet = [
12     [
13         {
14             icon: ReRunProcessIcon,
15             name: "Copy and re-run process",
16             execute: (dispatch, resources) => {
17                 resources.forEach(resource => dispatch<any>(openCopyProcessDialog(resource)));
18             },
19         },
20         {
21             icon: MoveToIcon,
22             name: "Move to",
23             execute: (dispatch, resources) => {
24                 dispatch<any>(openMoveProcessDialog(resources[0]));
25             },
26         },
27         {
28             name: "Remove",
29             icon: RemoveIcon,
30             execute: (dispatch, resources) => {
31                 dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
32             },
33         },
34     ],
35 ];