1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
6 import { ToggleFavoriteAction } from "views-components/context-menu/actions/favorite-action";
7 import { toggleFavorite } from "store/favorites/favorites-actions";
9 RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon,
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 import { openProcessCommandDialog } from 'store/processes/process-command-actions';
18 import { openSharingDialog } from "store/sharing-dialog/sharing-dialog-actions";
19 import { openAdvancedTabDialog } from "store/advanced-tab/advanced-tab";
20 import { openProcessInputDialog } from "store/processes/process-input-actions";
21 import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
22 import { openRemoveProcessDialog, reRunProcess } from "store/processes/processes-actions";
23 import { navigateToOutput } from "store/process-panel/process-panel-actions";
24 import { snackbarActions, SnackbarKind } from "store/snackbar/snackbar-actions";
26 export const processActionSet: ContextMenuActionSet = [[
30 execute: (dispatch, resource) => {
31 dispatch<any>(openProcessUpdateDialog(resource));
37 execute: (dispatch, { uuid }) => {
38 dispatch<any>(openSharingDialog(uuid));
42 component: ToggleFavoriteAction,
43 execute: (dispatch, resource) => {
44 dispatch<any>(toggleFavorite(resource)).then(() => {
45 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
52 execute: (dispatch, resource) => {
53 dispatch<any>(openMoveProcessDialog(resource));
58 name: "Copy to project",
59 execute: (dispatch, resource) => {
60 dispatch<any>(openCopyProcessDialog(resource));
64 icon: ReRunProcessIcon,
65 name: "Re-run process",
66 execute: (dispatch, resource) => {
67 if(resource.workflowUuid) {
68 dispatch<any>(reRunProcess(resource.uuid, resource.workflowUuid));
70 dispatch(snackbarActions.OPEN_SNACKBAR({ message: `You can't re-run this process`, hideDuration: 2000, kind: SnackbarKind.ERROR }));
77 execute: (dispatch, resource) => {
78 dispatch<any>(openProcessInputDialog(resource.uuid));
84 execute: (dispatch, resource) => {
85 if(resource.outputUuid){
86 dispatch<any>(navigateToOutput(resource.outputUuid));
93 execute: (dispatch, resource) => {
94 dispatch<any>(openProcessCommandDialog(resource.uuid));
100 execute: (dispatch, resource) => {
101 dispatch<any>(navigateToProcessLogs(resource.uuid));
106 name: "View details",
107 execute: dispatch => {
108 dispatch<any>(toggleDetailsPanel());
112 // icon: ProvenanceGraphIcon,
113 // name: "Provenance graph",
114 // execute: (dispatch, resource) => {
121 execute: (dispatch, resource) => {
122 dispatch<any>(openAdvancedTabDialog(resource.uuid));
128 execute: (dispatch, resource) => {
129 dispatch<any>(openRemoveProcessDialog(resource.uuid));