2897455bc4f2b2479e55f52c91729ab13cd5b995
[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
15 export const processActionSet: ContextMenuActionSet = [[
16     {
17         icon: RenameIcon,
18         name: "Edit process",
19         execute: (dispatch, resource) => {
20             // add code
21         }
22     },
23     {
24         icon: ShareIcon,
25         name: "Share",
26         execute: (dispatch, resource) => {
27             // add code
28         }
29     },
30     {
31         icon: MoveToIcon,
32         name: "Move to",
33         execute: (dispatch, resource) => {
34             // add code
35         }
36     },
37     {
38         component: ToggleFavoriteAction,
39         execute: (dispatch, resource) => {
40             dispatch<any>(toggleFavorite(resource)).then(() => {
41                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
42             });
43         }
44     },
45     {
46         icon: CopyIcon,
47         name: "Copy to project",
48         execute: (dispatch, resource) => {
49             // add code
50         }
51     },
52     {
53         icon: ReRunProcessIcon,
54         name: "Re-run process",
55         execute: (dispatch, resource) => {
56             // add code
57         }
58     },
59     {
60         icon: InputIcon,
61         name: "Inputs",
62         execute: (dispatch, resource) => {
63             // add code
64         }
65     },
66     {
67         icon: OutputIcon,
68         name: "Outputs",
69         execute: (dispatch, resource) => {
70             // add code
71         }
72     },
73     {
74         icon: CommandIcon,
75         name: "Command",
76         execute: (dispatch, resource) => {
77             // add code
78         }
79     },
80     {
81         icon: DetailsIcon,
82         name: "View details",
83         execute: (dispatch, resource) => {
84             // add code
85         }
86     },
87     {
88         icon: LogIcon,
89         name: "Log",
90         execute: (dispatch, resource) => {
91             dispatch<any>(navigateToProcessLogs(resource.uuid));
92         }
93     },
94     {
95         icon: ProvenanceGraphIcon,
96         name: "Provenance graph",
97         execute: (dispatch, resource) => {
98             // add code
99         }
100     },
101     {
102         icon: AdvancedIcon,
103         name: "Advanced",
104         execute: (dispatch, resource) => {
105             // add code
106         }
107     },
108     {
109         icon: RemoveIcon,
110         name: "Remove",
111         execute: (dispatch, resource) => {
112             // add code
113         }
114     }
115 ]];