18559: Move user admin functions to context menu
[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
19 export const userActionSet: ContextMenuActionSet = [[{
20     name: "Attributes",
21     icon: AttributesIcon,
22     execute: (dispatch, { uuid }) => {
23         dispatch<any>(openUserAttributes(uuid));
24     }
25 }, {
26     name: "Project",
27     icon: ProjectIcon,
28     execute: (dispatch, { uuid }) => {
29         dispatch<any>(openUserProjects(uuid));
30     }
31 }, {
32     name: "Advanced",
33     icon: AdvancedIcon,
34     execute: (dispatch, { uuid }) => {
35         dispatch<any>(openAdvancedTabDialog(uuid));
36     }
37 }, {
38     name: "Account Settings",
39     icon: UserPanelIcon,
40     execute: (dispatch, { uuid }) => {
41         dispatch<any>(openAdvancedTabDialog(uuid));
42     }
43 }, {
44     name: "Setup User",
45     icon: AdminMenuIcon,
46     execute: (dispatch, { uuid }) => {
47         dispatch<any>(openSetupDialog(uuid));
48     }
49 }, {
50     name: "Deactivate User",
51     icon: DeactivateUserIcon,
52     execute: (dispatch, { uuid }) => {
53         dispatch<any>(openDeactivateDialog(uuid));
54     }
55 }, {
56     name: "Login As User",
57     icon: LoginAsIcon,
58     execute: (dispatch, { uuid }) => {
59         dispatch<any>(loginAs(uuid));
60     }
61 },
62
63 ]];