merge master
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-resource-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 "../context-menu-action-set";
6 import { ToggleFavoriteAction } from "../actions/favorite-action";
7 import { toggleFavorite } from "~/store/favorites/favorites-actions";
8 import { RenameIcon, ShareIcon, MoveToIcon, CopyIcon, DetailsIcon, RemoveIcon } from "~/components/icon/icon";
9 import { openUpdater } from "~/store/collections/updater/collection-updater-action";
10 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
11 import { openMoveToDialog } from "../../move-to-dialog/move-to-dialog";
12
13 export const collectionResourceActionSet: ContextMenuActionSet = [[
14     {
15         icon: RenameIcon,
16         name: "Edit collection",
17         execute: (dispatch, resource) => {
18             dispatch<any>(openUpdater(resource));
19         }
20     },
21     {
22         icon: ShareIcon,
23         name: "Share",
24         execute: (dispatch, resource) => {
25             // add code
26         }
27     },
28     {
29         icon: MoveToIcon,
30         name: "Move to",
31         execute: (dispatch) => {
32             dispatch<any>(openMoveToDialog());
33         }
34     },
35     {
36         component: ToggleFavoriteAction,
37         execute: (dispatch, resource) => {
38             dispatch<any>(toggleFavorite(resource)).then(() => {
39                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
40             });
41         }
42     },
43     {
44         icon: CopyIcon,
45         name: "Copy to project",
46         execute: (dispatch, resource) => {
47             // add code
48         }
49     },
50     {
51         icon: DetailsIcon,
52         name: "View details",
53         execute: (dispatch, resource) => {
54             // add code
55         }
56     },
57     {
58         icon: RemoveIcon,
59         name: "Remove",
60         execute: (dispatch, resource) => {
61             // add code
62         }
63     }
64 ]];