Merge branch 'main' from workbench2.git
[arvados.git] / services / workbench2 / 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                 for (const resource of [...resources]) {
18                     dispatch<any>(openCopyProcessDialog(resource));
19                 }
20             },
21         },
22         {
23             icon: MoveToIcon,
24             name: "Move to",
25             execute: (dispatch, resources) => {
26                 dispatch<any>(openMoveProcessDialog(resources[0]));
27             },
28         },
29         {
30             name: "Remove",
31             icon: RemoveIcon,
32             execute: (dispatch, resources) => {
33                 dispatch<any>(openRemoveProcessDialog(resources[0], resources.length));
34             },
35         },
36     ],
37 ];