diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-12-09 09:20:40 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-12-09 09:20:40 -0500 |
commit | d9766cf6913a3597f5bf1c2a44e0e5982a3acff9 (patch) | |
tree | 810512fb64375a6244a899779145e19672f34fa2 /web | |
parent | 0b960e4a0be253bf10efe94f3b74455d31d486ec (diff) | |
parent | 0c09cec7d9e433db1fd21071fae5c90c1f1fa493 (diff) | |
download | chat-d9766cf6913a3597f5bf1c2a44e0e5982a3acff9.tar.gz chat-d9766cf6913a3597f5bf1c2a44e0e5982a3acff9.tar.bz2 chat-d9766cf6913a3597f5bf1c2a44e0e5982a3acff9.zip |
Merge pull request #1657 from mattermost/plt-1410
PLT-1410 Fix email error not showing up on team signup page
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/team_signup_with_email.jsx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/web/react/components/team_signup_with_email.jsx b/web/react/components/team_signup_with_email.jsx index 06d6e3934..4150a0013 100644 --- a/web/react/components/team_signup_with_email.jsx +++ b/web/react/components/team_signup_with_email.jsx @@ -14,18 +14,19 @@ export default class EmailSignUpPage extends React.Component { } handleSubmit(e) { e.preventDefault(); - var team = {}; - var state = {serverError: ''}; + const team = {}; + const state = {serverError: null}; + let isValid = true; team.email = ReactDOM.findDOMNode(this.refs.email).value.trim().toLowerCase(); if (!team.email || !Utils.isEmail(team.email)) { state.emailError = 'Please enter a valid email address'; - state.inValid = true; + isValid = false; } else { - state.emailError = ''; + state.emailError = null; } - if (state.inValid) { + if (!isValid) { this.setState(state); return; } @@ -45,11 +46,16 @@ export default class EmailSignUpPage extends React.Component { ); } render() { - var serverError = null; + let serverError = null; if (this.state.serverError) { serverError = <div className='form-group has-error'><label className='control-label'>{this.state.serverError}</label></div>; } + let emailError = null; + if (this.state.emailError) { + emailError = <div className='form-group has-error'><label className='control-label'>{this.state.emailError}</label></div>; + } + return ( <form role='form' @@ -65,6 +71,7 @@ export default class EmailSignUpPage extends React.Component { maxLength='128' spellCheck='false' /> + {emailError} </div> <div className='form-group'> <button |