1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { reset, initialize } from "redux-form";
7 import { ContextMenuActionSet } from "../context-menu-action-set";
8 import { projectActions, PROJECT_FORM_NAME } from "~/store/project/project-action";
9 import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } from "~/components/icon/icon";
10 import { ToggleFavoriteAction } from "../actions/favorite-action";
11 import { toggleFavorite } from "~/store/favorites/favorites-actions";
12 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
13 import { openMoveToDialog } from "../../move-to-dialog/move-to-dialog";
14 import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
15 import { openProjectCopyDialog } from "~/views-components/project-copy-dialog/project-copy-dialog";
17 export const projectActionSet: ContextMenuActionSet = [[
21 execute: (dispatch, resource) => {
22 dispatch(reset(PROJECT_CREATE_DIALOG));
23 dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
29 execute: (dispatch, resource) => {
30 dispatch(projectActions.OPEN_PROJECT_UPDATER({ uuid: resource.uuid }));
31 dispatch(initialize(PROJECT_FORM_NAME, { name: resource.name, description: resource.description }));
35 component: ToggleFavoriteAction,
36 execute: (dispatch, resource) => {
37 dispatch<any>(toggleFavorite(resource)).then(() => {
38 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
45 execute: dispatch => dispatch<any>(openMoveToDialog())
49 name: "Copy to project",
50 execute: (dispatch, resource) => {
51 dispatch<any>(openProjectCopyDialog({name: resource.name, projectUuid: resource.uuid}));