Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14512_admin_links
[arvados-workbench2.git] / src / routes / route-change-handlers.ts
index 34b488def282b3224a22183766a3f91708eadaf8..c4b0fc7d5d5486f8be4fc30896a5296407c90ed2 100644 (file)
@@ -26,9 +26,11 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
     const searchResultsMatch = Routes.matchSearchResultsRoute(pathname);
     const sharedWithMeMatch = Routes.matchSharedWithMeRoute(pathname);
     const runProcessMatch = Routes.matchRunProcessRoute(pathname);
-    const virtualMachineMatch = Routes.matchVirtualMachineRoute(pathname);
+    const virtualMachineUserMatch = Routes.matchUserVirtualMachineRoute(pathname);
+    const virtualMachineAdminMatch = Routes.matchAdminVirtualMachineRoute(pathname);
     const workflowMatch = Routes.matchWorkflowRoute(pathname);
-    const sshKeysMatch = Routes.matchSshKeysRoute(pathname);
+    const sshKeysUserMatch = Routes.matchSshKeysUserRoute(pathname);
+    const sshKeysAdminMatch = Routes.matchSshKeysAdminRoute(pathname);
     const keepServicesMatch = Routes.matchKeepServicesRoute(pathname);
     const computeNodesMatch = Routes.matchComputeNodesRoute(pathname);
     const apiClientAuthorizationsMatch = Routes.matchApiClientAuthorizationsRoute(pathname);
@@ -58,11 +60,15 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
         store.dispatch(WorkbenchActions.loadWorkflow);
     } else if (searchResultsMatch) {
         store.dispatch(WorkbenchActions.loadSearchResults);
-    } else if (virtualMachineMatch) {
+    } else if (virtualMachineUserMatch) {
         store.dispatch(WorkbenchActions.loadVirtualMachines);
-    } else if(repositoryMatch) {
+    } else if (virtualMachineAdminMatch) {
+        store.dispatch(WorkbenchActions.loadVirtualMachines);
+    } else if (repositoryMatch) {
         store.dispatch(WorkbenchActions.loadRepositories);
-    } else if (sshKeysMatch) {
+    } else if (sshKeysUserMatch) {
+        store.dispatch(WorkbenchActions.loadSshKeys);
+    } else if (sshKeysAdminMatch) {
         store.dispatch(WorkbenchActions.loadSshKeys);
     } else if (keepServicesMatch) {
         store.dispatch(WorkbenchActions.loadKeepServices);