feat(ui): mejorar periodos KPI y presentacion del dashboard

This commit is contained in:
Angel Capetillo Zavala
2026-10-14 11:46:17 -06:00
parent 9fcc65d84f
commit 69afcc7fdb
26 changed files with 778 additions and 604 deletions
@@ -0,0 +1,18 @@
import { of } from 'rxjs';
import { Indicador } from './indicadores.models';
import { emptyAvailability, IndicadoresPeriodos } from './indicadores-periodos';
// Existing figure/search/visibility suites isolate their HTTP from availability.
// The new P0.1 suites exercise the real availability HTTP separately.
export const periodAvailabilityProvider = {
provide: IndicadoresPeriodos,
useValue: { dominio: (_domain: unknown, catalog: Indicador[]) => {
const state = emptyAvailability('ready');
for (const tipo of ['semestre', 'mes'] as const) {
state.options[tipo] = [2024, 2025, 2026].flatMap(year =>
(tipo === 'semestre' ? ['S1', 'S2'] : Array.from({ length: 12 }, (_, i) => String(i + 1).padStart(2, '0'))).map(unit => year + '-' + unit));
}
for (const item of catalog) state.byIndicator[item.id] = item.tipos_periodo.flatMap(tipo => state.options[tipo].map(periodo => ({ tipo, periodo })));
return of(state);
} },
};