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 { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon, DetailsIcon } from '~/components/icon/icon';
7 import { ToggleFavoriteAction } from "../actions/favorite-action";
8 import { toggleFavorite } from "~/store/favorites/favorites-actions";
9 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
10 import { openMoveProjectDialog } from '~/store/projects/project-move-actions';
11 import { openProjectCreateDialog } from '~/store/projects/project-create-actions';
12 import { openProjectUpdateDialog } from '~/store/projects/project-update-actions';
13 import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action";
14 import { toggleProjectTrashed } from "~/store/trash/trash-actions";
15 import { detailsPanelActions } from '~/store/details-panel/details-panel-action';
17 export const projectActionSet: ContextMenuActionSet = [[
21 execute: (dispatch, resource) => {
22 dispatch<any>(openProjectCreateDialog(resource.uuid));
28 execute: (dispatch, resource) => {
29 dispatch<any>(openProjectUpdateDialog(resource));
33 component: ToggleFavoriteAction,
34 execute: (dispatch, resource) => {
35 dispatch<any>(toggleFavorite(resource)).then(() => {
36 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
41 component: ToggleTrashAction,
42 execute: (dispatch, resource) => {
43 dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
49 execute: (dispatch, resource) => dispatch<any>(openMoveProjectDialog(resource))
53 name: "Copy to project",
54 execute: (dispatch, resource) => {
61 execute: dispatch => dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL())