X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/aebc1ac220838aa4f849473f3dda8d121f6118af..9ee35a64c605f116aec71f78c65b54730d6e1076:/src/views-components/context-menu/action-sets/collection-action-set.ts diff --git a/src/views-components/context-menu/action-sets/collection-action-set.ts b/src/views-components/context-menu/action-sets/collection-action-set.ts index 2dc2a92e..7fa6f224 100644 --- a/src/views-components/context-menu/action-sets/collection-action-set.ts +++ b/src/views-components/context-menu/action-sets/collection-action-set.ts @@ -5,33 +5,18 @@ import { ContextMenuActionSet } from "../context-menu-action-set"; import { ToggleFavoriteAction } from "../actions/favorite-action"; import { toggleFavorite } from "~/store/favorites/favorites-actions"; -import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, ProvenanceGraphIcon, AdvancedIcon, RemoveIcon } from "~/components/icon/icon"; +import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, AdvancedIcon } from "~/components/icon/icon"; import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions"; import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action"; import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions'; import { openCollectionCopyDialog } from "~/store/collections/collection-copy-actions"; import { ToggleTrashAction } from "~/views-components/context-menu/actions/trash-action"; import { toggleCollectionTrashed } from "~/store/trash/trash-actions"; -import { detailsPanelActions } from '~/store/details-panel/details-panel-action'; 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 collectionActionSet: ContextMenuActionSet = [[ - { - icon: RenameIcon, - name: "Edit collection", - execute: (dispatch, resource) => { - dispatch(openCollectionUpdateDialog(resource)); - } - }, - { - icon: ShareIcon, - name: "Share", - execute: (dispatch, { uuid }) => { - dispatch(openSharingDialog(uuid)); - } - }, +export const readOnlyCollectionActionSet: ContextMenuActionSet = [[ { component: ToggleFavoriteAction, execute: (dispatch, resource) => { @@ -40,20 +25,9 @@ export const collectionActionSet: ContextMenuActionSet = [[ }); } }, - { - component: ToggleTrashAction, - execute: (dispatch, resource) => { - dispatch(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!)); - } - }, - { - icon: MoveToIcon, - name: "Move to", - execute: (dispatch, resource) => dispatch(openMoveCollectionDialog(resource)) - }, { icon: CopyIcon, - name: "Copy to project", + name: "Make a copy", execute: (dispatch, resource) => { dispatch(openCollectionCopyDialog(resource)); } @@ -66,25 +40,42 @@ export const collectionActionSet: ContextMenuActionSet = [[ dispatch(toggleDetailsPanel()); } }, - // { - // icon: ProvenanceGraphIcon, - // name: "Provenance graph", - // execute: (dispatch, resource) => { - // // add code - // } - // }, { icon: AdvancedIcon, name: "Advanced", - execute: (dispatch, { uuid, ownerUuid }) => { - dispatch(openAdvancedTabDialog(uuid, ownerUuid)); + execute: (dispatch, resource) => { + dispatch(openAdvancedTabDialog(resource.uuid)); } - } - // { - // icon: RemoveIcon, - // name: "Remove", - // execute: (dispatch, resource) => { - // // add code - // } - // } + }, ]]; + +export const collectionActionSet: ContextMenuActionSet = [ + [ + ...readOnlyCollectionActionSet.reduce((prev, next) => prev.concat(next), []), + { + icon: RenameIcon, + name: "Edit collection", + execute: (dispatch, resource) => { + dispatch(openCollectionUpdateDialog(resource)); + } + }, + { + icon: ShareIcon, + name: "Share", + execute: (dispatch, { uuid }) => { + dispatch(openSharingDialog(uuid)); + } + }, + { + icon: MoveToIcon, + name: "Move to", + execute: (dispatch, resource) => dispatch(openMoveCollectionDialog(resource)) + }, + { + component: ToggleTrashAction, + execute: (dispatch, resource) => { + dispatch(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!)); + } + }, + ] +];