X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/49e31d482873af1328b934bf8f07d8e1d00ce5b6..aebc1ac220838aa4f849473f3dda8d121f6118af:/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 8ae60c8f..9b568332 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,32 +2,42 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { reset, initialize } from "redux-form"; - import { ContextMenuActionSet } from "../context-menu-action-set"; -import { projectActions, PROJECT_FORM_NAME } from "~/store/project/project-action"; -import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon } from "~/components/icon/icon"; +import { NewProjectIcon, RenameIcon, CopyIcon, 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 { PROJECT_CREATE_DIALOG } from "../../dialog-create/dialog-project-create"; -import { openMoveProjectDialog } from '~/store/move-project-dialog/move-project-dialog'; +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 { detailsPanelActions } from '~/store/details-panel/details-panel-action'; +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(reset(PROJECT_CREATE_DIALOG)); - dispatch(projectActions.OPEN_PROJECT_CREATOR({ ownerUuid: resource.uuid })); + dispatch(openProjectCreateDialog(resource.uuid)); } }, { icon: RenameIcon, name: "Edit project", execute: (dispatch, resource) => { - dispatch(projectActions.OPEN_PROJECT_UPDATER({ uuid: resource.uuid })); - dispatch(initialize(PROJECT_FORM_NAME, { name: resource.name, description: resource.description })); + dispatch(openProjectUpdateDialog(resource)); + } + }, + { + icon: ShareIcon, + name: "Share", + execute: (dispatch, { uuid }) => { + dispatch(openSharingDialog(uuid)); } }, { @@ -38,10 +48,18 @@ export const projectActionSet: ContextMenuActionSet = [[ }); } }, + { + component: ToggleTrashAction, + execute: (dispatch, resource) => { + dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!)); + } + }, { icon: MoveToIcon, name: "Move to", - execute: (dispatch, resource) => dispatch(openMoveProjectDialog(resource)) + execute: (dispatch, resource) => { + dispatch(openMoveProjectDialog(resource)); + } }, { icon: CopyIcon, @@ -50,4 +68,18 @@ export const projectActionSet: ContextMenuActionSet = [[ // add code } }, + { + icon: DetailsIcon, + name: "View details", + execute: dispatch => { + dispatch(toggleDetailsPanel()); + } + }, + { + icon: AdvancedIcon, + name: "Advanced", + execute: (dispatch, { uuid, ownerUuid }) => { + dispatch(openAdvancedTabDialog(uuid, ownerUuid)); + } + }, ]];