From 74f464800ddd236f092e33a6b426271dd9b28984 Mon Sep 17 00:00:00 2001 From: Tim Raymond <tim@timraymond.com> Date: Mon, 14 Aug 2017 13:13:39 -0400 Subject: [PATCH 1/2] Fix missing cell type Because we are now creating new instances of dashboards when we create a response, it's critical to copy every element of Dashboards from the previous to the new instance. We were not previously copying the Type field of cells, so this was defaulting to the empty string zero value. This patch adds "Type" to the tests and ensures that it's properly copied --- server/cells.go | 1 + server/cells_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/server/cells.go b/server/cells.go index 29c0bd57a2..29d78b000d 100644 --- a/server/cells.go +++ b/server/cells.go @@ -45,6 +45,7 @@ func newCellResponses(dID chronograf.DashboardID, dcells []chronograf.DashboardC newCell.H = cell.H newCell.Name = cell.Name newCell.ID = cell.ID + newCell.Type = cell.Type for _, lbl := range labels { if axis, found := cell.Axes[lbl]; !found { diff --git a/server/cells_test.go b/server/cells_test.go index 5ca5dce5e1..c0ade6f5f7 100644 --- a/server/cells_test.go +++ b/server/cells_test.go @@ -105,6 +105,7 @@ func Test_Service_DashboardCells(t *testing.T) { W: 4, H: 4, Name: "CPU", + Type: "bar", Queries: []chronograf.DashboardQuery{}, Axes: map[string]chronograf.Axis{}, }, @@ -117,6 +118,7 @@ func Test_Service_DashboardCells(t *testing.T) { W: 4, H: 4, Name: "CPU", + Type: "bar", Queries: []chronograf.DashboardQuery{}, Axes: map[string]chronograf.Axis{ "x": chronograf.Axis{ From f89d95eb02c0c51adf98585760191c5d691673f0 Mon Sep 17 00:00:00 2001 From: Tim Raymond <tim@timraymond.com> Date: Mon, 14 Aug 2017 14:03:40 -0400 Subject: [PATCH 2/2] Update CHANGELOG w/ fix for single stat --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ebaa98621..16a52aee3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## v1.3.7.0 [unreleased] ### Bug Fixes 1. [#1845](https://github.com/influxdata/chronograf/pull/1845): Fix no-scroll bar appearing in the Data Explorer table +1. [#1866](https://github.com/influxdata/chronograf/pull/1866): Fix missing cell type (and consequently single-stat) ### Features