Merge branch 'feature/1602-graph-bounds-setting' of github.com:influxdata/chronograf into feature/1602-graph-bounds-setting

pull/10616/head
Andrew Watkins 2017-07-31 14:27:21 -07:00
commit 59141c0125
1 changed files with 8 additions and 0 deletions

View File

@ -235,7 +235,11 @@ func ValidDashboardRequest(d *chronograf.Dashboard) error {
// DashboardDefaults updates the dashboard with the default values // DashboardDefaults updates the dashboard with the default values
// if none are specified // if none are specified
func DashboardDefaults(d chronograf.Dashboard) (newDash chronograf.Dashboard) { func DashboardDefaults(d chronograf.Dashboard) (newDash chronograf.Dashboard) {
newDash.ID = d.ID
newDash.Templates = d.Templates
newDash.Name = d.Name
newDash.Cells = make([]chronograf.DashboardCell, len(d.Cells)) newDash.Cells = make([]chronograf.DashboardCell, len(d.Cells))
for i, c := range d.Cells { for i, c := range d.Cells {
CorrectWidthHeight(&c) CorrectWidthHeight(&c)
newDash.Cells[i] = c newDash.Cells[i] = c
@ -246,7 +250,11 @@ func DashboardDefaults(d chronograf.Dashboard) (newDash chronograf.Dashboard) {
// AddQueryConfigs updates all the celsl in the dashboard to have query config // AddQueryConfigs updates all the celsl in the dashboard to have query config
// objects corresponding to their influxql queries. // objects corresponding to their influxql queries.
func AddQueryConfigs(d chronograf.Dashboard) (newDash chronograf.Dashboard) { func AddQueryConfigs(d chronograf.Dashboard) (newDash chronograf.Dashboard) {
newDash.ID = d.ID
newDash.Templates = d.Templates
newDash.Name = d.Name
newDash.Cells = make([]chronograf.DashboardCell, len(d.Cells)) newDash.Cells = make([]chronograf.DashboardCell, len(d.Cells))
for i, c := range d.Cells { for i, c := range d.Cells {
AddQueryConfig(&c) AddQueryConfig(&c)
newDash.Cells[i] = c newDash.Cells[i] = c