Update label to handle new field shapes

pull/10616/head
Andrew Watkins 2017-11-28 12:46:01 -05:00
parent eee830979f
commit ad9eb6d632
1 changed files with 5 additions and 7 deletions

View File

@ -110,11 +110,9 @@ function getRolesForUser(roles, user) {
}
export const buildDefaultYLabel = queryConfig => {
return queryConfig.rawText
? ''
: `${queryConfig.measurement}.${_.get(
queryConfig,
['fields', '0', 'field'],
''
)}`
const {measurement, fields} = queryConfig
const fieldAlias = `${_.get(fields, ['0', 'alias'], '')}`
const field = `${_.get(fields, ['0', 'value'], '')}`
return `${measurement}.${fieldAlias || field}`
}