diff --git a/ui/src/kapacitor/components/AlertOutputs.js b/ui/src/kapacitor/components/AlertOutputs.js index 663842d89..1ab90576d 100644 --- a/ui/src/kapacitor/components/AlertOutputs.js +++ b/ui/src/kapacitor/components/AlertOutputs.js @@ -27,7 +27,6 @@ const AlertOutputs = React.createClass({ return { selectedEndpoint: 'smtp', configSections: null, - canConnect: false, }; }, @@ -37,12 +36,9 @@ const AlertOutputs = React.createClass({ refreshKapacitorConfig() { getKapacitorConfig(this.props.kapacitor).then(({data: {sections}}) => { - this.setState({ - configSections: sections, - canConnect: true, - }); + this.setState({configSections: sections}); }).catch(() => { - this.setState({canConnect: false}); + this.props.addFlashMessage({type: 'error', text: `There was an error getting the kapacitor config`}); }); }, @@ -95,33 +91,24 @@ const AlertOutputs = React.createClass({

Alert Endpoints


- {this.renderBody()} -
- ); - }, - - renderBody() { - if (!this.state.canConnect) { - return

Cannot connect.

; - } - return ( -
-
-
- - +
+
+
+ + +
+
+
+ {this.renderAlertConfig(this.state.selectedEndpoint)}
-
-
- {this.renderAlertConfig(this.state.selectedEndpoint)}
); @@ -136,7 +123,7 @@ const AlertOutputs = React.createClass({ }; const {configSections} = this.state; - if (!configSections) { + if (!configSections) { // could use this state to conditionally render spinner or error message return null; }