summaryrefslogtreecommitdiffstats
path: root/web/react/components/signup_team.jsx
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-09-21 15:11:56 -0700
committer=Corey Hulen <corey@hulen.com>2015-09-21 15:11:56 -0700
commited9a2da83b3b77e7dd0314eaa92082ac8a2a9a9c (patch)
tree3c890327d884b33ad149196ddf9879313b2b000b /web/react/components/signup_team.jsx
parentee5a77ec56ee13f5eb96fce6065b4b7a1845de89 (diff)
downloadchat-ed9a2da83b3b77e7dd0314eaa92082ac8a2a9a9c.tar.gz
chat-ed9a2da83b3b77e7dd0314eaa92082ac8a2a9a9c.tar.bz2
chat-ed9a2da83b3b77e7dd0314eaa92082ac8a2a9a9c.zip
Adding email to admin console
Diffstat (limited to 'web/react/components/signup_team.jsx')
-rw-r--r--web/react/components/signup_team.jsx48
1 files changed, 21 insertions, 27 deletions
diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx
index bf08e6508..91d79b919 100644
--- a/web/react/components/signup_team.jsx
+++ b/web/react/components/signup_team.jsx
@@ -4,7 +4,7 @@
const ChoosePage = require('./team_signup_choose_auth.jsx');
const EmailSignUpPage = require('./team_signup_with_email.jsx');
const SSOSignupPage = require('./team_signup_with_sso.jsx');
-const Constants = require('../utils/constants.jsx');
+var Constants = require('../utils/constants.jsx');
export default class TeamSignUp extends React.Component {
constructor(props) {
@@ -12,38 +12,32 @@ 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: ''};
+ if (global.window.config.AllowSignUpWithEmail && global.window.config.AllowSignUpWithGitLab) {
+ this.state = {page: 'choose'};
+ } else if (global.window.config.AllowSignUpWithEmail) {
+ this.state = {page: 'email'};
+ } else if (global.window.config.AllowSignUpWithGitLab) {
+ 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
-};