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, AdvancedIcon } 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 { ShareIcon } from '~/components/icon/icon';
16 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
17 import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
18 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
20 export const projectActionSet: ContextMenuActionSet = [[
24 execute: (dispatch, resource) => {
25 dispatch<any>(openProjectCreateDialog(resource.uuid));
31 execute: (dispatch, resource) => {
32 dispatch<any>(openProjectUpdateDialog(resource));
38 execute: (dispatch, { uuid }) => {
39 dispatch<any>(openSharingDialog(uuid));
43 component: ToggleFavoriteAction,
44 execute: (dispatch, resource) => {
45 dispatch<any>(toggleFavorite(resource)).then(() => {
46 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
51 component: ToggleTrashAction,
52 execute: (dispatch, resource) => {
53 dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
59 execute: (dispatch, resource) => {
60 dispatch<any>(openMoveProjectDialog(resource));
65 // name: "Copy to project",
66 // execute: (dispatch, resource) => {
73 execute: dispatch => {
74 dispatch<any>(toggleDetailsPanel());
80 execute: (dispatch, resource) => {
81 dispatch<any>(openAdvancedTabDialog(resource.uuid));