18559: Update user profile cypress tests and fix minor issues
[arvados-workbench2.git] / src / views-components / context-menu / action-sets / user-action-set.ts
index e06a7c219832caa19f4194a19a58c74f8e56d1b9..6511b9a052bfb76ee5ea005399a8242394c8fff0 100644 (file)
@@ -2,10 +2,21 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { ContextMenuActionSet } from "~/views-components/context-menu/context-menu-action-set";
-import { AdvancedIcon, ProjectIcon, AttributesIcon, ShareIcon } from "~/components/icon/icon";
-import { openAdvancedTabDialog } from '~/store/advanced-tab/advanced-tab';
-import { openUserAttributes } from "~/store/users/users-actions";
+import { ContextMenuActionSet } from "views-components/context-menu/context-menu-action-set";
+import {
+    AdvancedIcon,
+    ProjectIcon,
+    AttributesIcon,
+    DeactivateUserIcon,
+    UserPanelIcon,
+    LoginAsIcon,
+    AdminMenuIcon,
+    ActiveIcon,
+} from "components/icon/icon";
+import { openAdvancedTabDialog } from 'store/advanced-tab/advanced-tab';
+import { loginAs, openUserAttributes, openUserProjects } from "store/users/users-actions";
+import { openSetupDialog, openDeactivateDialog, openActivateDialog } from "store/user-profile/user-profile-actions";
+import { navigateToUserProfile } from "store/navigation/navigation-action";
 
 export const userActionSet: ContextMenuActionSet = [[{
     name: "Attributes",
@@ -17,7 +28,7 @@ export const userActionSet: ContextMenuActionSet = [[{
     name: "Project",
     icon: ProjectIcon,
     execute: (dispatch, { uuid }) => {
-        dispatch<any>(openAdvancedTabDialog(uuid));
+        dispatch<any>(openUserProjects(uuid));
     }
 }, {
     name: "Advanced",
@@ -25,11 +36,40 @@ export const userActionSet: ContextMenuActionSet = [[{
     execute: (dispatch, { uuid }) => {
         dispatch<any>(openAdvancedTabDialog(uuid));
     }
-},
-{
-    name: "Manage",
-    icon: ShareIcon,
+}, {
+    name: "Account Settings",
+    icon: UserPanelIcon,
     execute: (dispatch, { uuid }) => {
-        dispatch<any>(openAdvancedTabDialog(uuid));
+        dispatch<any>(navigateToUserProfile(uuid));
+    }
+},], [{
+    name: "Activate User",
+    adminOnly: true,
+    icon: ActiveIcon,
+    execute: (dispatch, { uuid }) => {
+        dispatch<any>(openActivateDialog(uuid));
+    }
+},{
+    name: "Setup User",
+    adminOnly: true,
+    icon: AdminMenuIcon,
+    execute: (dispatch, { uuid }) => {
+        dispatch<any>(openSetupDialog(uuid));
     }
-}]];
+}, {
+    name: "Deactivate User",
+    adminOnly: true,
+    icon: DeactivateUserIcon,
+    execute: (dispatch, { uuid }) => {
+        dispatch<any>(openDeactivateDialog(uuid));
+    }
+}, {
+    name: "Login As User",
+    adminOnly: true,
+    icon: LoginAsIcon,
+    execute: (dispatch, { uuid }) => {
+        dispatch<any>(loginAs(uuid));
+    }
+},
+
+]];