Merge branch '14503_keep_services_panel'
[arvados.git] / src / routes / route-change-handlers.ts
index 00fb4bc05acbfcf8a4dc47e3c20f19516443cf19..fdc4211fd60bacd52020ad84bc3258a1c02defe0 100644 (file)
@@ -4,8 +4,17 @@
 
 import { History, Location } from 'history';
 import { RootStore } from '~/store/store';
-import { matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute, matchTrashRoute, matchRootRoute } from './routes';
-import { loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog } from '~/store/workbench/workbench-actions';
+import {
+    matchProcessRoute, matchProcessLogRoute, matchProjectRoute, matchCollectionRoute, matchFavoritesRoute,
+    matchTrashRoute, matchRootRoute, matchSharedWithMeRoute, matchRunProcessRoute, matchWorkflowRoute,
+    matchSearchResultsRoute, matchSshKeysRoute, matchRepositoriesRoute, matchVirtualMachineRoute,
+    matchKeepServicesRoute
+} from './routes';
+import {
+    loadSharedWithMe, loadRunProcess, loadWorkflow, loadSearchResults,
+    loadProject, loadCollection, loadFavorites, loadTrash, loadProcess, loadProcessLog,
+    loadSshKeys, loadRepositories, loadVirtualMachines, loadKeepServices
+} from '~/store/workbench/workbench-actions';
 import { navigateToRootProject } from '~/store/navigation/navigation-action';
 
 export const addRouteChangeHandlers = (history: History, store: RootStore) => {
@@ -22,7 +31,15 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
     const trashMatch = matchTrashRoute(pathname);
     const processMatch = matchProcessRoute(pathname);
     const processLogMatch = matchProcessLogRoute(pathname);
-    
+    const repositoryMatch = matchRepositoriesRoute(pathname);
+    const searchResultsMatch = matchSearchResultsRoute(pathname);
+    const sharedWithMeMatch = matchSharedWithMeRoute(pathname);
+    const runProcessMatch = matchRunProcessRoute(pathname);
+    const virtualMachineMatch = matchVirtualMachineRoute(pathname);
+    const workflowMatch = matchWorkflowRoute(pathname);
+    const sshKeysMatch = matchSshKeysRoute(pathname);
+    const keepServicesMatch = matchKeepServicesRoute(pathname);
+
     if (projectMatch) {
         store.dispatch(loadProject(projectMatch.params.id));
     } else if (collectionMatch) {
@@ -37,5 +54,21 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
         store.dispatch(loadProcessLog(processLogMatch.params.id));
     } else if (rootMatch) {
         store.dispatch(navigateToRootProject);
+    } else if (sharedWithMeMatch) {
+        store.dispatch(loadSharedWithMe);
+    } else if (runProcessMatch) {
+        store.dispatch(loadRunProcess);
+    } else if (workflowMatch) {
+        store.dispatch(loadWorkflow);
+    } else if (searchResultsMatch) {
+        store.dispatch(loadSearchResults);
+    } else if (virtualMachineMatch) {
+        store.dispatch(loadVirtualMachines);
+    } else if(repositoryMatch) {
+        store.dispatch(loadRepositories);
+    } else if (sshKeysMatch) {
+        store.dispatch(loadSshKeys);
+    } else if (keepServicesMatch) {
+        store.dispatch(loadKeepServices);
     }
 };