Merge branch '19294-sharing-dialog-overflow' into main. Closes #19294
[arvados.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 {
8     openCollectionPartialCopyDialog,
9     // Disabled while addressing #18587
10     // openCollectionPartialCopyToSelectedCollectionDialog
11 } from 'store/collections/collection-partial-copy-actions';
12
13 // These action sets are used on the multi-select actions button.
14 export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[
15     {
16         name: "Select all",
17         execute: dispatch => {
18             dispatch(collectionPanelFilesAction.SELECT_ALL_COLLECTION_FILES());
19         }
20     },
21     {
22         name: "Unselect all",
23         execute: dispatch => {
24             dispatch(collectionPanelFilesAction.UNSELECT_ALL_COLLECTION_FILES());
25         }
26     },
27     {
28         name: "Create a new collection with selected",
29         execute: dispatch => {
30             dispatch<any>(openCollectionPartialCopyDialog());
31         }
32     },
33     // Disabled while addressing #18587
34     // {
35     //     name: "Copy selected into the collection",
36     //     execute: dispatch => {
37     //         dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
38     //     }
39     // }
40 ]];
41
42 export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[
43     {
44         name: "Remove selected",
45         execute: dispatch => {
46             dispatch(openMultipleFilesRemoveDialog());
47         }
48     },
49 ]]);