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 } 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 { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create";
15 export const projectActionSet: ContextMenuActionSet = [[
19 execute: (dispatch, resource) => {
20 dispatch(reset(PROJECT_CREATE_DIALOG));
21 dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid }));
27 execute: (dispatch, resource) => {
28 dispatch(projectActions.OPEN_PROJECT_UPDATER({ uuid: resource.uuid }));
29 dispatch(initialize(PROJECT_FORM_NAME, { name: resource.name, description: resource.description }));
33 component: ToggleFavoriteAction,
34 execute: (dispatch, resource) => {
35 dispatch<any>(toggleFavorite(resource)).then(() => {
36 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());