Fix slack config save and test button behaviors

pull/2702/head
deniz kusefoglu 2018-01-11 14:45:24 -08:00
parent fec7d9f054
commit 47107f6788
1 changed files with 2 additions and 7 deletions

View File

@ -12,10 +12,6 @@ class SlackConfig extends Component {
handleSubmit = e => {
e.preventDefault()
if (this.state.testEnabled) {
this.props.onTest()
return
}
const properties = {
url: this.url.value,
channel: this.channel.value,
@ -68,7 +64,6 @@ class SlackConfig extends Component {
className="btn btn-primary"
type="submit"
disabled={this.state.testEnabled}
onClick={this.enableTest}
>
<span className="icon checkmark" />
Save Changes
@ -76,7 +71,7 @@ class SlackConfig extends Component {
<button
className="btn btn-primary"
disabled={!this.state.testEnabled}
onClick={this.enableTest}
onClick={this.props.onTest}
>
<span className="icon pulse-c" />
Send Test Alert
@ -99,7 +94,7 @@ SlackConfig.propTypes = {
}).isRequired,
}).isRequired,
onSave: func.isRequired,
onTest: func,
onTest: func.isRequired,
enabled: bool.isRequired,
}