Make a dashboard its widgets: drop the pages and sections nobody drew
This commit is contained in:
@@ -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 } }
|
||||
}[]
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user