Commit 716f3d7d authored by Saturnino Abril's avatar Saturnino Abril Committed by Joram Wilander

[PLT-7578] Fix broken UI for expired email invite link (#55)

* fix broken UI for expired email invite link

* remove "Create an account with:" and "Already have an account?" lines
parent 561b93b3
......@@ -3,6 +3,7 @@
import LoadingScreen from './loading_screen.jsx';
import BackButton from 'components/common/back_button.jsx';
import logoImage from 'images/logo.png';
import {verifyEmail} from 'actions/user_actions.jsx';
......@@ -20,6 +21,7 @@ export default class DoVerifyEmail extends React.Component {
serverError: ''
};
}
componentWillMount() {
verifyEmail(
this.props.location.query.token,
......@@ -27,37 +29,56 @@ export default class DoVerifyEmail extends React.Component {
browserHistory.push('/login?extra=verified&email=' + encodeURIComponent(this.props.location.query.email));
},
(err) => {
this.setState({verifyStatus: 'failure', serverError: err.message});
let serverError;
if (err) {
serverError = (
<FormattedMessage
id='signup_user_completed.invalid_invite'
defaultMessage='The invite link was invalid. Please speak with your Administrator to receive an invitation.'
/>
);
}
this.setState({
verifyStatus: 'failure',
serverError
});
}
);
}
render() {
if (this.state.verifyStatus !== 'failure') {
return (<LoadingScreen/>);
}
let serverError = null;
if (this.state.serverError) {
serverError = (
<div className={'form-group has-error'}>
<label className='control-label'>{this.state.serverError}</label>
</div>
);
}
return (
<div>
<BackButton/>
<div className='col-sm-12'>
<div className='signup-team__container'>
<h3>
<FormattedMessage
id='email_verify.almost'
defaultMessage='{siteName}: You are almost done'
values={{
siteName: global.window.mm_config.SiteName
}}
/>
</h3>
<div>
<p>
<FormattedMessage id='email_verify.verifyFailed'/>
</p>
<p className='alert alert-danger'>
<i className='fa fa-times'/>
{this.state.serverError}
</p>
<img
className='signup-team-logo'
src={logoImage}
/>
<div className='signup__content'>
<h1>{global.window.mm_config.SiteName}</h1>
<h4 className='color--light'>
<FormattedMessage
id='web.root.signup_info'
defaultMessage='All team communication in one place, searchable and accessible anywhere'
/>
</h4>
{serverError}
</div>
</div>
</div>
......@@ -67,7 +88,9 @@ export default class DoVerifyEmail extends React.Component {
}
DoVerifyEmail.defaultProps = {
location: {}
};
DoVerifyEmail.propTypes = {
location: PropTypes.object.isRequired
};
......@@ -1464,7 +1464,6 @@
"email_verify.sent": " Verification email sent.",
"email_verify.verified": "{siteName} Email Verified",
"email_verify.verifiedBody": "<p>Your email has been verified! Click <a href={url}>here</a> to log in.</p>",
"email_verify.verifyFailed": "Failed to verify your email.",
"emoji_list.actions": "Actions",
"emoji_list.add": "Add Custom Emoji",
"emoji_list.creator": "Creator",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment