Merge pull request #2158 from influxdata/bugfix/connect-to-source

Fix cannot connect to source false error flag
pull/10616/head
Andrew Watkins 2017-10-30 10:02:17 -07:00 committed by GitHub
commit 78feb83e66
3 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,8 @@
## v1.3.11.0 [unreleased]
### Bug Fixes
1. [#2158](https://github.com/influxdata/chronograf/pull/2158): Fix 'Cannot connect to source' false error flag on Dashboard page
1. [#2167](https://github.com/influxdata/chronograf/pull/2167): Add fractions of seconds to time field in csv export
### Features
### UI Improvements

View File

@ -281,7 +281,8 @@ export const updateTempVarValues = (source, dashboard) => async dispatch => {
results.forEach(({data}, i) => {
const {type, query, id} = tempsWithQueries[i]
const vals = parsers[type](data, query.tagKey || query.measurement)[type]
const parsed = parsers[type](data, query.tagKey || query.measurement)
const vals = parsed[type]
dispatch(editTemplateVariableValues(dashboard.id, id, vals))
})
} catch (error) {

View File

@ -1,3 +1,4 @@
import _ from 'lodash'
import databases from 'shared/parsing/showDatabases'
import measurements from 'shared/parsing/showMeasurements'
import fieldKeys from 'shared/parsing/showFieldKeys'
@ -8,16 +9,19 @@ const parsers = {
databases,
measurements: data => {
const {errors, measurementSets} = measurements(data)
return {errors, measurements: measurementSets[0].measurements}
return {
errors,
measurements: _.get(measurementSets, ['0', 'measurements'], []),
}
},
fieldKeys: (data, key) => {
const {errors, fieldSets} = fieldKeys(data)
return {errors, fieldKeys: fieldSets[key]}
return {errors, fieldKeys: _.get(fieldSets, key, [])}
},
tagKeys,
tagValues: (data, key) => {
const {errors, tags} = tagValues(data)
return {errors, tagValues: tags[key]}
return {errors, tagValues: _.get(tags, key, [])}
},
}