From 0ba84d1b1ff8976c75787c6886c6cf91816223e2 Mon Sep 17 00:00:00 2001 From: "Malka, Amir" Date: Wed, 22 Apr 2020 20:21:41 +0300 Subject: [PATCH] Fixes #124 --- grafana/dashboard.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/grafana/dashboard.go b/grafana/dashboard.go index b7b07a3..b78c013 100644 --- a/grafana/dashboard.go +++ b/grafana/dashboard.go @@ -47,6 +47,7 @@ type Panel struct { Type string Title string GridPos GridPos + Panels []Panel } // Panel represents a Grafana dashboard panel position @@ -124,8 +125,18 @@ func populatePanelsFromV4JSON(dash Dashboard, dc dashContainer) Dashboard { func populatePanelsFromV5JSON(dash Dashboard, dc dashContainer) Dashboard { for _, p := range dc.Dashboard.Panels { if p.Type == "row" { + if len(p.Panels) == 0 { + continue + } + + for _, rowPanel := range p.Panels { + rowPanel.Title = sanitizeLaTexInput(rowPanel.Title) + dash.Panels = append(dash.Panels, rowPanel) + } + continue } + p.Title = sanitizeLaTexInput(p.Title) dash.Panels = append(dash.Panels, p) }