1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
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 import { openProcessUpdateDialog } from "store/processes/process-update-actions";
12 import { openCopyProcessDialog } from 'store/processes/process-copy-actions';
13 import { openSharingDialog } from "store/sharing-dialog/sharing-dialog-actions";
14 import { openRemoveProcessDialog } from "store/processes/processes-actions";
15 import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
17 export const readOnlyProcessResourceActionSet: ContextMenuActionSet = [[
19 component: ToggleFavoriteAction,
20 execute: (dispatch, resource) => {
21 dispatch<any>(toggleFavorite(resource)).then(() => {
22 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
28 name: "Copy to project",
29 execute: (dispatch, resource) => {
30 dispatch<any>(openCopyProcessDialog(resource));
36 execute: dispatch => {
37 dispatch<any>(toggleDetailsPanel());
42 export const processResourceActionSet: ContextMenuActionSet = [[
43 ...readOnlyProcessResourceActionSet.reduce((prev, next) => prev.concat(next), []),
47 execute: (dispatch, resource) => {
48 dispatch<any>(openProcessUpdateDialog(resource));
54 execute: (dispatch, { uuid }) => {
55 dispatch<any>(openSharingDialog(uuid));
61 execute: (dispatch, resource) => {
62 dispatch<any>(openMoveProcessDialog(resource));
68 execute: (dispatch, resource) => {
69 dispatch<any>(openRemoveProcessDialog(resource.uuid));