add edit process - actions, dialogs and files
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / process-resource-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 "../context-menu-action-set";
6 import { ToggleFavoriteAction } from "../actions/favorite-action";
7 import { toggleFavorite } from "~/store/favorites/favorites-actions";
8 import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
9 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
10 import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
11 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
12
13 export const processResourceActionSet: ContextMenuActionSet = [[
14     {
15         icon: RenameIcon,
16         name: "Edit process",
17         execute: (dispatch, resource) => {
18             dispatch<any>(openProcessUpdateDialog(resource));
19         }
20     },
21     {
22         icon: ShareIcon,
23         name: "Share",
24         execute: (dispatch, resource) => {
25             // add code
26         }
27     },
28     {
29         icon: MoveToIcon,
30         name: "Move to",
31         execute: (dispatch, resource) => dispatch<any>(openMoveProcessDialog(resource))
32     },
33     {
34         component: ToggleFavoriteAction,
35         execute: (dispatch, resource) => {
36             dispatch<any>(toggleFavorite(resource)).then(() => {
37                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
38             });
39         }
40     },
41     {
42         icon: CopyIcon,
43         name: "Copy to project",
44         execute: (dispatch, resource) => {
45             // add code
46         }
47     },
48     {
49         icon: DetailsIcon,
50         name: "View details",
51         execute: (dispatch, resource) => {
52             // add code
53         }
54     },
55     {
56         icon: RemoveIcon,
57         name: "Remove",
58         execute: (dispatch, resource) => {
59             // add code
60         }
61     }
62 ]];