Merge branch '21705-go-deps-update-all'
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / project-admin-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { ContextMenuActionSet, ContextMenuActionNames } from "../context-menu-action-set";
6 import { TogglePublicFavoriteAction } from "views-components/context-menu/actions/public-favorite-action";
7 import { togglePublicFavorite } from "store/public-favorites/public-favorites-actions";
8 import { publicFavoritePanelActions } from "store/public-favorites-panel/public-favorites-action";
9
10 import {
11     shareAction,
12     toggleFavoriteAction,
13     openInNewTabMenuAction,
14     copyToClipboardMenuAction,
15     viewDetailsAction,
16     advancedAction,
17     openWith3rdPartyClientAction,
18     freezeProjectAction,
19     editProjectAction,
20     moveToAction,
21     toggleTrashAction,
22     newProjectAction,
23 } from "views-components/context-menu/action-sets/project-action-set";
24
25 export const togglePublicFavoriteAction = {
26     component: TogglePublicFavoriteAction,
27     name: ContextMenuActionNames.ADD_TO_PUBLIC_FAVORITES,
28     execute: (dispatch, resources) => {
29         dispatch(togglePublicFavorite(resources[0])).then(() => {
30             dispatch(publicFavoritePanelActions.REQUEST_ITEMS());
31         });
32     },
33 };
34
35 export const projectAdminActionSet: ContextMenuActionSet = [
36     [
37         toggleFavoriteAction,
38         openInNewTabMenuAction,
39         copyToClipboardMenuAction,
40         viewDetailsAction,
41         advancedAction,
42         openWith3rdPartyClientAction,
43         editProjectAction,
44         shareAction,
45         moveToAction,
46         toggleTrashAction,
47         newProjectAction,
48         freezeProjectAction,
49         togglePublicFavoriteAction,
50     ],
51 ];
52
53 export const filterGroupAdminActionSet: ContextMenuActionSet = [
54     [
55         toggleFavoriteAction,
56         openInNewTabMenuAction,
57         copyToClipboardMenuAction,
58         viewDetailsAction,
59         advancedAction,
60         openWith3rdPartyClientAction,
61         editProjectAction,
62         shareAction,
63         moveToAction,
64         toggleTrashAction,
65         togglePublicFavoriteAction,
66     ],
67 ];
68
69 export const frozenAdminActionSet: ContextMenuActionSet = [
70     [
71         shareAction,
72         togglePublicFavoriteAction,
73         toggleFavoriteAction,
74         openInNewTabMenuAction,
75         copyToClipboardMenuAction,
76         viewDetailsAction,
77         advancedAction,
78         openWith3rdPartyClientAction,
79         freezeProjectAction,
80     ],
81 ];