fix: add a global dashboard filter bar (#24)
CI / build-and-test (pull_request) Successful in 2m46s

The reporting period was baked into the data service, so nothing could
change what the dashboard shows without editing code.

- DashboardFilter (period + optional region) parameterises every
  ChartDataService query; the no-arg overloads are the default filter.
- DashboardContext is the bus between the new DashboardFilterBar and the
  widgets: charts subscribe in WidgetRegistry, KPI tiles in DashboardView.
- Updates go through updateData, so widgets patch in place instead of
  being rebuilt; SparklineChart gained the same path.
- KpiData carries the number, the bundle the unit and number pattern, so
  a KPI value can follow the filter and stay locale-formatted.
- Filter state is deliberately not persisted, unlike the grid layout.

Closes #24

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0124BiJikbhbiEsNfJxdWM69
This commit is contained in:
Pit Friedrich
2026-07-28 20:52:33 +02:00
parent cdbd61aefb
commit df5d1a9b9b
19 changed files with 762 additions and 84 deletions
@@ -31,14 +31,24 @@ gridstack.pickerTitle=Elegir un widget
gridstack.dragHandle=Mover
gridstack.close=Cerrar
filter.period=Periodo
filter.period.month=Mes
filter.period.quarter=Trimestre
filter.period.halfYear=Semestre
filter.period.year=Año
filter.region=Región
filter.allRegions=Todas las regiones
# Los valores KPI son patrones MessageFormat: el número viene del servicio de
# datos (depende del filtro), la unidad y el formato numérico del bundle.
kpi.revenueTotal=Ingresos totales
kpi.revenueTotal.value=1,24 M€
kpi.revenueTotal.value={0,number,#,##0.00} M€
kpi.openOrders=Pedidos abiertos
kpi.openOrders.value=38
kpi.openOrders.value={0,number,#,##0}
kpi.newCustomers=Nuevos clientes
kpi.newCustomers.value=112
kpi.newCustomers.value={0,number,#,##0}
kpi.averageOrderValue=Valor medio del pedido
kpi.averageOrderValue.value=486
kpi.averageOrderValue.value={0,number,#,##0}
chart.revenueSeries=Ingresos 2026
chart.pointClick=Serie {0}, punto {1}
@@ -50,6 +60,17 @@ month.mar=Mar
month.apr=Abr
month.may=May
month.jun=Jun
month.jul=Jul
month.aug=Ago
month.sep=Sep
month.oct=Oct
month.nov=Nov
month.dec=Dic
week.1=Semana 1
week.2=Semana 2
week.3=Semana 3
week.4=Semana 4
region.north=Norte
region.south=Sur