14096-move-to-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
16 export const processActionSet: ContextMenuActionSet = [[
17     {
18         icon: RenameIcon,
19         name: "Edit process",
20         execute: (dispatch, resource) => {
21             // add code
22         }
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) => {
48             // add code
49         }
50     },
51     {
52         icon: ReRunProcessIcon,
53         name: "Re-run process",
54         execute: (dispatch, resource) => {
55             // add code
56         }
57     },
58     {
59         icon: InputIcon,
60         name: "Inputs",
61         execute: (dispatch, resource) => {
62             // add code
63         }
64     },
65     {
66         icon: OutputIcon,
67         name: "Outputs",
68         execute: (dispatch, resource) => {
69             // add code
70         }
71     },
72     {
73         icon: CommandIcon,
74         name: "Command",
75         execute: (dispatch, resource) => {
76             // add code
77         }
78     },
79     {
80         icon: DetailsIcon,
81         name: "View details",
82         execute: (dispatch, resource) => {
83             // add code
84         }
85     },
86     {
87         icon: LogIcon,
88         name: "Log",
89         execute: (dispatch, resource) => {
90             dispatch<any>(navigateToProcessLogs(resource.uuid));
91         }
92     },
93     {
94         icon: ProvenanceGraphIcon,
95         name: "Provenance graph",
96         execute: (dispatch, resource) => {
97             // add code
98         }
99     },
100     {
101         icon: AdvancedIcon,
102         name: "Advanced",
103         execute: (dispatch, resource) => {
104             // add code
105         }
106     },
107     {
108         icon: RemoveIcon,
109         name: "Remove",
110         execute: (dispatch, resource) => {
111             // add code
112         }
113     }
114 ]];