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
+2 -2
View File
@@ -48,7 +48,7 @@ test.beforeAll(async ({ browser }) => {
dashboard.columns = 12
dashboard.canvas_width = 1920
dashboard.canvas_height = 1080
dashboard.pages[0].sections[0].widgets = WIDGETS
dashboard.widgets = WIDGETS
await api(page, `/dashboards/${dashboardName}`, {
method: "PUT",
data: dashboard,
@@ -65,7 +65,7 @@ async function placements(page: Page) {
const doc = await (
await api(page, `/dashboards/${dashboardName}?draft=true`)
).json()
const widgets = doc.pages[0].sections[0].widgets as {
const widgets = doc.widgets as {
id: string
layout: { lg: { x: number; y: number } }
}[]
+1 -1
View File
@@ -55,7 +55,7 @@ test.beforeAll(async ({ browser }) => {
const dashboard = await (
await api(page, `/dashboards/${dashboardName}`, { method: "POST" })
).json()
dashboard.pages[0].sections[0].widgets = [
dashboard.widgets = [
{
id: "lever",
type: "slider",
+1 -1
View File
@@ -174,7 +174,7 @@ test.beforeAll(async ({ browser }) => {
const dashboard = await (
await api(page, `/dashboards/${dashboardName}`, { method: "POST" })
).json()
dashboard.pages[0].sections[0].widgets = [
dashboard.widgets = [
{
id: "top",
type: "stat",
+1 -1
View File
@@ -51,7 +51,7 @@ test.beforeAll(async ({ browser }) => {
await api(page, `/dashboards/${name}`, { method: "POST" })
const doc = await (await api(page, `/dashboards/${name}?draft=true`)).json()
doc.settings = { look: { value: "glass" } }
doc.pages[0].sections[0].widgets = [
doc.widgets = [
{
id: "stat",
type: "stat",
+2 -2
View File
@@ -89,7 +89,7 @@ test.beforeAll(async ({ browser }) => {
// Two rows taller than the default panel: the tiles below already fill it,
// and a widget past the last row is clipped rather than drawn.
dashboard.canvas_height = 1400
dashboard.pages[0].sections[0].widgets = [
dashboard.widgets = [
{
id: "load",
type: "bar",
@@ -202,7 +202,7 @@ test.beforeAll(async ({ browser }) => {
const stack = await (
await api(page, `/dashboards/${stackName}`, { method: "POST" })
).json()
stack.pages[0].sections[0].widgets = [
stack.widgets = [
{
id: "split",
type: "bar",