1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { MoveToIcon, CopyIcon } from "components/icon/icon";
6 import { openMoveCollectionDialog } from "store/collections/collection-move-actions";
7 import { openCollectionCopyDialog, openMultiCollectionCopyDialog } from "store/collections/collection-copy-actions";
8 import { toggleCollectionTrashed } from "store/trash/trash-actions";
9 import { ContextMenuResource } from "store/context-menu/context-menu-actions";
10 import { MultiSelectMenuActionSet, MultiSelectMenuActionNames } from "./ms-menu-actions";
11 import { TrashIcon } from "components/icon/icon";
13 export const msCollectionActionSet: MultiSelectMenuActionSet = [
16 name: MultiSelectMenuActionNames.MAKE_A_COPY,
20 execute: (dispatch, [...resources]) => {
21 if (resources[0].fromContextMenu || resources.length === 1) dispatch<any>(openCollectionCopyDialog(resources[0]));
22 else dispatch<any>(openMultiCollectionCopyDialog(resources[0]));
26 name: MultiSelectMenuActionNames.MOVE_TO,
30 execute: (dispatch, resources) => dispatch<any>(openMoveCollectionDialog(resources[0])),
33 name: MultiSelectMenuActionNames.ADD_TO_TRASH,
37 execute: (dispatch, resources: ContextMenuResource[]) => {
38 for (const resource of [...resources]) {
39 dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));