X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/8fb7517405c53a71782863fcb5863f9b5a948964..b6ac7fe88d347582d39fffa002e300af222c578f:/src/views-components/context-menu/action-sets/collection-files-action-set.ts?ds=sidebyside diff --git a/src/views-components/context-menu/action-sets/collection-files-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-action-set.ts index 965109ca..3aeec4c0 100644 --- a/src/views-components/context-menu/action-sets/collection-files-action-set.ts +++ b/src/views-components/context-menu/action-sets/collection-files-action-set.ts @@ -2,33 +2,43 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ContextMenuActionSet } from "../context-menu-action-set"; -import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "~/store/collection-panel/collection-panel-files/collection-panel-files-actions"; -import { openCollectionPartialCopyDialog } from '~/store/collection-panel/collection-panel-files/collection-panel-files-actions'; +import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set"; +import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "store/collection-panel/collection-panel-files/collection-panel-files-actions"; +import { openCollectionPartialCopyDialog, openCollectionPartialCopyToSelectedCollectionDialog } from 'store/collections/collection-partial-copy-actions'; -export const collectionFilesActionSet: ContextMenuActionSet = [[{ - name: "Select all", - execute: (dispatch) => { - dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES()); +// These action sets are used on the multi-select actions button. +export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[ + { + name: "Select all", + execute: dispatch => { + dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES()); + } + }, + { + name: "Unselect all", + execute: dispatch => { + dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES()); + } + }, + { + name: "Create a new collection with selected", + execute: dispatch => { + dispatch(openCollectionPartialCopyDialog()); + } + }, + { + name: "Copy selected into the collection", + execute: dispatch => { + dispatch(openCollectionPartialCopyToSelectedCollectionDialog()); + } } -}, { - name: "Unselect all", - execute: (dispatch) => { - dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES()); - } -}, { - name: "Remove selected", - execute: (dispatch) => { - dispatch(openMultipleFilesRemoveDialog()); - } -}, { - name: "Download selected", - execute: (dispatch, resource) => { - return; - } -}, { - name: "Create a new collection with selected", - execute: (dispatch) => { - dispatch(openCollectionPartialCopyDialog()); - } -}]]; +]]; + +export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[ + { + name: "Remove selected", + execute: dispatch => { + dispatch(openMultipleFilesRemoveDialog()); + } + }, +]]);