Fix DE freezing up when there is no field list

pull/10616/head
Andrew Watkins 2017-08-30 13:28:15 -07:00
parent 6d028c755f
commit ac2f5a1f7a
1 changed files with 9 additions and 4 deletions

View File

@ -79,9 +79,14 @@ const FieldList = React.createClass({
},
render() {
const {query, isKapacitorRule, isInDataExplorer} = this.props
const hasAggregates = query.fields.some(f => f.funcs && f.funcs.length)
const hasGroupByTime = query.groupBy.time
const {
query: {fields = [], groupBy},
isKapacitorRule,
isInDataExplorer,
} = this.props
const hasAggregates = fields.some(f => f.funcs && f.funcs.length)
const hasGroupByTime = groupBy.time
return (
<div className="query-builder--column">
@ -90,7 +95,7 @@ const FieldList = React.createClass({
{hasAggregates
? <GroupByTimeDropdown
isOpen={!hasGroupByTime}
selected={query.groupBy.time}
selected={groupBy.time}
onChooseGroupByTime={this.handleGroupByTime}
isInRuleBuilder={isKapacitorRule}
isInDataExplorer={isInDataExplorer}