diff --git a/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.ts b/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.ts index 79f8cc30e8..996c961912 100644 --- a/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.ts +++ b/apps/datahub/src/app/home/news-page/key-figures/key-figures.component.ts @@ -5,10 +5,7 @@ import { RecordsService, } from '@geonetwork-ui/feature/catalog' import { ROUTER_ROUTE_SEARCH } from '@geonetwork-ui/feature/router' -import { - ROUTER_ROUTE_HOME, - ROUTER_ROUTE_ORGANISATIONS, -} from '../../../router/constants' +import { ROUTER_ROUTE_ORGANISATIONS } from '../../../router/constants' @Component({ selector: 'datahub-key-figures', @@ -19,8 +16,8 @@ import { export class KeyFiguresComponent { recordsCount$ = this.catalogRecords.recordsCount$.pipe(startWith('-')) orgsCount$ = this.catalogOrgs.organisationsCount$.pipe(startWith('-')) - ROUTE_SEARCH = `/${ROUTER_ROUTE_HOME}/${ROUTER_ROUTE_SEARCH}` - ROUTE_ORGANISATIONS = `/${ROUTER_ROUTE_HOME}/${ROUTER_ROUTE_ORGANISATIONS}` + ROUTE_SEARCH = `/${ROUTER_ROUTE_SEARCH}` + ROUTE_ORGANISATIONS = `/${ROUTER_ROUTE_ORGANISATIONS}` constructor( private catalogRecords: RecordsService, diff --git a/apps/datahub/src/app/router/datahub-router.service.spec.ts b/apps/datahub/src/app/router/datahub-router.service.spec.ts index 3b0b6cd80b..a6df320637 100644 --- a/apps/datahub/src/app/router/datahub-router.service.spec.ts +++ b/apps/datahub/src/app/router/datahub-router.service.spec.ts @@ -13,23 +13,23 @@ const RouterMock = { } const expectedRoutes = [ - { - path: '', - redirectTo: 'home/news', - pathMatch: 'full', - }, { path: 'home', - redirectTo: 'home/search', - pathMatch: 'full', + redirectTo: '', + pathMatch: 'prefix', }, { - path: 'home', + path: '', component: HomePageComponent, data: { shouldDetach: true, }, children: [ + { + path: '', + redirectTo: 'news', + pathMatch: 'prefix', + }, { path: 'news', component: NewsPageComponent, diff --git a/apps/datahub/src/app/router/datahub-router.service.ts b/apps/datahub/src/app/router/datahub-router.service.ts index f5a419a2e9..5563216c3f 100644 --- a/apps/datahub/src/app/router/datahub-router.service.ts +++ b/apps/datahub/src/app/router/datahub-router.service.ts @@ -27,23 +27,23 @@ export class DatahubRouterService { buildRoutes(): Routes { return [ - { - path: '', - redirectTo: `${ROUTER_ROUTE_HOME}/${ROUTER_ROUTE_NEWS}`, - pathMatch: 'full', - }, { path: ROUTER_ROUTE_HOME, - redirectTo: `${ROUTER_ROUTE_HOME}/${ROUTER_ROUTE_SEARCH}`, - pathMatch: 'full', + redirectTo: ``, + pathMatch: 'prefix', }, { - path: ROUTER_ROUTE_HOME, + path: '', component: HomePageComponent, data: { shouldDetach: true, }, children: [ + { + path: '', + redirectTo: ROUTER_ROUTE_NEWS, + pathMatch: 'prefix', + }, { path: ROUTER_ROUTE_NEWS, component: NewsPageComponent,