From e863096358dd64ecf2de6efeec3db132cdc8d6b9 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 21 Sep 2015 15:34:09 -0700 Subject: Fixing broken signup pages --- web/react/components/invite_member_modal.jsx | 2 +- web/react/components/login.jsx | 4 ++-- web/react/components/signup_team.jsx | 16 +++++++++++++--- web/react/components/signup_user_complete.jsx | 4 ++-- web/react/components/team_signup_choose_auth.jsx | 4 ++-- web/react/components/team_signup_send_invites_page.jsx | 2 +- web/react/components/user_profile.jsx | 2 +- web/react/components/user_settings_general.jsx | 2 +- web/react/components/view_image.jsx | 2 +- 9 files changed, 24 insertions(+), 14 deletions(-) (limited to 'web/react/components') diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index acf6db9dc..395b98630 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -21,7 +21,7 @@ export default class InviteMemberModal extends React.Component { emailErrors: {}, firstNameErrors: {}, lastNameErrors: {}, - emailEnabled: !global.window.config.SendEmailNotifications + emailEnabled: global.window.config.SendEmailNotifications === 'true' }; } diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index cb7bc8835..72fae9149 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -96,7 +96,7 @@ export default class Login extends React.Component { } let loginMessage = []; - if (global.window.config.AllowSignUpWithGitLab) { + if (global.window.config.AllowSignUpWithGitLab === 'true') { loginMessage.push(
diff --git a/web/react/components/signup_team.jsx b/web/react/components/signup_team.jsx index 91d79b919..d08608c9b 100644 --- a/web/react/components/signup_team.jsx +++ b/web/react/components/signup_team.jsx @@ -12,11 +12,21 @@ export default class TeamSignUp extends React.Component { this.updatePage = this.updatePage.bind(this); - if (global.window.config.AllowSignUpWithEmail && global.window.config.AllowSignUpWithGitLab) { + var count = 0; + + if (global.window.config.AllowSignUpWithEmail === 'true') { + count = count + 1; + } + + if (global.window.config.AllowSignUpWithGitLab === 'true') { + count = count + 1; + } + + if (count > 1) { this.state = {page: 'choose'}; - } else if (global.window.config.AllowSignUpWithEmail) { + } else if (global.window.config.AllowSignUpWithEmail === 'true') { this.state = {page: 'email'}; - } else if (global.window.config.AllowSignUpWithGitLab) { + } else if (global.window.config.AllowSignUpWithGitLab === 'true') { this.state = {page: 'gitlab'}; } } diff --git a/web/react/components/signup_user_complete.jsx b/web/react/components/signup_user_complete.jsx index 08d5e2f48..5b1182938 100644 --- a/web/react/components/signup_user_complete.jsx +++ b/web/react/components/signup_user_complete.jsx @@ -162,7 +162,7 @@ export default class SignupUserComplete extends React.Component { ); var signupMessage = []; - if (global.window.config.AllowSignUpWithGitLab) { + if (global.window.config.AllowSignUpWithGitLab === 'true') { signupMessage.push(
diff --git a/web/react/components/team_signup_choose_auth.jsx b/web/react/components/team_signup_choose_auth.jsx index cfd45edb3..4aeae8f08 100644 --- a/web/react/components/team_signup_choose_auth.jsx +++ b/web/react/components/team_signup_choose_auth.jsx @@ -8,7 +8,7 @@ export default class ChooseAuthPage extends React.Component { } render() { var buttons = []; - if (global.window.config.AllowSignUpWithGitLab) { + if (global.window.config.AllowSignUpWithGitLab === 'true') { buttons.push( '; - if (!global.window.config.ShowEmailAddress) { + if (!global.window.config.ShowEmailAddress === 'true') { dataContent += '
Email not shared
'; } else { dataContent += '
'; diff --git a/web/react/components/user_settings_general.jsx b/web/react/components/user_settings_general.jsx index 895601bd2..cb60691a1 100644 --- a/web/react/components/user_settings_general.jsx +++ b/web/react/components/user_settings_general.jsx @@ -208,7 +208,7 @@ export default class UserSettingsGeneralTab extends React.Component { } setupInitialState(props) { var user = props.user; - var emailEnabled = !global.window.config.SendEmailNotifications; + var emailEnabled = global.window.config.SendEmailNotifications === 'true'; return {username: user.username, firstName: user.first_name, lastName: user.last_name, nickname: user.nickname, email: user.email, picture: null, loadingPicture: false, emailEnabled: emailEnabled}; } diff --git a/web/react/components/view_image.jsx b/web/react/components/view_image.jsx index f7c980396..a37eb6775 100644 --- a/web/react/components/view_image.jsx +++ b/web/react/components/view_image.jsx @@ -300,7 +300,7 @@ export default class ViewImageModal extends React.Component { } var publicLink = ''; - if (global.window.config.AllowPublicLink) { + if (global.window.config.AllowPublicLink === 'true') { publicLink = (