X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/219d452e647c01754bf71b91086b15cc9f00027a..58db72fee358d5987139a1b8526c0ca873e07dbf:/src/views-components/context-menu/action-sets/collection-files-action-set.ts 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 9396b9e4..59a5f368 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,34 +2,44 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ContextMenuActionSet } from "../context-menu-action-set"; -import { collectionPanelFilesAction } from "../../../store/collection-panel/collection-panel-files/collection-panel-files-actions"; -import { openRemoveDialog } from "../../remove-dialog/remove-dialog"; +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'; +// 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()); + } + }, + // Disabled while addressing #18587 + // { + // name: "Copy selected into the collection", + // execute: dispatch => { + // dispatch(openCollectionPartialCopyToSelectedCollectionDialog()); + // } + // } +]]; -export const collectionFilesActionSet: ContextMenuActionSet = [[{ - name: "Select all", - execute: (dispatch) => { - dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES()); - } -},{ - name: "Unselect all", - execute: (dispatch) => { - dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES()); - } -},{ - name: "Remove selected", - execute: (dispatch, resource) => { - dispatch(openRemoveDialog('selected files')); - } -},{ - name: "Download selected", - execute: (dispatch, resource) => { - return; - } -},{ - name: "Create a new collection with selected", - execute: (dispatch, resource) => { - return; - } -}]]; +export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[ + { + name: "Remove selected", + execute: dispatch => { + dispatch(openMultipleFilesRemoveDialog()); + } + }, +]]);