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';
20 export const readOnlyProjectActionSet: ContextMenuActionSet = [[
22 component: ToggleFavoriteAction,
23 execute: (dispatch, resource) => {
24 dispatch<any>(toggleFavorite(resource)).then(() => {
25 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
32 execute: dispatch => {
33 dispatch<any>(toggleDetailsPanel());
39 execute: (dispatch, resource) => {
40 dispatch<any>(openAdvancedTabDialog(resource.uuid));
45 export const projectActionSet: ContextMenuActionSet = [
47 ...readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []),
51 execute: (dispatch, resource) => {
52 dispatch<any>(openProjectCreateDialog(resource.uuid));
58 execute: (dispatch, resource) => {
59 dispatch<any>(openProjectUpdateDialog(resource));
65 execute: (dispatch, { uuid }) => {
66 dispatch<any>(openSharingDialog(uuid));
72 execute: (dispatch, resource) => {
73 dispatch<any>(openMoveProjectDialog(resource));
77 component: ToggleTrashAction,
78 execute: (dispatch, resource) => {
79 dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));