Merge branch '21020-pysdk-env-paths'
[arvados.git] / services / workbench2 / src / views-components / context-menu / action-sets / 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 { ContextMenuActionSet } from 'views-components/context-menu/context-menu-action-set';
6 import { AdvancedIcon, AttributesIcon, UserPanelIcon } from 'components/icon/icon';
7 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
8 import { openUserAttributes } from 'store/users/users-actions';
9 import { navigateToUserProfile } from 'store/navigation/navigation-action';
10 import { needsUserProfileLink } from 'store/context-menu/context-menu-filters';
11
12 export const UserDetailsActionSet: ContextMenuActionSet = [
13     [
14         {
15             name: 'Attributes',
16             icon: AttributesIcon,
17             execute: (dispatch, resources) => {
18                 dispatch<any>(openUserAttributes(resources[0].uuid));
19             },
20         },
21         {
22             name: 'API Details',
23             icon: AdvancedIcon,
24             execute: (dispatch, resources) => {
25                 dispatch<any>(openAdvancedTabDialog(resources[0].uuid));
26             },
27         },
28         {
29             name: 'User Account',
30             icon: UserPanelIcon,
31             execute: (dispatch, resources) => {
32                 dispatch<any>(navigateToUserProfile(resources[0].uuid));
33             },
34             filters: [needsUserProfileLink],
35         },
36     ],
37 ];