15768: changed all context menu actions to take an array of resources Arvados-DCO...
[arvados.git] / 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 } 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 { shareAction, toggleFavoriteAction, openInNewTabMenuAction, copyToClipboardMenuAction, viewDetailsAction, advancedAction, openWith3rdPartyClientAction, freezeProjectAction, editProjectAction, moveToAction, toggleTrashAction, newProjectAction } from "views-components/context-menu/action-sets/project-action-set";
11
12 export const togglePublicFavoriteAction = {
13     component: TogglePublicFavoriteAction,
14     name: 'TogglePublicFavoriteAction',
15     execute: (dispatch, resource) => {
16         dispatch(togglePublicFavorite(resource)).then(() => {
17             dispatch(publicFavoritePanelActions.REQUEST_ITEMS());
18         });
19 }}
20
21 export const projectAdminActionSet: ContextMenuActionSet = [[
22     toggleFavoriteAction,
23     openInNewTabMenuAction,
24     copyToClipboardMenuAction,
25     viewDetailsAction,
26     advancedAction,
27     openWith3rdPartyClientAction,
28     editProjectAction,
29     shareAction,
30     moveToAction,
31     toggleTrashAction,
32     newProjectAction,
33     freezeProjectAction,
34     togglePublicFavoriteAction
35 ]];
36
37 export const filterGroupAdminActionSet: ContextMenuActionSet = [[
38     toggleFavoriteAction,
39     openInNewTabMenuAction,
40     copyToClipboardMenuAction,
41     viewDetailsAction,
42     advancedAction,
43     openWith3rdPartyClientAction,
44     editProjectAction,
45     shareAction,
46     moveToAction,
47     toggleTrashAction,
48     togglePublicFavoriteAction
49 ]];
50
51
52 export const frozenAdminActionSet: ContextMenuActionSet = [[
53     shareAction,
54     togglePublicFavoriteAction,
55     toggleFavoriteAction,
56     openInNewTabMenuAction,
57     copyToClipboardMenuAction,
58     viewDetailsAction,
59     advancedAction,
60     openWith3rdPartyClientAction,
61     freezeProjectAction
62 ]];