From 54ade1132121bdaeec81c199836de288d8f2cbae Mon Sep 17 00:00:00 2001 From: Iris Scholten Date: Tue, 12 Feb 2019 11:24:00 -0800 Subject: [PATCH] Stop cells with raw/no format selected from getting changed to base 10 --- CHANGELOG.md | 1 + server/cells.go | 2 +- ui/src/dashboards/components/AxesOptions.tsx | 6 +++--- ui/src/dashboards/constants/cellEditor.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d908d55..535a4cf24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Bug Fixes 1. [#5068](https://github.com/influxdata/chronograf/pull/5068): Escape injected meta query values 1. [#5073](https://github.com/influxdata/chronograf/pull/5073): Fix out of range decimal places +1. [#5076](https://github.com/influxdata/chronograf/pull/5076): Stop raw yaxis format from getting updated to 10 ## v1.7.7 [2018-01-16] diff --git a/server/cells.go b/server/cells.go index 6b429f07a..2aaafaffa 100644 --- a/server/cells.go +++ b/server/cells.go @@ -121,7 +121,7 @@ func HasCorrectAxes(c *chronograf.DashboardCell) error { return chronograf.ErrInvalidAxis } - if !oneOf(axis.Base, "10", "2", "") { + if !oneOf(axis.Base, "10", "2", "", "raw") { return chronograf.ErrInvalidAxis } } diff --git a/ui/src/dashboards/components/AxesOptions.tsx b/ui/src/dashboards/components/AxesOptions.tsx index 0e9880245..0ab4c66d1 100644 --- a/ui/src/dashboards/components/AxesOptions.tsx +++ b/ui/src/dashboards/components/AxesOptions.tsx @@ -22,7 +22,7 @@ import {Axes, CellType} from 'src/types' import {DecimalPlaces} from 'src/types/dashboards' import {ColorString} from 'src/types/colors' -const {LINEAR, LOG, BASE_2, BASE_10} = AXES_SCALE_OPTIONS +const {LINEAR, LOG, BASE_2, BASE_10, BASE_RAW} = AXES_SCALE_OPTIONS const getInputMin = scale => (scale === LOG ? '0' : null) interface Props { @@ -228,8 +228,8 @@ class AxesOptions extends PureComponent { diff --git a/ui/src/dashboards/constants/cellEditor.ts b/ui/src/dashboards/constants/cellEditor.ts index b04831e17..dbfa10456 100644 --- a/ui/src/dashboards/constants/cellEditor.ts +++ b/ui/src/dashboards/constants/cellEditor.ts @@ -17,6 +17,7 @@ export const AXES_SCALE_OPTIONS = { LOG: 'log', BASE_2: '2', BASE_10: '10', + BASE_RAW: 'raw', } type DefaultAxis = Pick>