feat: Extend widget configuration for KPI board and enhance validation
- Added support for the "kpi_board" widget in the dashboard configuration, allowing for chart_days validation. - Updated the widget catalog description to reflect the new configuration options for KPI tiles. - Enhanced the DashboardLabPage to manage chart_days input for the KPI board, improving user experience. - Introduced normalization functions for KPI kcal window days to maintain consistent behavior. - Bumped app_dashboard version to 1.4.0 to reflect these enhancements.
This commit is contained in:
1 parent
97f9aa696e
commit
de99856a28
8 files changed
+65
-24
No files matched your search
@@ -14,7 +14,7 @@ def test_body_chart_days_bounds():
|
||||
validate_widget_entry_config("body_overview", {"chart_days": 91})
|
||||
|
||||
|
||||
def test_welcome_config_rejected():
|
||||
def test_welcome_config_rejected_unknown_key():
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("welcome", {"x": 1})
|
||||
|
||||
@@ -30,9 +30,16 @@ def test_activity_chart_days():
|
||||
validate_widget_entry_config("activity_overview", {"chart_days": 5})
|
||||
|
||||
|
||||
def test_kpi_config_rejected():
|
||||
def test_kpi_board_chart_days():
|
||||
assert validate_widget_entry_config("kpi_board", {}) == {}
|
||||
assert validate_widget_entry_config("kpi_board", {"chart_days": 14}) == {"chart_days": 14}
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("kpi_board", {"chart_days": 30})
|
||||
validate_widget_entry_config("kpi_board", {"chart_days": 5})
|
||||
|
||||
|
||||
def test_welcome_still_rejects_config():
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("welcome", {"chart_days": 30})
|
||||
|
||||
|
||||
def test_layout_payload_with_chart_days_roundtrip():
|
||||
|
||||
Reference in new issue
Block a user