X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/5627bf1a83323d2b0364cb069564998eb8c6ca7a..35ce0164f3863e7117fade1319ed3c2789bc216a:/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 af10aedf..4f92aeb8 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 @@ -3,29 +3,21 @@ // SPDX-License-Identifier: AGPL-3.0 import { ContextMenuActionSet } from "../context-menu-action-set"; -import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } from "~/components/icon/icon"; +import { NewProjectIcon, RenameIcon, MoveToIcon, DetailsIcon, AdvancedIcon } 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 { openMoveProjectDialog } from '~/store/projects/project-move-actions'; import { openProjectCreateDialog } from '~/store/projects/project-create-actions'; import { openProjectUpdateDialog } from '~/store/projects/project-update-actions'; +import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action"; +import { toggleProjectTrashed } from "~/store/trash/trash-actions"; +import { ShareIcon } from '~/components/icon/icon'; +import { openSharingDialog } from "~/store/sharing-dialog/sharing-dialog-actions"; +import { openAdvancedTabDialog } from "~/store/advanced-tab/advanced-tab"; +import { toggleDetailsPanel } from '~/store/details-panel/details-panel-action'; -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)); - } - }, +export const readOnlyProjectActionSet: ContextMenuActionSet = [[ { component: ToggleFavoriteAction, execute: (dispatch, resource) => { @@ -35,15 +27,57 @@ export const projectActionSet: ContextMenuActionSet = [[ } }, { - icon: MoveToIcon, - name: "Move to", - execute: (dispatch, resource) => dispatch(openMoveProjectDialog(resource)) + icon: DetailsIcon, + name: "View details", + execute: dispatch => { + dispatch(toggleDetailsPanel()); + } }, { - icon: CopyIcon, - name: "Copy to project", + icon: AdvancedIcon, + name: "Advanced", execute: (dispatch, resource) => { - // add code + dispatch(openAdvancedTabDialog(resource.uuid)); } }, ]]; + +export const projectActionSet: ContextMenuActionSet = [ + [ + ...readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []), + { + icon: NewProjectIcon, + name: "New project", + execute: (dispatch, resource) => { + dispatch(openProjectCreateDialog(resource.uuid)); + } + }, + { + icon: RenameIcon, + name: "Edit project", + execute: (dispatch, resource) => { + dispatch(openProjectUpdateDialog(resource)); + } + }, + { + icon: ShareIcon, + name: "Share", + execute: (dispatch, { uuid }) => { + dispatch(openSharingDialog(uuid)); + } + }, + { + icon: MoveToIcon, + name: "Move to", + execute: (dispatch, resource) => { + dispatch(openMoveProjectDialog(resource)); + } + }, + { + component: ToggleTrashAction, + execute: (dispatch, resource) => { + dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!)); + } + }, + ] +];