feat: Enhance dashboard layout and widget configuration
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

- Updated dashboard layout schema to introduce separate default layouts for product and lab dashboards.
- Added new functions for managing product and lab default layouts, improving user customization options.
- Updated app_dashboard version to 1.9.0 to reflect the introduction of product vs lab layout defaults and new API fields for dashboard configuration.
- Enhanced tests to validate new layout functionalities and ensure proper widget visibility based on user settings.
This commit is contained in:
Lars committed 2026-04-08 07:41:16 +02:00
1 parent 9bc0cf70da
commit e4e2f23d7f
12 files changed
+592 -417

No files matched your search

+14 -2
View File
@@ -2,7 +2,12 @@
from dashboard_layout_schema import default_layout_dict
from dashboard_widget_entitlements import widgets_catalog_payload
from widget_catalog import ALLOWED_WIDGET_IDS, DEFAULT_LAB_WIDGET_IDS, WIDGET_CATALOG
from widget_catalog import (
ALLOWED_WIDGET_IDS,
DEFAULT_LAB_WIDGET_IDS,
DEFAULT_PRODUCT_DASHBOARD_WIDGET_IDS,
WIDGET_CATALOG,
)
def test_catalog_ids_unique_and_match_allowed():
@@ -17,10 +22,17 @@ def test_default_layout_follows_catalog_order():
got = [w["id"] for w in d["widgets"]]
assert got == [e["id"] for e in WIDGET_CATALOG]
enabled_ids = {w["id"] for w in d["widgets"] if w["enabled"]}
assert enabled_ids == DEFAULT_LAB_WIDGET_IDS
assert enabled_ids == DEFAULT_PRODUCT_DASHBOARD_WIDGET_IDS
assert any(w["enabled"] for w in d["widgets"])
def test_lab_default_matches_lab_widget_ids():
from dashboard_layout_schema import lab_default_layout_dict
d = lab_default_layout_dict()
assert {w["id"] for w in d["widgets"] if w["enabled"]} == DEFAULT_LAB_WIDGET_IDS
def test_catalog_payload_shape(monkeypatch):
monkeypatch.setattr(
"dashboard_widget_entitlements._check_feature_access",