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 0b2ff379b04928c817fbc769b4f89e7f98f9b103..6511b9a052bfb76ee5ea005399a8242394c8fff0 100644 (file)
@@ -11,10 +11,12 @@ import {
     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 } from "store/user-profile/user-profile-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",
@@ -38,22 +40,32 @@ export const userActionSet: ContextMenuActionSet = [[{
     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));