X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/0a08341c1d88b3f47d6fda46ecd9110d45aaea1d..9555a2020771863c2e4f6b8802bd6850efb37713:/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 5e1182bb..800f57d9 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,7 +3,7 @@ // SPDX-License-Identifier: AGPL-3.0 import { ContextMenuActionSet } from "../context-menu-action-set"; -import { NewProjectIcon, RenameIcon, CopyIcon, MoveToIcon, DetailsIcon, AdvancedIcon } from '~/components/icon/icon'; +import { NewProjectIcon, RenameIcon, MoveToIcon, DetailsIcon, AdvancedIcon, OpenIcon, Link, FolderSharedIcon } 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"; @@ -16,31 +16,13 @@ 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'; +import { copyToClipboardAction, openInNewTabAction } from "~/store/open-in-new-tab/open-in-new-tab.actions"; +import { openWebDavS3InfoDialog } from "~/store/collections/collection-info-actions"; -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)); - } - }, - { - icon: ShareIcon, - name: "Share", - execute: (dispatch, { uuid }) => { - dispatch(openSharingDialog(uuid)); - } - }, +export const readOnlyProjectActionSet: ContextMenuActionSet = [[ { component: ToggleFavoriteAction, + name: 'ToggleFavoriteAction', execute: (dispatch, resource) => { dispatch(toggleFavorite(resource)).then(() => { dispatch(favoritePanelActions.REQUEST_ITEMS()); @@ -48,23 +30,17 @@ export const projectActionSet: ContextMenuActionSet = [[ } }, { - component: ToggleTrashAction, + icon: OpenIcon, + name: "Open in new tab", execute: (dispatch, resource) => { - dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!)); + dispatch(openInNewTabAction(resource)); } }, { - icon: MoveToIcon, - name: "Move to", + icon: Link, + name: "Copy to clipboard", execute: (dispatch, resource) => { - dispatch(openMoveProjectDialog(resource)); - } - }, - { - icon: CopyIcon, - name: "Copy to project", - execute: (dispatch, resource) => { - // add code + dispatch(copyToClipboardAction(resource)); } }, { @@ -81,4 +57,58 @@ export const projectActionSet: ContextMenuActionSet = [[ dispatch(openAdvancedTabDialog(resource.uuid)); } }, + { + icon: FolderSharedIcon, + name: "Open as network folder or S3 bucket", + execute: (dispatch, resource) => { + dispatch(openWebDavS3InfoDialog(resource.uuid)); + } + }, ]]; + +export const filterGroupActionSet: ContextMenuActionSet = [ + [ + ...readOnlyProjectActionSet.reduce((prev, next) => prev.concat(next), []), + { + 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, + name: 'ToggleTrashAction', + execute: (dispatch, resource) => { + dispatch(toggleProjectTrashed(resource.uuid, resource.ownerUuid, resource.isTrashed!!)); + } + }, + ] +]; + +export const projectActionSet: ContextMenuActionSet = [ + [ + ...filterGroupActionSet.reduce((prev, next) => prev.concat(next), []), + { + icon: NewProjectIcon, + name: "New project", + execute: (dispatch, resource) => { + dispatch(openProjectCreateDialog(resource.uuid)); + } + }, + ] +];