From f4ba7db6971720b0e529437aa111fc34a623c661 Mon Sep 17 00:00:00 2001 From: Zoe Steinkamp Date: Thu, 16 Jan 2020 13:55:30 -0700 Subject: [PATCH] fix: Fixing master gauge issues --- dashboard.go | 2 ++ http/swagger.yml | 6 ++++++ pkger/clone_resource.go | 2 ++ pkger/models.go | 8 +++++--- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dashboard.go b/dashboard.go index 795309aac8..df336a82e4 100644 --- a/dashboard.go +++ b/dashboard.go @@ -715,7 +715,9 @@ type SingleStatViewProperties struct { Type string `json:"type"` Queries []DashboardQuery `json:"queries"` Prefix string `json:"prefix"` + TickPrefix string `json:"tickPrefix"` Suffix string `json:"suffix"` + TickSuffix string `json:"tickSuffix"` ViewColors []ViewColor `json:"colors"` DecimalPlaces DecimalPlaces `json:"decimalPlaces"` Note string `json:"note"` diff --git a/http/swagger.yml b/http/swagger.yml index 326181516a..a75ed4a7a7 100644 --- a/http/swagger.yml +++ b/http/swagger.yml @@ -8502,7 +8502,9 @@ components: - note - showNoteWhenEmpty - prefix + - tickPrefix - suffix + - tickSuffix - legend - decimalPlaces properties: @@ -8528,8 +8530,12 @@ components: type: boolean prefix: type: string + tickPrefix: + type: string suffix: type: string + tickSuffix: + type: string legend: $ref: '#/components/schemas/Legend' decimalPlaces: diff --git a/pkger/clone_resource.go b/pkger/clone_resource.go index aa3373a936..3520e7d3ee 100644 --- a/pkger/clone_resource.go +++ b/pkger/clone_resource.go @@ -248,6 +248,8 @@ func convertCellView(cell influxdb.Cell) chart { case influxdb.SingleStatViewProperties: setCommon(chartKindSingleStat, p.ViewColors, p.DecimalPlaces, p.Queries) setNoteFixes(p.Note, p.ShowNoteWhenEmpty, p.Prefix, p.Suffix) + ch.TickPrefix = p.TickPrefix + ch.TickSuffix = p.TickSuffix case influxdb.ScatterViewProperties: ch.Kind = chartKindScatter ch.Queries = convertQueries(p.Queries) diff --git a/pkger/models.go b/pkger/models.go index cf4b1c0e85..0188da897b 100644 --- a/pkger/models.go +++ b/pkger/models.go @@ -2269,9 +2269,11 @@ func (c chart) properties() influxdb.ViewProperties { } case chartKindSingleStat: return influxdb.SingleStatViewProperties{ - Type: influxdb.ViewPropertyTypeSingleStat, - Prefix: c.Prefix, - Suffix: c.Suffix, + Type: influxdb.ViewPropertyTypeSingleStat, + Prefix: c.Prefix, + TickPrefix: c.TickPrefix, + Suffix: c.Suffix, + TickSuffix: c.TickSuffix, DecimalPlaces: influxdb.DecimalPlaces{ IsEnforced: c.EnforceDecimals, Digits: int32(c.DecimalPlaces),