Merge pull request #2563 from influxdata/bugfix/y-axis-undefined

y axis title undefined
pull/2580/head
Nathan Haugo 2017-12-13 17:29:00 -08:00 committed by GitHub
commit 3a953d99bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -3,7 +3,7 @@
### UI Improvements
### Bug Fixes
1. [#2528](https://github.com/influxdata/chronograf/pull/2528): Fix template rendering to ignore template if not in query
1. [#2554](https://github.com/influxdata/chronograf/pull/2554): Fix graph inversion if a user supplies a min y-bound > max y-bound
1. [#2563](https://github.com/influxdata/chronograf/pull/2563): Fix graph inversion if user input y-axis min greater than max
## v1.4.0.0-beta1 [2017-12-07]
### Features

View File

@ -258,5 +258,12 @@ describe('Presenters', () => {
expect(actual).to.equal('m1.derivative_mean_usage_system')
})
it('returns a label of empty string if the query config is empty', () => {
const query = defaultQueryConfig({id: 1})
const actual = buildDefaultYLabel(query)
expect(actual).to.equal('')
})
})
})

View File

@ -40,7 +40,7 @@ const AxesOptions = ({
<div className="form-group col-sm-12">
<label htmlFor="prefix">Title</label>
<OptIn
customPlaceholder={defaultYLabel}
customPlaceholder={defaultYLabel || 'y-axis title'}
customValue={label}
onSetValue={onSetLabel}
type="text"

View File

@ -114,6 +114,11 @@ function getRolesForUser(roles, user) {
export const buildDefaultYLabel = queryConfig => {
const {measurement} = queryConfig
const fields = _.get(queryConfig, ['fields', '0'], [])
const isEmpty = !measurement && !fields.length
if (isEmpty) {
return ''
}
const walkZerothArgs = f => {
if (f.type === 'field') {