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, 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';
19 import { TogglePublicFavoriteAction } from "~/views-components/context-menu/actions/public-favorite-action";
20 import { togglePublicFavorite } from "~/store/public-favorites/public-favorites-actions";
21 import { publicFavoritePanelActions } from "~/store/public-favorites-panel/public-favorites-action";
23 export const projectAdminActionSet: ContextMenuActionSet = [[
27 execute: (dispatch, resource) => {
28 dispatch<any>(openProjectCreateDialog(resource.uuid));
34 execute: (dispatch, resource) => {
35 dispatch<any>(openProjectUpdateDialog(resource));
41 execute: (dispatch, { uuid }) => {
42 dispatch<any>(openSharingDialog(uuid));
46 component: ToggleFavoriteAction,
47 execute: (dispatch, resource) => {
48 dispatch<any>(toggleFavorite(resource)).then(() => {
49 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
54 component: TogglePublicFavoriteAction,
55 execute: (dispatch, resource) => {
56 dispatch<any>(togglePublicFavorite(resource)).then(() => {
57 dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
64 execute: (dispatch, resource) => {
65 dispatch<any>(openMoveProjectDialog(resource));
70 // name: "Copy to project",
71 // execute: (dispatch, resource) => {
78 execute: dispatch => {
79 dispatch<any>(toggleDetailsPanel());
85 execute: (dispatch, resource) => {
86 dispatch<any>(openAdvancedTabDialog(resource.uuid));
90 component: ToggleTrashAction,
91 execute: (dispatch, resource) => {
92 dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));