X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/22b7bf88fb799c912a813790301f715fb6b8ccf0..5627bf1a83323d2b0364cb069564998eb8c6ca7a:/src/views-components/context-menu/action-sets/project-action-set.ts diff --git a/src/views-components/context-menu/action-sets/project-action-set.ts b/src/views-components/context-menu/action-sets/project-action-set.ts index 4e7a600288..af10aedf80 100644 --- a/src/views-components/context-menu/action-sets/project-action-set.ts +++ b/src/views-components/context-menu/action-sets/project-action-set.ts @@ -2,28 +2,48 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { reset } from "redux-form"; - import { ContextMenuActionSet } from "../context-menu-action-set"; -import { projectActions } from "../../../store/project/project-action"; -import { NewProjectIcon } from "../../../components/icon/icon"; +import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } from "~/components/icon/icon"; import { ToggleFavoriteAction } from "../actions/favorite-action"; -import { toggleFavorite } from "../../../store/favorites/favorites-actions"; -import { favoritePanelActions } from "../../../store/favorite-panel/favorite-panel-action"; -import { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create"; +import { toggleFavorite } from "~/store/favorites/favorites-actions"; +import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action"; +import { openMoveProjectDialog } from '~/store/projects/project-move-actions'; +import { openProjectCreateDialog } from '~/store/projects/project-create-actions'; +import { openProjectUpdateDialog } from '~/store/projects/project-update-actions'; -export const projectActionSet: ContextMenuActionSet = [[{ - icon: NewProjectIcon, - name: "New project", - execute: (dispatch, resource) => { - dispatch(reset(PROJECT_CREATE_DIALOG)); - dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); - } -}, { - component: ToggleFavoriteAction, - execute: (dispatch, resource) => { - dispatch(toggleFavorite(resource)).then(() => { - dispatch(favoritePanelActions.REQUEST_ITEMS()); - }); - } -}]]; +export const projectActionSet: ContextMenuActionSet = [[ + { + icon: NewProjectIcon, + name: "New project", + execute: (dispatch, resource) => { + dispatch(openProjectCreateDialog(resource.uuid)); + } + }, + { + icon: RenameIcon, + name: "Edit project", + execute: (dispatch, resource) => { + dispatch(openProjectUpdateDialog(resource)); + } + }, + { + component: ToggleFavoriteAction, + execute: (dispatch, resource) => { + dispatch(toggleFavorite(resource)).then(() => { + dispatch(favoritePanelActions.REQUEST_ITEMS()); + }); + } + }, + { + icon: MoveToIcon, + name: "Move to", + execute: (dispatch, resource) => dispatch(openMoveProjectDialog(resource)) + }, + { + icon: CopyIcon, + name: "Copy to project", + execute: (dispatch, resource) => { + // add code + } + }, +]];