X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/eb4491eea9ba873845f7a5796d139d19977f8112..c6b3db3a8e2fcb7fe8d44cdd60e12fe7e2be571f:/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 0bed68e9..3e6e1a20 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,35 +2,59 @@ // // 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 { openMultipleFilesRemoveDialog } from "~/views-components/file-remove-dialog/multiple-files-remove-dialog"; -import { createCollectionWithSelected } from "~/views-components/create-collection-dialog-with-selected/create-collection-dialog-with-selected"; +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 { + openCollectionPartialCopyToNewCollectionDialog, + openCollectionPartialCopyToExistingCollectionDialog +} from 'store/collections/collection-partial-copy-actions'; +import { openCollectionPartialMoveToExistingCollectionDialog, openCollectionPartialMoveToNewCollectionDialog } from "store/collections/collection-partial-move-actions"; - -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(openMultipleFilesRemoveDialog()); +// 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: "Copy selected into new collection", + execute: dispatch => { + dispatch(openCollectionPartialCopyToNewCollectionDialog()); + } + }, + { + name: "Copy selected into existing collection", + execute: dispatch => { + dispatch(openCollectionPartialCopyToExistingCollectionDialog()); + } } -}, { - name: "Download selected", - execute: (dispatch, resource) => { - return; - } -}, { - name: "Create a new collection with selected", - execute: (dispatch) => { - dispatch(createCollectionWithSelected()); +]]; + +export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[ + { + name: "Remove selected", + execute: dispatch => { + dispatch(openMultipleFilesRemoveDialog()); + } + }, + { + name: "Move selected into new collection", + execute: dispatch => { + dispatch(openCollectionPartialMoveToNewCollectionDialog()); + } + }, + { + name: "Move selected into existing collection", + execute: dispatch => { + dispatch(openCollectionPartialMoveToExistingCollectionDialog()); + } } -}]]; +]]);