diff options
author | Corey Hulen <corey@hulen.com> | 2015-09-23 14:04:08 -0700 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-09-23 14:04:08 -0700 |
commit | d792745f54463772472bec23b0caaae703eaddb3 (patch) | |
tree | d98c966e0f273c5a6052e3c154bd7d75d091aa27 /web/react/components/signup_team.jsx | |
parent | 0170cfe604e6cfb430be0b6181243ca85a9ab27b (diff) | |
parent | ccf2e6e4e74fc249a094c2c27de675644f1065cb (diff) | |
download | chat-d792745f54463772472bec23b0caaae703eaddb3.tar.gz chat-d792745f54463772472bec23b0caaae703eaddb3.tar.bz2 chat-d792745f54463772472bec23b0caaae703eaddb3.zip |
Merge pull request #752 from mattermost/PLT-11-email
PLT-11 Cleaned up config file and added ability to makes changes from the admin console.
Diffstat (limited to 'web/react/components/signup_team.jsx')
-rw-r--r-- | web/react/components/signup_team.jsx | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx index bf08e6508..4112138fa 100644 --- a/web/react/components/signup_team.jsx +++ b/web/react/components/signup_team.jsx @@ -12,38 +12,42 @@ export default class TeamSignUp extends React.Component { this.updatePage = this.updatePage.bind(this); - if (props.services.length === 1) { - if (props.services[0] === Constants.EMAIL_SERVICE) { - this.state = {page: 'email', service: ''}; - } else { - this.state = {page: 'service', service: props.services[0]}; - } - } else { - this.state = {page: 'choose', service: ''}; + var count = 0; + + if (global.window.config.EnableSignUpWithEmail === 'true') { + count = count + 1; + } + + if (global.window.config.EnableSignUpWithGitLab === 'true') { + count = count + 1; + } + + if (count > 1) { + this.state = {page: 'choose'}; + } else if (global.window.config.EnableSignUpWithEmail === 'true') { + this.state = {page: 'email'}; + } else if (global.window.config.EnableSignUpWithGitLab === 'true') { + this.state = {page: 'gitlab'}; } } - updatePage(page, service) { - this.setState({page: page, service: service}); + + updatePage(page) { + this.setState({page}); } + render() { + if (this.state.page === 'choose') { + return ( + <ChoosePage + updatePage={this.updatePage} + /> + ); + } + if (this.state.page === 'email') { return <EmailSignUpPage />; - } else if (this.state.page === 'service' && this.state.service !== '') { - return <SSOSignupPage service={this.state.service} />; + } else if (this.state.page === 'gitlab') { + return <SSOSignupPage service={Constants.GITLAB_SERVICE} />; } - - return ( - <ChoosePage - services={this.props.services} - updatePage={this.updatePage} - /> - ); } } - -TeamSignUp.defaultProps = { - services: [] -}; -TeamSignUp.propTypes = { - services: React.PropTypes.array -}; |