Merge branch 'master' into 13894-default-view-component
[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
12 export const collectionResourceActionSet: ContextMenuActionSet = [[
13     {
14         icon: RenameIcon,
15         name: "Edit collection",
16         execute: (dispatch, resource) => {
17             dispatch<any>(openUpdater(resource));
18         }
19     },
20     {
21         icon: ShareIcon,
22         name: "Share",
23         execute: (dispatch, resource) => {
24             // add code
25         }
26     },
27     {
28         icon: MoveToIcon,
29         name: "Move to",
30         execute: (dispatch, resource) => {
31             // add code
32         }
33     },
34     {
35         component: ToggleFavoriteAction,
36         execute: (dispatch, resource) => {
37             dispatch<any>(toggleFavorite(resource)).then(() => {
38                 dispatch<any>(favoritePanelActions.REQUEST_ITEMS());
39             });
40         }
41     },
42     {
43         icon: CopyIcon,
44         name: "Copy to project",
45         execute: (dispatch, resource) => {
46             // add code
47         }
48     },
49     {
50         icon: DetailsIcon,
51         name: "View details",
52         execute: (dispatch, resource) => {
53             // add code
54         }
55     },
56     {
57         icon: RemoveIcon,
58         name: "Remove",
59         execute: (dispatch, resource) => {
60             // add code
61         }
62     }
63 ]];