Merge branch 'master' into 14155-edit-process
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / 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 "../context-menu-action-set";
6 import { ToggleFavoriteAction } from "../actions/favorite-action";
7 import { toggleFavorite } from "~/store/favorites/favorites-actions";
8 import {
9     RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, ProvenanceGraphIcon,
10     AdvancedIcon, RemoveIcon, ReRunProcessIcon, LogIcon, InputIcon, CommandIcon, OutputIcon
11 } from "~/components/icon/icon";
12 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
13 import { navigateToProcessLogs } from '~/store/navigation/navigation-action';
14 import { openMoveProcessDialog } from '~/store/processes/process-move-actions';
15 import { openProcessUpdateDialog } from "~/store/processes/process-update-actions";
16 import { openCopyProcessDialog } from '~/store/processes/process-copy-actions';
17
18 export const processActionSet: ContextMenuActionSet = [[
19     {
20         icon: RenameIcon,
21         name: "Edit process",
22         execute: (dispatch, resource) => dispatch<any>(openProcessUpdateDialog(resource))
23     },
24     {
25         icon: ShareIcon,
26         name: "Share",
27         execute: (dispatch, resource) => {
28             // add code
29         }
30     },
31     {
32         icon: MoveToIcon,
33         name: "Move to",
34         execute: (dispatch, resource) => dispatch<any>(openMoveProcessDialog(resource))
35     },
36     {
37         component: ToggleFavoriteAction,
38         execute: (dispatch, resource) => {
39             dispatch<any>(toggleFavorite(resource)).then(() => {
40                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
41             });
42         }
43     },
44     {
45         icon: CopyIcon,
46         name: "Copy to project",
47         execute: (dispatch, resource) => dispatch<any>(openCopyProcessDialog(resource))
48     },
49     {
50         icon: ReRunProcessIcon,
51         name: "Re-run process",
52         execute: (dispatch, resource) => {
53             // add code
54         }
55     },
56     {
57         icon: InputIcon,
58         name: "Inputs",
59         execute: (dispatch, resource) => {
60             // add code
61         }
62     },
63     {
64         icon: OutputIcon,
65         name: "Outputs",
66         execute: (dispatch, resource) => {
67             // add code
68         }
69     },
70     {
71         icon: CommandIcon,
72         name: "Command",
73         execute: (dispatch, resource) => {
74             // add code
75         }
76     },
77     {
78         icon: DetailsIcon,
79         name: "View details",
80         execute: (dispatch, resource) => {
81             // add code
82         }
83     },
84     {
85         icon: LogIcon,
86         name: "Log",
87         execute: (dispatch, resource) => {
88             dispatch<any>(navigateToProcessLogs(resource.uuid));
89         }
90     },
91     {
92         icon: ProvenanceGraphIcon,
93         name: "Provenance graph",
94         execute: (dispatch, resource) => {
95             // add code
96         }
97     },
98     {
99         icon: AdvancedIcon,
100         name: "Advanced",
101         execute: (dispatch, resource) => {
102             // add code
103         }
104     },
105     {
106         icon: RemoveIcon,
107         name: "Remove",
108         execute: (dispatch, resource) => {
109             // add code
110         }
111     }
112 ]];