Change move-to feature - files path, rename variables and files
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / collection-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, ProvenanceGraphIcon, AdvancedIcon, RemoveIcon } from "~/components/icon/icon";
9 import { openCollectionUpdateDialog } from "~/store/collections/collection-update-actions";
10 import { favoritePanelActions } from "~/store/favorite-panel/favorite-panel-action";
11 import { openMoveCollectionDialog } from '~/store/collections/collection-move-actions';
12 import { openCollectionCopyDialog } from "~/store/collections/collection-copy-actions";
13
14 export const collectionActionSet: ContextMenuActionSet = [[
15     {
16         icon: RenameIcon,
17         name: "Edit collection",
18         execute: (dispatch, resource) => {
19             dispatch<any>(openCollectionUpdateDialog(resource));
20         }
21     },
22     {
23         icon: ShareIcon,
24         name: "Share",
25         execute: (dispatch, resource) => {
26             // add code
27         }
28     },
29     {
30         icon: MoveToIcon,
31         name: "Move to",
32         execute: (dispatch, resource) => dispatch<any>(openMoveCollectionDialog(resource))
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             dispatch<any>(openCollectionCopyDialog(resource));
47         }
48     },
49     {
50         icon: DetailsIcon,
51         name: "View details",
52         execute: (dispatch, resource) => {
53             // add code
54         }
55     },
56     {
57         icon: ProvenanceGraphIcon,
58         name: "Provenance graph",
59         execute: (dispatch, resource) => {
60             // add code
61         }
62     },
63     {
64         icon: AdvancedIcon,
65         name: "Advanced",
66         execute: (dispatch, resource) => {
67             // add code
68         }
69     },
70     {
71         icon: RemoveIcon,
72         name: "Remove",
73         execute: (dispatch, resource) => {
74             // add code
75         }
76     }
77 ]];