feat: Revamp KPI board configuration and validation
Deploy Development / deploy (push) Successful in 53s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s

- Enhanced the KPI board widget to support tile configuration, allowing users to select and order tiles.
- Updated validation logic to ensure proper handling of tile IDs and configuration fields.
- Removed legacy chart_days support, transitioning to a fixed analysis window for KPI metrics.
- Improved the DashboardLabPage to integrate the new KpiBoardConfigEditor for managing tile selections.
- Bumped app_dashboard version to 1.5.0 to reflect these significant changes.
This commit is contained in:
Lars committed 2026-04-07 12:46:18 +02:00
1 parent 096d896166
commit c0c512e942
10 files changed
+390 -91

No files matched your search

+17 -3
View File
@@ -30,11 +30,25 @@ def test_activity_chart_days():
validate_widget_entry_config("activity_overview", {"chart_days": 5})
def test_kpi_board_chart_days():
def test_kpi_board_tiles():
assert validate_widget_entry_config("kpi_board", {}) == {}
assert validate_widget_entry_config("kpi_board", {"chart_days": 14}) == {"chart_days": 14}
assert validate_widget_entry_config("kpi_board", {"tiles": []}) == {"tiles": []}
assert validate_widget_entry_config(
"kpi_board",
{"tiles": [{"id": "body_fat"}, {"id": "avg_kcal"}, {"id": "ref:hr_max"}]},
) == {"tiles": [{"id": "body_fat"}, {"id": "avg_kcal"}, {"id": "ref:hr_max"}]}
with pytest.raises(ValueError):
validate_widget_entry_config("kpi_board", {"chart_days": 5})
validate_widget_entry_config("kpi_board", {"tiles": [{"id": "unknown"}]})
with pytest.raises(ValueError):
validate_widget_entry_config("kpi_board", {"tiles": [{"id": "body_fat"}, {"id": "body_fat"}]})
with pytest.raises(ValueError):
validate_widget_entry_config("kpi_board", {"extra": 1})
def test_kpi_board_legacy_chart_days_dropped():
"""Nur chart_days (Alt-Layouts) → automatische Kachelwahl, kein Ø-Kal-Fenster mehr."""
assert validate_widget_entry_config("kpi_board", {"chart_days": 14}) == {}
assert validate_widget_entry_config("kpi_board", {"chart_days": 5}) == {}
def test_welcome_still_rejects_config():