= { tea: 'TEA', cacu: 'CaCu', cama: 'CaMa' };
+ private readonly url = toSignal(this.router.events.pipe(
+ filter((event) => event instanceof NavigationEnd), map(event => event.urlAfterRedirects)), { initialValue: this.router.url });
+ // On an indicators page the header names its domain and switches to the others.
+ protected readonly activeDomain = computed(() =>
+ DOMINIOS.find(domain => new RegExp(`^/indicadores/${domain}(?:[/?#]|$)`).test(this.url())));
+ protected readonly otherDomains = computed(() => DOMINIOS.filter(domain => domain !== this.activeDomain()));
+
private readonly leafRouteData = toSignal(
this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
diff --git a/src/app/features/indicadores/indicadores-navigation.spec.ts b/src/app/features/indicadores/indicadores-navigation.spec.ts
index 75d9de6..0fd2618 100644
--- a/src/app/features/indicadores/indicadores-navigation.spec.ts
+++ b/src/app/features/indicadores/indicadores-navigation.spec.ts
@@ -44,8 +44,8 @@ describe('UX-04 navegación Angular', () => {
const harness = await setup();
await harness.navigateByUrl('/indicadores/' + domain, IndicadoresPage);
load(domain, harness); harness.detectChanges();
- // Our shell keeps the domain nav on the page itself, see indicadores-page.html.
- expect(harness.routeNativeElement!.querySelectorAll('nav.domain-nav a')).toHaveLength(3);
+ // Domain switching lives in the App header (app.spec.ts); the page must not add a second one.
+ expect(harness.routeNativeElement!.querySelectorAll('nav.domain-nav a')).toHaveLength(0);
http.expectNone(() => true);
});
it('mantiene la ruta, restaura borradores y reconsulta la aplicación entre TEA/CaCu/CaMa', async () => {
diff --git a/src/app/features/indicadores/indicadores-page.html b/src/app/features/indicadores/indicadores-page.html
index 8e58d94..da700e0 100644
--- a/src/app/features/indicadores/indicadores-page.html
+++ b/src/app/features/indicadores/indicadores-page.html
@@ -10,14 +10,6 @@
}
@if (!fichaPacienteAbierta()) {
-
-
@for (section of sections; track section.id) {