18692: Initial frozen project implementation with tests
[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 { projectActionSet, filterGroupActionSet } from "views-components/context-menu/action-sets/project-action-set";
11
12 export const projectAdminActionSet: ContextMenuActionSet = [[
13     ...projectActionSet.reduce((prev, next) => prev.concat(next), []),
14     {
15         component: TogglePublicFavoriteAction,
16         name: 'TogglePublicFavoriteAction',
17         execute: (dispatch, resource) => {
18             dispatch<any>(togglePublicFavorite(resource)).then(() => {
19                 dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
20             });
21         }
22     }
23 ]];
24
25 export const filterGroupAdminActionSet: ContextMenuActionSet = [[
26     ...filterGroupActionSet.reduce((prev, next) => prev.concat(next), []),
27     {
28         component: TogglePublicFavoriteAction,
29         name: 'TogglePublicFavoriteAction',
30         execute: (dispatch, resource) => {
31             dispatch<any>(togglePublicFavorite(resource)).then(() => {
32                 dispatch<any>(publicFavoritePanelActions.REQUEST_ITEMS());
33             });
34         }
35     }
36 ]];