diff options
author | Joram Wilander <jwawilander@gmail.com> | 2015-09-22 15:47:57 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2015-09-22 15:47:57 -0400 |
commit | ac7918c5540900ab0dbe43d61b8c1155e4279b55 (patch) | |
tree | 2e519e101e995d24d656d7cf1f7a9d404303a364 /web/react/components/user_settings/user_settings_developer.jsx | |
parent | a44e8f0cd904d386caea410398dcaf7dbfd9c138 (diff) | |
parent | 98186e5018bbc604796d4f9762c93f4f75e2913f (diff) | |
download | chat-ac7918c5540900ab0dbe43d61b8c1155e4279b55.tar.gz chat-ac7918c5540900ab0dbe43d61b8c1155e4279b55.tar.bz2 chat-ac7918c5540900ab0dbe43d61b8c1155e4279b55.zip |
Merge pull request #715 from mattermost/plt-27
PLT-27 Implement incoming webhooks.
Diffstat (limited to 'web/react/components/user_settings/user_settings_developer.jsx')
-rw-r--r-- | web/react/components/user_settings/user_settings_developer.jsx | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/web/react/components/user_settings/user_settings_developer.jsx b/web/react/components/user_settings/user_settings_developer.jsx new file mode 100644 index 000000000..1694aaa79 --- /dev/null +++ b/web/react/components/user_settings/user_settings_developer.jsx @@ -0,0 +1,93 @@ +// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. +// See License.txt for license information. + +var SettingItemMin = require('../setting_item_min.jsx'); +var SettingItemMax = require('../setting_item_max.jsx'); + +export default class DeveloperTab extends React.Component { + constructor(props) { + super(props); + + this.state = {}; + } + register() { + $('#user_settings1').modal('hide'); + $('#register_app').modal('show'); + } + render() { + var appSection; + var self = this; + if (this.props.activeSection === 'app') { + var inputs = []; + + inputs.push( + <div className='form-group'> + <div className='col-sm-7'> + <a + className='btn btn-sm btn-primary' + onClick={this.register} + > + {'Register New Application'} + </a> + </div> + </div> + ); + + appSection = ( + <SettingItemMax + title='Applications (Preview)' + inputs={inputs} + updateSection={function updateSection(e) { + self.props.updateSection(''); + e.preventDefault(); + }} + /> + ); + } else { + appSection = ( + <SettingItemMin + title='Applications (Preview)' + describe='Open to register a new third-party application' + updateSection={function updateSection() { + self.props.updateSection('app'); + }} + /> + ); + } + + return ( + <div> + <div className='modal-header'> + <button + type='button' + className='close' + data-dismiss='modal' + aria-label='Close' + > + <span aria-hidden='true'>{'x'}</span> + </button> + <h4 + className='modal-title' + ref='title' + > + <i className='modal-back'></i>{'Developer Settings'} + </h4> + </div> + <div className='user-settings'> + <h3 className='tab-header'>{'Developer Settings'}</h3> + <div className='divider-dark first'/> + {appSection} + <div className='divider-dark'/> + </div> + </div> + ); + } +} + +DeveloperTab.defaultProps = { + activeSection: '' +}; +DeveloperTab.propTypes = { + activeSection: React.PropTypes.string, + updateSection: React.PropTypes.func +}; |