Merge branch '14096-move-to-process'
[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
12 export const processResourceActionSet: ContextMenuActionSet = [[
13     {
14         icon: RenameIcon,
15         name: "Edit process",
16         execute: (dispatch, resource) => {
17             // add code
18         }
19     },
20     {
21         icon: ShareIcon,
22         name: "Share",
23         execute: (dispatch, resource) => {
24             // add code
25         }
26     },
27     {
28         icon: MoveToIcon,
29         name: "Move to",
30         execute: (dispatch, resource) => dispatch<any>(openMoveProcessDialog(resource))
31     },
32     {
33         component: ToggleFavoriteAction,
34         execute: (dispatch, resource) => {
35             dispatch<any>(toggleFavorite(resource)).then(() => {
36                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
37             });
38         }
39     },
40     {
41         icon: CopyIcon,
42         name: "Copy to project",
43         execute: (dispatch, resource) => {
44             // add code
45         }
46     },
47     {
48         icon: DetailsIcon,
49         name: "View details",
50         execute: (dispatch, resource) => {
51             // add code
52         }
53     },
54     {
55         icon: RemoveIcon,
56         name: "Remove",
57         execute: (dispatch, resource) => {
58             // add code
59         }
60     }
61 ]];