X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a8350416b8f225a64aa207c5823e42ede43fd7d0..c48d10802d4ae95273f8b98e622e5df200cdc3a7:/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 40ba9161..198306b5 100644
--- a/src/views-components/main-app-bar/admin-menu.tsx
+++ b/src/views-components/main-app-bar/admin-menu.tsx
@@ -2,44 +2,43 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from "react";
+import React from "react";
 import { MenuItem } from "@material-ui/core";
-import { User } from "~/models/user";
-import { DropdownMenu } from "~/components/dropdown-menu/dropdown-menu";
-import { AdminMenuIcon } from "~/components/icon/icon";
+import { User } from "models/user";
+import { DropdownMenu } from "components/dropdown-menu/dropdown-menu";
+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 { 
-    navigateToSshKeysAdmin, navigateToKeepServices, navigateToComputeNodes,
-    navigateToApiClientAuthorizations
-} from '~/store/navigation/navigation-action';
-import { openAdminVirtualMachines } from "~/store/virtual-machines/virtual-machines-actions";
-import { openUserPanel } from "~/store/users/users-actions";
+import { RootState } from "store/store";
+import { openRepositoriesPanel } from "store/repositories/repositories-actions";
+import * as NavigationAction from 'store/navigation/navigation-action';
+import { openAdminVirtualMachines } from "store/virtual-machines/virtual-machines-actions";
+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={<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(navigateToSshKeysAdmin)}>Ssh Keys</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToApiClientAuthorizations)}>Api Tokens</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(navigateToComputeNodes)}>Compute Nodes</MenuItem>
-                <MenuItem onClick={() => dispatch(navigateToKeepServices)}>Keep Services</MenuItem>
-                <MenuItem onClick={() => dispatch(logout())}>Logout</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToGroups)}>Groups</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToKeepServices)}>Keep Services</MenuItem>
+                <MenuItem onClick={() => dispatch(NavigationAction.navigateToLinks)}>Links</MenuItem>
             </DropdownMenu>
             : null);
