21702: Merge branch 'main' into 21702-keep-web-replace_files
[arvados.git] / services / workbench2 / src / views-components / multiselect-toolbar / ms-user-details-action-set.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { AdvancedIcon, DetailsIcon, UserPanelIcon } from 'components/icon/icon';
6 import { openDetailsPanel } from 'store/details-panel/details-panel-action';
7 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
8 import { navigateToUserProfile } from 'store/navigation/navigation-action';
9 import { ContextMenuActionNames } from "views-components/context-menu/context-menu-action-set";
10 import { MultiSelectMenuActionSet } from './ms-menu-actions';
11
12 export const UserDetailsActionSet: MultiSelectMenuActionSet= [
13     [
14         {
15             name: ContextMenuActionNames.VIEW_DETAILS,
16             icon: DetailsIcon,
17             hasAlts: false,
18             isForMulti: false,
19             execute: (dispatch, resources) => {
20                 dispatch<any>(openDetailsPanel(resources[0].uuid));
21             },
22         },
23         {
24             name: ContextMenuActionNames.USER_ACCOUNT,
25             icon: UserPanelIcon,
26             hasAlts: false,
27             isForMulti: false,
28             execute: (dispatch, resources) => {
29                 dispatch<any>(navigateToUserProfile(resources[0].uuid));
30             },
31         },
32         {
33             name: ContextMenuActionNames.API_DETAILS,
34             icon: AdvancedIcon,
35             hasAlts: false,
36             isForMulti: false,
37             execute: (dispatch, resources) => {
38                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
39             },
40         },
41     ],
42 ];