diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-04-07 12:51:23 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-04-07 12:51:23 -0400 |
commit | af98754d249bc938b9d57106d05439c7b12d93b3 (patch) | |
tree | 7ef89c6d1fd0a2fcbd48c78987b1ad95085147d9 /webapp/components/admin_console/boolean_setting.jsx | |
parent | 32bc97f8559a3a1b9c9237dbb3640f9eac6daf98 (diff) | |
parent | 0a2341efd208ba8a9ddd69f647b0df4286829604 (diff) | |
download | chat-af98754d249bc938b9d57106d05439c7b12d93b3.tar.gz chat-af98754d249bc938b9d57106d05439c7b12d93b3.tar.bz2 chat-af98754d249bc938b9d57106d05439c7b12d93b3.zip |
Merge pull request #2656 from mattermost/plt-2254
PLT-2254 Adding TLS options to LDAP
Diffstat (limited to 'webapp/components/admin_console/boolean_setting.jsx')
-rw-r--r-- | webapp/components/admin_console/boolean_setting.jsx | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/webapp/components/admin_console/boolean_setting.jsx b/webapp/components/admin_console/boolean_setting.jsx new file mode 100644 index 000000000..99d508d68 --- /dev/null +++ b/webapp/components/admin_console/boolean_setting.jsx @@ -0,0 +1,62 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +import React from 'react'; + +import Setting from './setting.jsx'; + +import {FormattedMessage} from 'react-intl'; + +export default class BooleanSetting extends React.Component { + render() { + return ( + <Setting label={this.props.label}> + <label className='radio-inline'> + <input + type='radio' + value='true' + checked={this.props.currentValue} + onChange={this.props.handleChange} + disabled={this.props.isDisabled} + /> + {this.props.trueText} + </label> + <label className='radio-inline'> + <input + type='radio' + value='false' + checked={!this.props.currentValue} + onChange={this.props.handleChange} + disabled={this.props.isDisabled} + /> + {this.props.falseText} + </label> + {this.props.helpText} + </Setting> + ); + } +} +BooleanSetting.defaultProps = { + trueText: ( + <FormattedMessage + id='admin.ldap.true' + defaultMessage='true' + /> + ), + falseText: ( + <FormattedMessage + id='admin.ldap.false' + defaultMessage='false' + /> + ) +}; + +BooleanSetting.propTypes = { + label: React.PropTypes.node.isRequired, + currentValue: React.PropTypes.bool.isRequired, + trueText: React.PropTypes.node, + falseText: React.PropTypes.node, + isDisabled: React.PropTypes.bool.isRequired, + handleChange: React.PropTypes.func.isRequired, + helpText: React.PropTypes.node.isRequired +}; |