1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { ContextMenuActionItemSet } from "views-components/context-menu/context-menu-action-set";
6 import { MoveToIcon, CopyIcon } from "components/icon/icon";
7 import { openMoveCollectionDialog } from "store/collections/collection-move-actions";
8 import { openCollectionCopyDialog, openMultiCollectionCopyDialog } from "store/collections/collection-copy-actions";
9 import { ToggleTrashAction } from "views-components/context-menu/actions/trash-action";
10 import { toggleCollectionTrashed } from "store/trash/trash-actions";
11 import { ContextMenuResource } from "store/context-menu/context-menu-actions";
13 export const msCollectionActionSet: ContextMenuActionItemSet = [
18 execute: (dispatch, [...resources]) => {
19 if (resources[0].fromContextMenu || resources.length === 1) dispatch<any>(openCollectionCopyDialog(resources[0]));
20 else dispatch<any>(openMultiCollectionCopyDialog(resources[0]));
26 execute: (dispatch, resources) => dispatch<any>(openMoveCollectionDialog(resources[0])),
29 component: ToggleTrashAction,
30 name: "ToggleTrashAction",
31 execute: (dispatch, resources: ContextMenuResource[]) => {
32 for (const resource of [...resources]) {
33 dispatch<any>(toggleCollectionTrashed(resource.uuid, resource.isTrashed!!));