22229: Menu edits
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / group-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 'views-components/context-menu/context-menu-action-set';
6 import { RenameIcon, AdvancedIcon, RemoveIcon, DetailsIcon } from 'components/icon/icon';
7 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
8 import { openRemoveGroupDialog, openGroupUpdateDialog } from 'store/groups-panel/groups-panel-actions';
9 import { toggleDetailsPanel } from 'store/details-panel/details-panel-action';
10
11 export const groupActionSet: ContextMenuActionSet = [
12     [
13         {
14             name: ContextMenuActionNames.RENAME,
15             icon: RenameIcon,
16             execute: (dispatch, resources) => {
17                 dispatch<any>(openGroupUpdateDialog(resources[0]))
18             },
19         },
20         {
21             name: ContextMenuActionNames.API_DETAILS,
22             icon: AdvancedIcon,
23             execute: (dispatch, resources) => {
24                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
25             },
26         },
27         {
28             name: ContextMenuActionNames.REMOVE,
29             icon: RemoveIcon,
30             execute: (dispatch, resources) => {
31                 dispatch<any>(openRemoveGroupDialog(resources[0].uuid));
32             },
33         },
34         {
35             name: ContextMenuActionNames.VIEW_DETAILS,
36             icon: DetailsIcon,
37             execute: (dispatch, resources) => {
38                 dispatch<any>(toggleDetailsPanel(resources[0].uuid));
39             },
40         }
41     ],
42 ];