Disable test alert button if endpoint is disabled at construction

pull/10616/head
deniz kusefoglu 2018-01-11 13:40:09 -08:00
parent 60d2ff014f
commit 24a182874a
2 changed files with 3 additions and 2 deletions

View File

@ -196,6 +196,7 @@ class AlertTabs extends Component {
onSave={this.handleSaveConfig('slack')}
config={this.getSection(configSections, 'slack')}
onTest={this.handleTestConfig('slack')}
enabled={this.getEnabled(configSections, 'slack')}
/>,
},
smtp: {

View File

@ -6,8 +6,7 @@ class SlackConfig extends Component {
constructor(props) {
super(props)
this.state = {
// if enabled true, else false.
testEnabled: true,
testEnabled: this.props.enabled,
}
}
@ -101,6 +100,7 @@ SlackConfig.propTypes = {
}).isRequired,
onSave: func.isRequired,
onTest: func,
enabled: bool.isRequired,
}
export default SlackConfig