Merge pull request #2563 from influxdata/bugfix/y-axis-undefined
y axis title undefinedpull/2580/head
commit
3a953d99bc
|
@ -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
|
||||
|
|
|
@ -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('')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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') {
|
||||
|
|
Loading…
Reference in New Issue