Merge pull request #443 from influxdata/fix-save-task-query-changes

Fix save task query changes
pull/427/head
Andrew Watkins 2016-11-09 15:50:38 -08:00 committed by GitHub
commit 0489702f5e
2 changed files with 8 additions and 5 deletions

View File

@ -25,7 +25,7 @@ const AlertOutputs = React.createClass({
getInitialState() {
return {
selectedEndpoint: 'alerta',
selectedEndpoint: 'smtp',
alertaConfig: null,
smtpConfig: null,
slackConfig: null,
@ -112,8 +112,7 @@ const AlertOutputs = React.createClass({
<div className="row">
<div className="form-group col-xs-7 col-sm-5 col-sm-offset-2">
<label htmlFor="alert-endpoint" className="sr-only">Alert Enpoint</label>
<select className="form-control" id="source" onChange={this.changeSelectedEndpoint}>
<option value="alerta">Alerta</option>
<select value={this.state.selectedEndpoint} className="form-control" id="source" onChange={this.changeSelectedEndpoint}>
<option value="hipchat">HipChat</option>
<option value="pagerduty">PagerDuty</option>
<option value="sensu">Sensu</option>

View File

@ -82,7 +82,11 @@ export const KapacitorRulePage = React.createClass({
handleSave() {
const {queryConfigs, rules, params, source} = this.props;
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!`});
}).catch(() => {
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}
onKeyDown={(e) => this.handleEditName(e, rule)}
onBlur={() => this.handleEditNameBlur(rule)}
placeholder="Name your Alert"
placeholder="Name your rule"
/>
);
},