X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/59329caeae17903b97b90b167df5a8122a0c9d95..4ba3f6420c77ad3bc1cdd877e4f3ed12ab63ccf7:/src/routes/route-change-handlers.ts diff --git a/src/routes/route-change-handlers.ts b/src/routes/route-change-handlers.ts index 7b37509f..141ae20b 100644 --- a/src/routes/route-change-handlers.ts +++ b/src/routes/route-change-handlers.ts @@ -8,6 +8,8 @@ import * as Routes from '~/routes/routes'; import * as WorkbenchActions from '~/store/workbench/workbench-actions'; import { navigateToRootProject } from '~/store/navigation/navigation-action'; import { dialogActions } from '~/store/dialog/dialog-actions'; +import { contextMenuActions } from '~/store/context-menu/context-menu-actions'; +import { searchBarActions } from '~/store/search-bar/search-bar-actions'; export const addRouteChangeHandlers = (history: History, store: RootStore) => { const handler = handleLocationChange(store); @@ -16,6 +18,7 @@ export const addRouteChangeHandlers = (history: History, store: RootStore) => { }; const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { + const rootMatch = Routes.matchRootRoute(pathname); const projectMatch = Routes.matchProjectRoute(pathname); const collectionMatch = Routes.matchCollectionRoute(pathname); @@ -32,6 +35,7 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { const workflowMatch = Routes.matchWorkflowRoute(pathname); const sshKeysUserMatch = Routes.matchSshKeysUserRoute(pathname); const sshKeysAdminMatch = Routes.matchSshKeysAdminRoute(pathname); + const siteManagerMatch = Routes.matchSiteManagerRoute(pathname); const keepServicesMatch = Routes.matchKeepServicesRoute(pathname); const computeNodesMatch = Routes.matchComputeNodesRoute(pathname); const apiClientAuthorizationsMatch = Routes.matchApiClientAuthorizationsRoute(pathname); @@ -42,6 +46,8 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { const linksMatch = Routes.matchLinksRoute(pathname); store.dispatch(dialogActions.CLOSE_ALL_DIALOGS()); + store.dispatch(contextMenuActions.CLOSE_CONTEXT_MENU()); + store.dispatch(searchBarActions.CLOSE_SEARCH_VIEW()); if (projectMatch) { store.dispatch(WorkbenchActions.loadProject(projectMatch.params.id)); @@ -75,6 +81,8 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { store.dispatch(WorkbenchActions.loadSshKeys); } else if (sshKeysAdminMatch) { store.dispatch(WorkbenchActions.loadSshKeys); + } else if (siteManagerMatch) { + store.dispatch(WorkbenchActions.loadSiteManager); } else if (keepServicesMatch) { store.dispatch(WorkbenchActions.loadKeepServices); } else if (computeNodesMatch) { @@ -92,4 +100,4 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { } else if (linksMatch) { store.dispatch(WorkbenchActions.loadLinks); } -}; +}; \ No newline at end of file