Merge pull request #443 from influxdata/fix-save-task-query-changes
Fix save task query changespull/10616/head
commit
f551ba038c
|
@ -25,7 +25,7 @@ const AlertOutputs = React.createClass({
|
||||||
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
selectedEndpoint: 'alerta',
|
selectedEndpoint: 'smtp',
|
||||||
alertaConfig: null,
|
alertaConfig: null,
|
||||||
smtpConfig: null,
|
smtpConfig: null,
|
||||||
slackConfig: null,
|
slackConfig: null,
|
||||||
|
@ -112,8 +112,7 @@ const AlertOutputs = React.createClass({
|
||||||
<div className="row">
|
<div className="row">
|
||||||
<div className="form-group col-xs-7 col-sm-5 col-sm-offset-2">
|
<div className="form-group col-xs-7 col-sm-5 col-sm-offset-2">
|
||||||
<label htmlFor="alert-endpoint" className="sr-only">Alert Enpoint</label>
|
<label htmlFor="alert-endpoint" className="sr-only">Alert Enpoint</label>
|
||||||
<select className="form-control" id="source" onChange={this.changeSelectedEndpoint}>
|
<select value={this.state.selectedEndpoint} className="form-control" id="source" onChange={this.changeSelectedEndpoint}>
|
||||||
<option value="alerta">Alerta</option>
|
|
||||||
<option value="hipchat">HipChat</option>
|
<option value="hipchat">HipChat</option>
|
||||||
<option value="pagerduty">PagerDuty</option>
|
<option value="pagerduty">PagerDuty</option>
|
||||||
<option value="sensu">Sensu</option>
|
<option value="sensu">Sensu</option>
|
||||||
|
|
|
@ -82,7 +82,11 @@ export const KapacitorRulePage = React.createClass({
|
||||||
handleSave() {
|
handleSave() {
|
||||||
const {queryConfigs, rules, params, source} = this.props;
|
const {queryConfigs, rules, params, source} = this.props;
|
||||||
if (this.isEditing()) { // If we are editing updated rule if not, create a new one
|
if (this.isEditing()) { // If we are editing updated rule if not, create a new one
|
||||||
editRule(rules[params.ruleID]).then(() => {
|
const rule = rules[params.ruleID];
|
||||||
|
const updatedRule = Object.assign({}, rule, {
|
||||||
|
query: queryConfigs[rule.queryID],
|
||||||
|
});
|
||||||
|
editRule(updatedRule).then(() => {
|
||||||
this.props.addFlashMessage({type: 'success', text: `Rule successfully updated!`});
|
this.props.addFlashMessage({type: 'success', text: `Rule successfully updated!`});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.props.addFlashMessage({type: 'failure', text: `There was a problem updating the rule`});
|
this.props.addFlashMessage({type: 'failure', text: `There was a problem updating the rule`});
|
||||||
|
@ -188,7 +192,7 @@ export const KapacitorRulePage = React.createClass({
|
||||||
ref={r => this.ruleName = r}
|
ref={r => this.ruleName = r}
|
||||||
onKeyDown={(e) => this.handleEditName(e, rule)}
|
onKeyDown={(e) => this.handleEditName(e, rule)}
|
||||||
onBlur={() => this.handleEditNameBlur(rule)}
|
onBlur={() => this.handleEditNameBlur(rule)}
|
||||||
placeholder="Name your Alert"
|
placeholder="Name your rule"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue