change code after CR, clean code and add vm to nav action
[arvados-workbench2.git] / src / routes / route-change-handlers.ts
index e68c3c6c1fee2e65bb51043f5123edceb85df407..c4b0fc7d5d5486f8be4fc30896a5296407c90ed2 100644 (file)
@@ -29,12 +29,14 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
     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);
     const myAccountMatch = Routes.matchMyAccountRoute(pathname);
     const userMatch = Routes.matchUsersRoute(pathname);
+    const linksMatch = Routes.matchLinksRoute(pathname);
 
     if (projectMatch) {
         store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id));
@@ -64,7 +66,9 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
         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);
@@ -76,5 +80,7 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
         store.dispatch(WorkbenchActions.loadMyAccount);
     } else if (userMatch) {
         store.dispatch(WorkbenchActions.loadUsers);
+    } else if (linksMatch) {
+        store.dispatch(WorkbenchActions.loadLinks);
     }
 };