diff --git a/CHANGELOG.md b/CHANGELOG.md index cefd7712e8..78dff89430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This release adds an embedded SQLite database for storing metadata required by t 1. [21531](https://github.com/influxdata/influxdb/pull/21531): Remove feature flags for permanent UI features 1. [21543](https://github.com/influxdata/influxdb/pull/21543): Added `influxd` configuration flag `--sqlite-path` for specifying a user-defined path to the SQLite database file 1. [21543](https://github.com/influxdata/influxdb/pull/21543): Updated `influxd` configuration flag `--store` to work with string values `disk` or `memory`. Memory continues to store metadata in-memory for testing; `disk` will persist metadata to disk via bolt and SQLite +1. [21547](https://github.com/influxdata/influxdb/pull/21547): Allow hiding the tooltip independently of the static legend ### Bug Fixes diff --git a/dashboard.go b/dashboard.go index 5e46d9cc46..550f9634ee 100644 --- a/dashboard.go +++ b/dashboard.go @@ -755,6 +755,7 @@ type LinePlusSingleStatProperties struct { TimeFormat string `json:"timeFormat"` HoverDimension string `json:"hoverDimension"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -784,6 +785,7 @@ type XYViewProperties struct { TimeFormat string `json:"timeFormat"` HoverDimension string `json:"hoverDimension"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -814,6 +816,7 @@ type BandViewProperties struct { MainColumn string `json:"mainColumn"` LowerColumn string `json:"lowerColumn"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -825,6 +828,7 @@ type CheckViewProperties struct { Queries []DashboardQuery `json:"queries"` ViewColors []string `json:"colors"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -857,6 +861,7 @@ type HistogramViewProperties struct { Note string `json:"note"` ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -889,6 +894,7 @@ type HeatmapViewProperties struct { ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` TimeFormat string `json:"timeFormat"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -922,6 +928,7 @@ type ScatterViewProperties struct { ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"` TimeFormat string `json:"timeFormat"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } @@ -953,6 +960,7 @@ type MosaicViewProperties struct { TimeFormat string `json:"timeFormat"` HoverDimension string `json:"hoverDimension"` LegendColorizeRows bool `json:"legendColorizeRows"` + LegendHide bool `json:"legendHide"` LegendOpacity float64 `json:"legendOpacity"` LegendOrientationThreshold int `json:"legendOrientationThreshold"` } diff --git a/dashboard_test.go b/dashboard_test.go index 4cdb090ac6..9004ccb1a4 100644 --- a/dashboard_test.go +++ b/dashboard_test.go @@ -64,6 +64,7 @@ func TestView_MarshalJSON(t *testing.T) { "timeFormat": "", "hoverDimension": "", "legendColorizeRows": false, + "legendHide": false, "legendOpacity": 0, "legendOrientationThreshold": 0 } diff --git a/dashboards/transport/http_test.go b/dashboards/transport/http_test.go index ac8118fb7d..dd2f111ec5 100644 --- a/dashboards/transport/http_test.go +++ b/dashboards/transport/http_test.go @@ -507,6 +507,7 @@ func TestService_handleGetDashboard(t *testing.T) { "yTickStart": 0, "yTickStep": 0, "legendColorizeRows": false, + "legendHide": false, "legendOpacity": 0, "legendOrientationThreshold": 0 }, @@ -1034,6 +1035,7 @@ func TestService_handlePostDashboard(t *testing.T) { "yTickStep": 0, "type": "xy", "legendColorizeRows": false, + "legendHide": false, "legendOpacity": 0, "legendOrientationThreshold": 0 }, diff --git a/pkger/clone_resource.go b/pkger/clone_resource.go index 7f840c8a32..59fd93f641 100644 --- a/pkger/clone_resource.go +++ b/pkger/clone_resource.go @@ -790,6 +790,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.NoteOnEmpty = p.ShowNoteWhenEmpty ch.BinSize = int(p.BinSize) ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) case influxdb.HistogramViewProperties: @@ -804,6 +805,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.BinCount = p.BinCount ch.Position = p.Position ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) case influxdb.MarkdownViewProperties: @@ -829,6 +831,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.YTickStep = p.YTickStep ch.Position = p.Position ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) case influxdb.SingleStatViewProperties: @@ -856,6 +859,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.Note = p.Note ch.NoteOnEmpty = p.ShowNoteWhenEmpty ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) case influxdb.ScatterViewProperties: @@ -879,6 +883,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.Note = p.Note ch.NoteOnEmpty = p.ShowNoteWhenEmpty ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) case influxdb.TableViewProperties: @@ -920,6 +925,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.MainColumn = p.MainColumn ch.LowerColumn = p.LowerColumn ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) case influxdb.XYViewProperties: @@ -943,6 +949,7 @@ func convertCellView(cell influxdb.Cell) chart { ch.YTickStep = p.YTickStep ch.Position = p.Position ch.LegendColorizeRows = p.LegendColorizeRows + ch.LegendHide = p.LegendHide ch.LegendOpacity = float64(p.LegendOpacity) ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold) } @@ -1081,6 +1088,7 @@ func convertChartToResource(ch chart) Resource { fieldChartNoteOnEmpty: ch.NoteOnEmpty, fieldChartShade: ch.Shade, fieldChartLegendColorizeRows: ch.LegendColorizeRows, + fieldChartLegendHide: ch.LegendHide, fieldChartStaticLegendColorizeRows: ch.StaticLegend.ColorizeRows, fieldChartStaticLegendHide: ch.StaticLegend.Hide, fieldChartGeoAllowPanAndZoom: ch.AllowPanAndZoom, diff --git a/pkger/parser.go b/pkger/parser.go index eccb9b137b..b0d38d258e 100644 --- a/pkger/parser.go +++ b/pkger/parser.go @@ -1504,6 +1504,7 @@ func (p *Template) parseChart(dashMetaName string, chartIdx int, r Resource) (*c MainColumn: r.stringShort(fieldChartMainColumn), LowerColumn: r.stringShort(fieldChartLowerColumn), LegendColorizeRows: r.boolShort(fieldChartLegendColorizeRows), + LegendHide: r.boolShort(fieldChartLegendHide), LegendOpacity: r.float64Short(fieldChartLegendOpacity), LegendOrientationThreshold: r.intShort(fieldChartLegendOrientationThreshold), Zoom: r.float64Short(fieldChartGeoZoom), diff --git a/pkger/parser_models.go b/pkger/parser_models.go index d49f31ff9f..37152ab366 100644 --- a/pkger/parser_models.go +++ b/pkger/parser_models.go @@ -573,6 +573,7 @@ const ( fieldChartYTickStep = "yTickStep" fieldChartYPos = "yPos" fieldChartLegendColorizeRows = "legendColorizeRows" + fieldChartLegendHide = "legendHide" fieldChartLegendOpacity = "legendOpacity" fieldChartLegendOrientationThreshold = "legendOrientationThreshold" fieldChartGeoCenterLon = "lon" @@ -624,6 +625,7 @@ type chart struct { TableOptions tableOptions TimeFormat string LegendColorizeRows bool + LegendHide bool LegendOpacity float64 LegendOrientationThreshold int Zoom float64 @@ -694,6 +696,7 @@ func (c *chart) properties() influxdb.ViewProperties { ShowNoteWhenEmpty: c.NoteOnEmpty, TimeFormat: c.TimeFormat, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } @@ -711,6 +714,7 @@ func (c *chart) properties() influxdb.ViewProperties { Note: c.Note, ShowNoteWhenEmpty: c.NoteOnEmpty, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } @@ -745,6 +749,7 @@ func (c *chart) properties() influxdb.ViewProperties { ShowNoteWhenEmpty: c.NoteOnEmpty, TimeFormat: c.TimeFormat, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } @@ -774,6 +779,7 @@ func (c *chart) properties() influxdb.ViewProperties { ShowNoteWhenEmpty: c.NoteOnEmpty, TimeFormat: c.TimeFormat, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } @@ -804,6 +810,7 @@ func (c *chart) properties() influxdb.ViewProperties { ShowNoteWhenEmpty: c.NoteOnEmpty, TimeFormat: c.TimeFormat, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } @@ -852,6 +859,7 @@ func (c *chart) properties() influxdb.ViewProperties { Axes: c.Axes.influxAxes(), Position: c.Position, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } @@ -911,6 +919,7 @@ func (c *chart) properties() influxdb.ViewProperties { Position: c.Position, TimeFormat: c.TimeFormat, LegendColorizeRows: c.LegendColorizeRows, + LegendHide: c.LegendHide, LegendOpacity: float64(c.LegendOpacity), LegendOrientationThreshold: int(c.LegendOrientationThreshold), } diff --git a/pkger/parser_test.go b/pkger/parser_test.go index de53cca201..ab485f9b02 100644 --- a/pkger/parser_test.go +++ b/pkger/parser_test.go @@ -1069,6 +1069,7 @@ spec: assert.Equal(t, 0.0, props.YTickStart) assert.Equal(t, 100.0, props.YTickStep) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) assert.True(t, props.ShowNoteWhenEmpty) @@ -1189,6 +1190,7 @@ spec: assert.Equal(t, "histogram note", props.Note) assert.Equal(t, 30, props.BinCount) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) assert.True(t, props.ShowNoteWhenEmpty) @@ -1313,6 +1315,7 @@ spec: assert.Equal(t, 0.0, props.XTickStart) assert.Equal(t, 1000.0, props.XTickStep) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) }) @@ -1354,6 +1357,7 @@ spec: assert.Equal(t, 0.0, props.YTickStart) assert.Equal(t, 100.0, props.YTickStep) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) assert.Equal(t, true, props.StaticLegend.ColorizeRows) @@ -1435,6 +1439,7 @@ spec: assert.Equal(t, 0.0, props.YTickStart) assert.Equal(t, 100.0, props.YTickStep) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) }) @@ -1882,6 +1887,7 @@ spec: assert.Equal(t, 0.0, props.YTickStart) assert.Equal(t, 100.0, props.YTickStep) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) assert.Equal(t, true, props.StaticLegend.ColorizeRows) @@ -2356,6 +2362,7 @@ spec: assert.Equal(t, 0.0, props.YTickStart) assert.Equal(t, 100.0, props.YTickStep) assert.Equal(t, true, props.LegendColorizeRows) + assert.Equal(t, false, props.LegendHide) assert.Equal(t, 1.0, props.LegendOpacity) assert.Equal(t, 5, props.LegendOrientationThreshold) assert.Equal(t, true, props.StaticLegend.ColorizeRows) diff --git a/pkger/service_test.go b/pkger/service_test.go index 1828cb1989..dccb698484 100644 --- a/pkger/service_test.go +++ b/pkger/service_test.go @@ -2418,6 +2418,7 @@ func TestService(t *testing.T) { BinSize: 10, TimeFormat: "", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2443,6 +2444,7 @@ func TestService(t *testing.T) { BinCount: 30, Position: "stacked", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2481,6 +2483,7 @@ func TestService(t *testing.T) { YSuffix: "y_suffix", TimeFormat: "", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2516,6 +2519,7 @@ func TestService(t *testing.T) { YPrefix: "y_prefix", YSuffix: "y_suffix", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2594,6 +2598,7 @@ func TestService(t *testing.T) { YTickStep: 100, Position: "stacked", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2630,6 +2635,7 @@ func TestService(t *testing.T) { Position: "overlaid", TimeFormat: "", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2667,6 +2673,7 @@ func TestService(t *testing.T) { LowerColumn: "lower", TimeFormat: "", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, @@ -2968,6 +2975,7 @@ func TestService(t *testing.T) { BinCount: 30, Position: "stacked", LegendColorizeRows: true, + LegendHide: false, LegendOpacity: 1.0, LegendOrientationThreshold: 5, }, diff --git a/pkger/testdata/dashboard_band.yml b/pkger/testdata/dashboard_band.yml index f6909c8c38..5d0792ec62 100644 --- a/pkger/testdata/dashboard_band.yml +++ b/pkger/testdata/dashboard_band.yml @@ -37,6 +37,7 @@ spec: yTickStart: 0 yTickStep: 100 legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 staticLegend: diff --git a/pkger/testdata/dashboard_heatmap.json b/pkger/testdata/dashboard_heatmap.json index c7e480d7fd..a97f26e876 100644 --- a/pkger/testdata/dashboard_heatmap.json +++ b/pkger/testdata/dashboard_heatmap.json @@ -29,6 +29,7 @@ "yTickStep": 100, "binSize": 10, "legendColorizeRows": true, + "legendHide": false, "legendOpacity": 1.0, "legendOrientationThreshold": 5, "queries": [ diff --git a/pkger/testdata/dashboard_heatmap.yml b/pkger/testdata/dashboard_heatmap.yml index ec6d874ac9..32e61212a9 100644 --- a/pkger/testdata/dashboard_heatmap.yml +++ b/pkger/testdata/dashboard_heatmap.yml @@ -15,6 +15,7 @@ spec: height: 3 binSize: 10 legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 generateXAxisTicks: diff --git a/pkger/testdata/dashboard_histogram.json b/pkger/testdata/dashboard_histogram.json index 55bb294a18..b5bf158c6b 100644 --- a/pkger/testdata/dashboard_histogram.json +++ b/pkger/testdata/dashboard_histogram.json @@ -19,6 +19,7 @@ "position": "stacked", "binCount": 30, "legendColorizeRows": true, + "legendHide": false, "legendOpacity": 1.0, "legendOrientationThreshold": 5, "fillColumns": [ diff --git a/pkger/testdata/dashboard_histogram.yml b/pkger/testdata/dashboard_histogram.yml index 349ba49a59..9ca90298c8 100644 --- a/pkger/testdata/dashboard_histogram.yml +++ b/pkger/testdata/dashboard_histogram.yml @@ -15,6 +15,7 @@ spec: binCount: 30 fillColumns: ["a", "b"] legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 queries: diff --git a/pkger/testdata/dashboard_mosaic.yml b/pkger/testdata/dashboard_mosaic.yml index 2d35735159..d412aca412 100644 --- a/pkger/testdata/dashboard_mosaic.yml +++ b/pkger/testdata/dashboard_mosaic.yml @@ -32,6 +32,7 @@ spec: - _value - foo legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 queries: diff --git a/pkger/testdata/dashboard_scatter.json b/pkger/testdata/dashboard_scatter.json index e99973cb96..7b00fe6564 100644 --- a/pkger/testdata/dashboard_scatter.json +++ b/pkger/testdata/dashboard_scatter.json @@ -28,6 +28,7 @@ "yTickStart": 0, "yTickStep": 100, "legendColorizeRows": true, + "legendHide": false, "legendOpacity": 1.0, "legendOrientationThreshold": 5, "queries": [ diff --git a/pkger/testdata/dashboard_scatter.yml b/pkger/testdata/dashboard_scatter.yml index 2297d467cc..c7d67f791a 100644 --- a/pkger/testdata/dashboard_scatter.yml +++ b/pkger/testdata/dashboard_scatter.yml @@ -32,6 +32,7 @@ spec: width: 6 height: 3 legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 queries: diff --git a/pkger/testdata/dashboard_single_stat_plus_line.json b/pkger/testdata/dashboard_single_stat_plus_line.json index e75bfdbbbc..1f7acc9bcf 100644 --- a/pkger/testdata/dashboard_single_stat_plus_line.json +++ b/pkger/testdata/dashboard_single_stat_plus_line.json @@ -34,6 +34,7 @@ "yTickStep": 100, "position": "overlaid", "legendColorizeRows": true, + "legendHide": false, "legendOpacity": 1.0, "legendOrientationThreshold": 5, "staticLegend": { diff --git a/pkger/testdata/dashboard_single_stat_plus_line.yml b/pkger/testdata/dashboard_single_stat_plus_line.yml index 060233488e..20ea04e79c 100644 --- a/pkger/testdata/dashboard_single_stat_plus_line.yml +++ b/pkger/testdata/dashboard_single_stat_plus_line.yml @@ -34,6 +34,7 @@ spec: yTickStart: 0 yTickStep: 100 legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 staticLegend: diff --git a/pkger/testdata/dashboard_xy.json b/pkger/testdata/dashboard_xy.json index 92cd7db187..f4fa74497a 100644 --- a/pkger/testdata/dashboard_xy.json +++ b/pkger/testdata/dashboard_xy.json @@ -33,6 +33,7 @@ "yTickStart": 0, "yTickStep": 100, "legendColorizeRows": true, + "legendHide": false, "legendOpacity": 1.0, "legendOrientationThreshold": 5, "staticLegend": { diff --git a/pkger/testdata/dashboard_xy.yml b/pkger/testdata/dashboard_xy.yml index 5b7e95ed80..a1acc66f40 100644 --- a/pkger/testdata/dashboard_xy.yml +++ b/pkger/testdata/dashboard_xy.yml @@ -32,6 +32,7 @@ spec: yTickStart: 0 yTickStep: 100 legendColorizeRows: true + legendHide: false legendOpacity: 1.0 legendOrientationThreshold: 5 staticLegend: