X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/72ed766fa1a94853a1c57d0f43390a81e3d92c90..87fff7ceda76e813646e3fe1c2c41bb8ad567143:/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 4f92aeb813..02a6731ed4 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,46 @@ // SPDX-License-Identifier: AGPL-3.0 import { ContextMenuActionSet } from "../context-menu-action-set"; -import { NewProjectIcon, RenameIcon, 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"; -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'; +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'; +import { copyToClipboardAction, openInNewTabAction } from "store/open-in-new-tab/open-in-new-tab.actions"; +import { openWebDavS3InfoDialog } from "store/collections/collection-info-actions"; export const readOnlyProjectActionSet: ContextMenuActionSet = [[ { component: ToggleFavoriteAction, + name: 'ToggleFavoriteAction', execute: (dispatch, resource) => { dispatch(toggleFavorite(resource)).then(() => { dispatch(favoritePanelActions.REQUEST_ITEMS()); }); } }, + { + icon: OpenIcon, + name: "Open in new tab", + execute: (dispatch, resource) => { + dispatch(openInNewTabAction(resource)); + } + }, + { + icon: Link, + name: "Copy to clipboard", + execute: (dispatch, resource) => { + dispatch(copyToClipboardAction(resource)); + } + }, { icon: DetailsIcon, name: "View details", @@ -40,18 +57,18 @@ export const readOnlyProjectActionSet: ContextMenuActionSet = [[ dispatch(openAdvancedTabDialog(resource.uuid)); } }, + { + icon: FolderSharedIcon, + name: "Access with 3rd party client", + execute: (dispatch, resource) => { + dispatch(openWebDavS3InfoDialog(resource.uuid)); + } + }, ]]; -export const projectActionSet: ContextMenuActionSet = [ +export const filterGroupActionSet: 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", @@ -75,9 +92,23 @@ export const projectActionSet: ContextMenuActionSet = [ }, { 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)); + } + }, + ] +];