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=Widget auswählen
gridstack.dragHandle=Verschieben
gridstack.close=Schließen
filter.period=Zeitraum
filter.period.month=Monat
filter.period.quarter=Quartal
filter.period.halfYear=Halbjahr
filter.period.year=Jahr
filter.region=Region
filter.allRegions=Alle Regionen
# Die KPI-Werte sind MessageFormat-Muster: die Zahl kommt aus dem Datenservice
# (sie hängt vom Filter ab), Einheit und Zahlenformat aus dem Bundle.
kpi.revenueTotal=Gesamtumsatz
kpi.revenueTotal.value=1,24 Mio. €
kpi.revenueTotal.value={0,number,#,##0.00} Mio. €
kpi.openOrders=Offene Vorgänge
kpi.openOrders.value=38
kpi.openOrders.value={0,number,#,##0}
kpi.newCustomers=Neue Kunden
kpi.newCustomers.value=112
kpi.newCustomers.value={0,number,#,##0}
kpi.averageOrderValue=Ø Bestellwert
kpi.averageOrderValue.value=486
kpi.averageOrderValue.value={0,number,#,##0}
chart.revenueSeries=Umsatz 2026
chart.pointClick=Serie {0}, Punkt {1}
@@ -50,6 +60,17 @@ month.mar=Mär
month.apr=Apr
month.may=Mai
month.jun=Jun
month.jul=Jul
month.aug=Aug
month.sep=Sep
month.oct=Okt
month.nov=Nov
month.dec=Dez
week.1=Woche 1
week.2=Woche 2
week.3=Woche 3
week.4=Woche 4
region.north=Nord
region.south=Süd