X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/64c8c2628cbeadba5dce7e18e41028108142b766..67e3a05b8c90b7ebd506db768e427141fd958e66:/src/views-components/main-app-bar/admin-menu.tsx

diff --git a/src/views-components/main-app-bar/admin-menu.tsx b/src/views-components/main-app-bar/admin-menu.tsx
index f754c8578d..9b94c064ed 100644
--- a/src/views-components/main-app-bar/admin-menu.tsx
+++ b/src/views-components/main-app-bar/admin-menu.tsx
@@ -6,40 +6,41 @@ import * as React from "react";
 import { MenuItem } from "@material-ui/core";
 import { User } from "~/models/user";
 import { DropdownMenu } from "~/components/dropdown-menu/dropdown-menu";
-import { ShareMeIcon } from "~/components/icon/icon";
+import { AdminMenuIcon } from "~/components/icon/icon";
 import { DispatchProp, connect } from 'react-redux';
 import { logout } from '~/store/auth/auth-action';
 import { RootState } from "~/store/store";
 import { openRepositoriesPanel } from "~/store/repositories/repositories-actions";
-import { 
-    navigateToSshKeys, navigateToKeepServices, navigateToComputeNodes,
-    navigateToApiClientAuthorizations
-} from '~/store/navigation/navigation-action';
+import * as NavigationAction from '~/store/navigation/navigation-action';
 import { openAdminVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
-import { navigateToUsers } from '~/store/navigation/navigation-action';
+import { openUserPanel } from "~/store/users/users-actions";
 
 interface AdminMenuProps {
     user?: User;
+    currentRoute: string;
 }
 
 const mapStateToProps = (state: RootState): AdminMenuProps => ({
-    user: state.auth.user
+    user: state.auth.user,
+    currentRoute: state.router.location ? state.router.location.pathname : ''
 });
 
 export const AdminMenu = connect(mapStateToProps)(
-    ({ user, dispatch }: AdminMenuProps & DispatchProp<any>) =>
+    ({ user, dispatch, currentRoute }: AdminMenuProps & DispatchProp<any>) =>
         user
             ? <DropdownMenu
-                icon={<ShareMeIcon />}
+                icon={<AdminMenuIcon />}
                 id="admin-menu"
-                title="Admin Panel">
+                title="Admin Panel"
+                key={currentRoute}>
                 <MenuItem onClick={() => dispatch(openRepositoriesPanel())}>Repositories</MenuItem>
                 <MenuItem onClick={() => dispatch(openAdminVirtualMachines())}>Virtual Machines</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToSshKeys)}>Ssh Keys</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToApiClientAuthorizations)}>Api Tokens</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToUsers)}>Users</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToComputeNodes)}>Compute Nodes</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToKeepServices)}>Keep Services</MenuItem>
-                <MenuItem onClick={() => dispatch(logout())}>Logout</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToSshKeysAdmin)}>Ssh Keys</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToApiClientAuthorizations)}>Api Tokens</MenuItem>
+                <MenuItem onClick={() => dispatch(openUserPanel())}>Users</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToGroups)}>Groups</MenuItem>}
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToComputeNodes)}>Compute Nodes</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToKeepServices)}>Keep Services</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToLinks)}>Links</MenuItem>
             </DropdownMenu>
             : null);
