Fix DE freezing up when there is no field list

pull/1947/head
Andrew Watkins 2017-08-30 13:28:15 -07:00
parent 93d7469729
commit d597f07101
1 changed files with 9 additions and 4 deletions

View File

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