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
pull/1859/head
Tim Raymond 2017-08-10 12:51:08 -07:00
parent 2f63c1222e
commit 8674368da6
No known key found for this signature in database
GPG Key ID: 221ADC45076A48C0
2 changed files with 5 additions and 7 deletions

View File

@ -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{

View File

@ -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{