From 8674368da64bcb6db56c22a61e3dc49795688b06 Mon Sep 17 00:00:00 2001 From: Tim Raymond Date: Thu, 10 Aug 2017 12:51:08 -0700 Subject: [PATCH] Update Bounds to follow string format We updated DashboardCell to use string bounds rather than the [2]int64{} we were using before. This brings the Layout cells to parity with that --- bolt/internal/internal.go | 10 ++++------ bolt/internal/internal_test.go | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bolt/internal/internal.go b/bolt/internal/internal.go index 028e10a6e..1ff896c82 100644 --- a/bolt/internal/internal.go +++ b/bolt/internal/internal.go @@ -100,10 +100,8 @@ func MarshalLayout(l chronograf.Layout) ([]byte, error) { axes := make(map[string]*Axis, len(c.Axes)) for a, r := range c.Axes { - axis := [2]int64{} - copy(axis[:], r.Bounds[:2]) axes[a] = &Axis{ - Bounds: axis[:], + Bounds: r.Bounds, } } @@ -160,9 +158,9 @@ func UnmarshalLayout(data []byte, l *chronograf.Layout) error { } axes := make(map[string]chronograf.Axis, len(c.Axes)) for a, r := range c.Axes { - axis := chronograf.Axis{} - copy(axis.Bounds[:], r.Bounds[:2]) - axes[a] = axis + axes[a] = chronograf.Axis{ + Bounds: r.Bounds, + } } cells[i] = chronograf.Cell{ diff --git a/bolt/internal/internal_test.go b/bolt/internal/internal_test.go index 1d3e1dde7..a3a4996b1 100644 --- a/bolt/internal/internal_test.go +++ b/bolt/internal/internal_test.go @@ -110,7 +110,7 @@ func TestMarshalLayout(t *testing.T) { Name: "cell1", Axes: map[string]chronograf.Axis{ "y": chronograf.Axis{ - Bounds: [2]int64{0, 100}, + Bounds: []string{"0", "100"}, }, }, Queries: []chronograf.Query{