Prevent click event being passed to handleCreate and handleEdit
parent
61e4e08991
commit
f03a698ccc
|
@ -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">
|
||||||
|
|
Loading…
Reference in New Issue