X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f2b031de2183439f8aade2f290cd0e3f95f6438c..42ec7892e74f6d9d19f2f0155830565f447a861f:/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 653da011..7e885615 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,47 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { ContextMenuActionSet } from "../context-menu-action-set"; +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 { createCollectionWithSelected } from "~/views-components/create-collection-dialog-with-selected/create-collection-dialog-with-selected"; +import { openCollectionPartialCopyDialog, openCollectionPartialCopyToSelectedCollectionDialog } from '~/store/collections/collection-partial-copy-actions'; +// import { DownloadCollectionFileAction } from "~/views-components/context-menu/actions/download-collection-file-action"; - -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) => { - dispatch(openMultipleFilesRemoveDialog()); +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()); + } + }, + // { // Disabled for now as we need to create backend version of this feature which will be less buggy + // component: DownloadCollectionFileAction, + // execute: () => { return; } + // }, + { + name: "Create a new collection with selected", + execute: dispatch => { + dispatch(openCollectionPartialCopyDialog()); + } + }, + { + name: "Copy selected into the collection", + execute: dispatch => { + dispatch(openCollectionPartialCopyToSelectedCollectionDialog()); + } } -}, { - 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()); + } + }, +]]);