Prevent click event being passed to handleCreate and handleEdit

pull/10616/head
deniz kusefoglu 2018-02-07 11:58:31 -08:00
parent 61e4e08991
commit f03a698ccc
1 changed files with 10 additions and 3 deletions

View File

@ -159,13 +159,20 @@ class KapacitorRule extends Component {
} = this.props } = this.props
const {chooseTrigger, updateRuleValues} = ruleActions const {chooseTrigger, updateRuleValues} = ruleActions
const {timeRange} = this.state const {timeRange} = this.state
const onSave = () => {
if (rule.id === DEFAULT_RULE_ID) {
this.handleCreate()
} else {
this.handleEdit()
}
}
return ( return (
<div className="page"> <div className="page">
<RuleHeader <RuleHeader
source={source} source={source}
onSave={ onSave={onSave}
rule.id === DEFAULT_RULE_ID ? this.handleCreate : this.handleEdit
}
validationError={this.validationError()} validationError={this.validationError()}
/> />
<FancyScrollbar className="page-contents fancy-scroll--kapacitor"> <FancyScrollbar className="page-contents fancy-scroll--kapacitor">