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 { detailsPanelActions } from '~/store/details-panel/details-panel-action';
16 import { ShareIcon } from '~/components/icon/icon';
17 import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions";
18 import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab";
19 import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action';
21 export const projectActionSet: ContextMenuActionSet = [[
25 execute: (dispatch, resource) => {
26 dispatch<any>(openProjectCreateDialog(resource.uuid));
32 execute: (dispatch, resource) => {
33 dispatch<any>(openProjectUpdateDialog(resource));
39 execute: (dispatch, { uuid }) => {
40 dispatch<any>(openSharingDialog(uuid));
44 component: ToggleFavoriteAction,
45 execute: (dispatch, resource) => {
46 dispatch<any>(toggleFavorite(resource)).then(() => {
47 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
52 component: ToggleTrashAction,
53 execute: (dispatch, resource) => {
54 dispatch<any>(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!));
60 execute: (dispatch, resource) => {
61 dispatch<any>(openMoveProjectDialog(resource));
66 name: "Copy to project",
67 execute: (dispatch, resource) => {
74 execute: dispatch => {
75 dispatch<any>(toggleDetailsPanel());
81 execute: (dispatch, resource) => {
82 dispatch<any>(openAdvancedTabDialog(resource.uuid));