17579: added better description for the test
[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
9 // These action sets are used on the multi-select actions button.
10 export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[
11     {
12         name: "Select all",
13         execute: dispatch => {
14             dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
15         }
16     },
17     {
18         name: "Unselect all",
19         execute: dispatch => {
20             dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
21         }
22     },
23     {
24         name: "Create a new collection with selected",
25         execute: dispatch => {
26             dispatch<any>(openCollectionPartialCopyDialog());
27         }
28     },
29     {
30         name: "Copy selected into the collection",
31         execute: dispatch => {
32             dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
33         }
34     }
35 ]];
36
37 export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[
38     {
39         name: "Remove selected",
40         execute: dispatch => {
41             dispatch(openMultipleFilesRemoveDialog());
42         }
43     },
44 ]]);