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