From 95c24ef14b710ea095b3247f4bffee732ce4e5af Mon Sep 17 00:00:00 2001 From: deniz kusefoglu Date: Thu, 8 Feb 2018 12:27:04 -0800 Subject: [PATCH] take onSave out of render and rename to handleSave --- ui/src/kapacitor/components/KapacitorRule.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ui/src/kapacitor/components/KapacitorRule.js b/ui/src/kapacitor/components/KapacitorRule.js index adfaf988b8..e86217e6fc 100644 --- a/ui/src/kapacitor/components/KapacitorRule.js +++ b/ui/src/kapacitor/components/KapacitorRule.js @@ -75,6 +75,15 @@ class KapacitorRule extends Component { }) } + handleSave = () => { + const {rule} = this.props + if (rule.id === DEFAULT_RULE_ID) { + this.handleCreate() + } else { + this.handleEdit() + } + } + handleSaveToConfig = configName => () => { const {rule, configLink, router} = this.props const pathname = `${configLink}#${configName}` @@ -161,19 +170,11 @@ class KapacitorRule extends Component { const {chooseTrigger, updateRuleValues} = ruleActions const {timeRange} = this.state - const onSave = () => { - if (rule.id === DEFAULT_RULE_ID) { - this.handleCreate() - } else { - this.handleEdit() - } - } - return (