X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/920ccdc45d7c3a8517b430ab17af53c3fc23cf6d..3b53b656e65fdabc32b3bc748074eb35e9df98eb:/src/routes/route-change-handlers.ts diff --git a/src/routes/route-change-handlers.ts b/src/routes/route-change-handlers.ts index c4b0fc7d..b43e84bb 100644 --- a/src/routes/route-change-handlers.ts +++ b/src/routes/route-change-handlers.ts @@ -7,6 +7,9 @@ import { RootStore } from '~/store/store'; 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); @@ -15,10 +18,12 @@ 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); const favoriteMatch = Routes.matchFavoritesRoute(pathname); + const publicFavoritesMatch = Routes.matchPublicFavoritesRoute(pathname); const trashMatch = Routes.matchTrashRoute(pathname); const processMatch = Routes.matchProcessRoute(pathname); const processLogMatch = Routes.matchProcessLogRoute(pathname); @@ -31,12 +36,21 @@ 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); const myAccountMatch = Routes.matchMyAccountRoute(pathname); + const linkAccountMatch = Routes.matchLinkAccountRoute(pathname); const userMatch = Routes.matchUsersRoute(pathname); + const groupsMatch = Routes.matchGroupsRoute(pathname); + const groupDetailsMatch = Routes.matchGroupDetailsRoute(pathname); const linksMatch = Routes.matchLinksRoute(pathname); + const collectionsContentAddressMatch = Routes.matchCollectionsContentAddressRoute(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)); @@ -44,6 +58,8 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { store.dispatch(WorkbenchActions.loadCollection(collectionMatch.params.id)); } else if (favoriteMatch) { store.dispatch(WorkbenchActions.loadFavorites()); + } else if (publicFavoritesMatch) { + store.dispatch(WorkbenchActions.loadPublicFavorites()); } else if (trashMatch) { store.dispatch(WorkbenchActions.loadTrash()); } else if (processMatch) { @@ -70,6 +86,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) { @@ -78,9 +96,17 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => { store.dispatch(WorkbenchActions.loadApiClientAuthorizations); } else if (myAccountMatch) { store.dispatch(WorkbenchActions.loadMyAccount); + } else if (linkAccountMatch) { + store.dispatch(WorkbenchActions.loadLinkAccount); } else if (userMatch) { store.dispatch(WorkbenchActions.loadUsers); + } else if (groupsMatch) { + store.dispatch(WorkbenchActions.loadGroupsPanel); + } else if (groupDetailsMatch) { + store.dispatch(WorkbenchActions.loadGroupDetailsPanel(groupDetailsMatch.params.id)); } else if (linksMatch) { store.dispatch(WorkbenchActions.loadLinks); + } else if (collectionsContentAddressMatch) { + store.dispatch(WorkbenchActions.loadCollectionContentAddress); } -}; +}; \ No newline at end of file