Make a dashboard its widgets: drop the pages and sections nobody drew

This commit is contained in:
2026-08-25 12:30:22 +02:00
parent 2840cc8e2b
commit 7ff29ca939
17 changed files with 273 additions and 497 deletions
+5 -16
View File
@@ -243,7 +243,7 @@ def _dashboard_with(
) -> None:
"""A published dashboard carrying these widgets."""
saved = _dashboard(client, headers, name)
saved["pages"] = [{"id": "main", "sections": [{"id": "main", "widgets": widgets}]}]
saved["widgets"] = widgets
written = client.put(f"{DASHBOARDS}/{name}", headers=headers, json=saved)
assert written.status_code == 200, written.text
published = client.post(
@@ -706,22 +706,11 @@ def test_a_panels_socket_carries_only_what_it_draws(
)
saved = _dashboard(client, superuser_token_headers, "panel_socket")
saved["pages"] = [
saved["widgets"] = [
{
"id": "main",
"title": "Overview",
"sections": [
{
"id": "main",
"widgets": [
{
"id": "w1",
"type": "stat",
"config": {"message": "house.kitchen.temperature"},
}
],
}
],
"id": "w1",
"type": "stat",
"config": {"message": "house.kitchen.temperature"},
}
]
written = client.put(