Stop cells with raw/no format selected from getting changed to base 10

pull/5076/head
Iris Scholten 2019-02-12 11:24:00 -08:00
parent ca9f8ace80
commit 54ade11321
4 changed files with 6 additions and 4 deletions

View File

@ -2,6 +2,7 @@
### Bug Fixes ### Bug Fixes
1. [#5068](https://github.com/influxdata/chronograf/pull/5068): Escape injected meta query values 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. [#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] ## v1.7.7 [2018-01-16]

View File

@ -121,7 +121,7 @@ func HasCorrectAxes(c *chronograf.DashboardCell) error {
return chronograf.ErrInvalidAxis return chronograf.ErrInvalidAxis
} }
if !oneOf(axis.Base, "10", "2", "") { if !oneOf(axis.Base, "10", "2", "", "raw") {
return chronograf.ErrInvalidAxis return chronograf.ErrInvalidAxis
} }
} }

View File

@ -22,7 +22,7 @@ import {Axes, CellType} from 'src/types'
import {DecimalPlaces} from 'src/types/dashboards' import {DecimalPlaces} from 'src/types/dashboards'
import {ColorString} from 'src/types/colors' 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) const getInputMin = scale => (scale === LOG ? '0' : null)
interface Props { interface Props {
@ -228,8 +228,8 @@ class AxesOptions extends PureComponent<Props, State> {
<Radio shape={ButtonShape.StretchToFit}> <Radio shape={ButtonShape.StretchToFit}>
<Radio.Button <Radio.Button
id="y-values-format-tab--raw" id="y-values-format-tab--raw"
value="" value={BASE_RAW}
active={base === ''} active={base === '' || base === BASE_RAW}
titleText="Don't format values" titleText="Don't format values"
onClick={this.handleSetBase} onClick={this.handleSetBase}
> >

View File

@ -17,6 +17,7 @@ export const AXES_SCALE_OPTIONS = {
LOG: 'log', LOG: 'log',
BASE_2: '2', BASE_2: '2',
BASE_10: '10', BASE_10: '10',
BASE_RAW: 'raw',
} }
type DefaultAxis = Pick<Axis, Exclude<keyof Axis, 'bounds'>> type DefaultAxis = Pick<Axis, Exclude<keyof Axis, 'bounds'>>