18426a0d16221e735b782e8a2d3584e5118fea72
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / user-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 {
7     AdvancedIcon,
8     ProjectIcon,
9     AttributesIcon,
10     DeactivateUserIcon,
11     UserPanelIcon,
12     LoginAsIcon,
13     AdminMenuIcon,
14 } from "components/icon/icon";
15 import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
16 import { loginAs, openUserAttributes, openUserProjects } from "store/users/users-actions";
17 import { openSetupDialog, openDeactivateDialog } from "store/user-profile/user-profile-actions";
18 import { navigateToUserProfile } from "store/navigation/navigation-action";
19
20 export const userActionSet: ContextMenuActionSet = [[{
21     name: "Attributes",
22     icon: AttributesIcon,
23     execute: (dispatch, { uuid }) => {
24         dispatch<any>(openUserAttributes(uuid));
25     }
26 }, {
27     name: "Project",
28     icon: ProjectIcon,
29     execute: (dispatch, { uuid }) => {
30         dispatch<any>(openUserProjects(uuid));
31     }
32 }, {
33     name: "Advanced",
34     icon: AdvancedIcon,
35     execute: (dispatch, { uuid }) => {
36         dispatch<any>(openAdvancedTabDialog(uuid));
37     }
38 }, {
39     name: "Account Settings",
40     adminOnly: true,
41     icon: UserPanelIcon,
42     execute: (dispatch, { uuid }) => {
43         dispatch<any>(navigateToUserProfile(uuid));
44     }
45 }, {
46     name: "Setup User",
47     adminOnly: true,
48     icon: AdminMenuIcon,
49     execute: (dispatch, { uuid }) => {
50         dispatch<any>(openSetupDialog(uuid));
51     }
52 }, {
53     name: "Deactivate User",
54     adminOnly: true,
55     icon: DeactivateUserIcon,
56     execute: (dispatch, { uuid }) => {
57         dispatch<any>(openDeactivateDialog(uuid));
58     }
59 }, {
60     name: "Login As User",
61     adminOnly: true,
62     icon: LoginAsIcon,
63     execute: (dispatch, { uuid }) => {
64         dispatch<any>(loginAs(uuid));
65     }
66 },
67
68 ]];