refs #14876 Copy-selected-into-the-colletion
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-files-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
6 import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "~/store/collection-panel/collection-panel-files/collection-panel-files-actions";
7 import { openCollectionPartialCopyDialog, openCollectionPartialCopyToSelectedCollectionDialog } from '~/store/collections/collection-partial-copy-actions';
8 import { DownloadCollectionFileAction } from "~/views-components/context-menu/actions/download-collection-file-action";
9
10 export const collectionFilesActionSet: ContextMenuActionSet = [[{
11     name: "Select all",
12     execute: dispatch => {
13         dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
14     }
15 }, {
16     name: "Unselect all",
17     execute: dispatch => {
18         dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
19     }
20 }, {
21     name: "Remove selected",
22     execute: dispatch => {
23         dispatch(openMultipleFilesRemoveDialog());
24     }
25 }, {
26     component: DownloadCollectionFileAction,
27     execute: () => { return; }
28 }, {
29     name: "Create a new collection with selected",
30     execute: dispatch => {
31         dispatch<any>(openCollectionPartialCopyDialog());
32     }
33 }, {
34     name: "Copy selected into the collection",
35     execute: dispatch => {
36         dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
37     }
38 }]];