44a5e51f6f84a602e217d727af7d1800312cc8a2
[arvados-workbench2.git] / src / views-components / multiselect-toolbar / ms-menu-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Dispatch } from "redux";
6 import { IconType } from "components/icon/icon";
7 import { ResourcesState } from "store/resources/resources";
8 import { FavoritesState } from "store/favorites/favorites-reducer";
9 import { ContextMenuResource } from "store/context-menu/context-menu-actions";
10
11 export const MultiSelectMenuActionNames = {
12   MAKE_A_COPY: "Make a copy",
13   MOVE_TO: "Move to",
14   ADD_TO_TRASH: "Add to Trash",
15   ADD_TO_FAVORITES: "Add to Favorites",
16   COPY_TO_CLIPBOARD: "Copy to clipboard",
17   COPY_AND_RERUN_PROCESS: "Copy and re-run process",
18   REMOVE: "Remove",
19 };
20
21 export type MultiSelectMenuAction = {
22     name: string;
23     icon: IconType;
24     altText?: string;
25     altIcon?: IconType;
26     isForMulti: boolean;
27     isDefault?: (uuid: string | null, resources: ResourcesState, favorites: FavoritesState) => boolean;
28     execute(dispatch: Dispatch, resources: ContextMenuResource[], state?: any): void;
29     adminOnly?: boolean;
30 };
31
32 export type MultiSelectMenuActionSet = MultiSelectMenuAction[][];