From a13434e7c498062c25d20603eefbf0d27510519a Mon Sep 17 00:00:00 2001 From: Emily Wong Date: Tue, 24 Nov 2020 17:35:39 -0800 Subject: [PATCH] Add support for DashboardLayout in ChartAttributes --- dashboard.go | 8 ++++++++ fixtures/paginated-dashboard-0.json | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/dashboard.go b/dashboard.go index 4ea69aa..b29f742 100644 --- a/dashboard.go +++ b/dashboard.go @@ -242,6 +242,7 @@ type Dashboards struct { type ChartAttributes struct { DashboardLinks DashboardLinks `json:"dashboardLinks,omitempty"` + DashboardLayout DashboardLayout `json:"dashboardLayout,omitempty"` } type DashboardLinks struct { @@ -252,6 +253,13 @@ type DashboardLink struct { Destination string `json:"destination,omitempty"` } +type DashboardLayout struct { + X int `json:"x,omitempty"` + Y int `json:"y,omitempty"` + H int `json:"h,omitempty"` + W int `json:"w,omitempty"` +} + const baseDashboardPath = "/api/v2/dashboard" // UnmarshalJSON is a custom JSON unmarshaller for an Dashboard, used in order to diff --git a/fixtures/paginated-dashboard-0.json b/fixtures/paginated-dashboard-0.json index 38c2183..f40baa1 100644 --- a/fixtures/paginated-dashboard-0.json +++ b/fixtures/paginated-dashboard-0.json @@ -69,6 +69,12 @@ "*": { "destination": "/dashboards/test-url" } + }, + "dashboardLayout": { + "x": 0, + "y": 0, + "h": 5, + "w": 12 } }, "summarization": "MEAN"