feat: Extend widget configuration for activity overview and improve validation
- Added support for the "activity_overview" widget in the dashboard configuration, allowing for chart_days validation. - Refactored validation logic to streamline error handling for both "body_overview" and "activity_overview" widgets. - Updated the widget catalog description to reflect the new configuration options. - Enhanced the DashboardLabPage to manage chart_days input for both widgets, improving user experience. - Bumped app_dashboard version to 1.3.0 to reflect these enhancements.
This commit is contained in:
1 parent
4493b140bd
commit
b617212145
9 files changed
+164
-60
No files matched your search
@@ -24,6 +24,17 @@ def test_body_unknown_key():
|
||||
validate_widget_entry_config("body_overview", {"chart_days": 30, "extra": 1})
|
||||
|
||||
|
||||
def test_activity_chart_days():
|
||||
assert validate_widget_entry_config("activity_overview", {"chart_days": 14}) == {"chart_days": 14}
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("activity_overview", {"chart_days": 5})
|
||||
|
||||
|
||||
def test_kpi_config_rejected():
|
||||
with pytest.raises(ValueError):
|
||||
validate_widget_entry_config("kpi_board", {"chart_days": 30})
|
||||
|
||||
|
||||
def test_layout_payload_with_chart_days_roundtrip():
|
||||
p = DashboardLayoutPayload.model_validate(
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user