Skip to content

Commit

Permalink
fix(pkger): elminate threshold color requirement for guage charts
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteenb2 committed Feb 27, 2020
1 parent 4f2076a commit 7761c99
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
1. [17010](https://github.com/influxdata/influxdb/pull/17010): Fixed scrollbar issue where resource cards would overflow the parent container rather than be hidden and scrollable
1. [16992](https://github.com/influxdata/influxdb/pull/16992): Query Builder now groups on column values, not tag values
1. [17013](https://github.com/influxdata/influxdb/pull/17013): Scatterplots can once again render the tooltip correctly
1. [17027](https://github.com/influxdata/influxdb/pull/17027): Drop pkger gauge chart requirement for color threshold type

## v2.0.0-beta.4 [2020-02-14]

Expand Down
2 changes: 1 addition & 1 deletion pkger/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -2344,7 +2344,7 @@ func (c chart) validProperties() []validationErr {
// chart kind specific validations
switch c.Kind {
case chartKindGauge:
fails = append(fails, c.Colors.hasTypes(colorTypeMin, colorTypeThreshold, colorTypeMax)...)
fails = append(fails, c.Colors.hasTypes(colorTypeMin, colorTypeMax)...)
case chartKindHeatMap:
fails = append(fails, c.Axes.hasAxes("x", "y")...)
case chartKindHistogram:
Expand Down
33 changes: 0 additions & 33 deletions pkger/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,39 +763,6 @@ spec:

t.Run("handles invalid config", func(t *testing.T) {
tests := []testPkgResourceError{
{
name: "missing threshold color type",
validationErrs: 1,
valFields: []string{"charts[0].colors"},
pkgStr: `apiVersion: influxdata.com/v2alpha1
kind: Dashboard
metadata:
name: dash_1
spec:
description: desc1
charts:
- kind: gauge
name: gauge
note: gauge note
noteOnEmpty: true
xPos: 1
yPos: 2
width: 6
height: 3
queries:
- query: >
from(bucket: v.bucket) |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r._measurement == "boltdb_writes_total") |> filter(fn: (r) => r._field == "counter")
colors:
- name: laser
type: min
hex: "#8F8AF4"
value: 0
- name: laser
type: max
hex: "#8F8AF4"
value: 5000
`,
},
{
name: "color mixing a hex value",
validationErrs: 1,
Expand Down

0 comments on commit 7761c99

Please sign in to comment.