diff --git a/web/react/components/signup_team_complete.jsx b/web/react/components/signup_team_complete.jsx index 3f35a59125..238385a0b4 100644 --- a/web/react/components/signup_team_complete.jsx +++ b/web/react/components/signup_team_complete.jsx @@ -428,23 +428,27 @@ SendInivtesPage = React.createClass({ e.preventDefault(); var valid = true; - var emails = []; - for (var i = 0; i < this.props.state.invites.length; i++) { - if (!this.refs['email_' + i].validate(this.props.state.team.email)) { - valid = false; - } else { - emails.push(this.refs['email_' + i].getValue()); + if (this.state.emailEnabled) { + var emails = []; + + for (var i = 0; i < this.props.state.invites.length; i++) { + if (!this.refs['email_' + i].validate(this.props.state.team.email)) { + valid = false; + } else { + emails.push(this.refs['email_' + i].getValue()); + } + } + + if (valid) { + this.props.state.invites = emails; } } - if (!valid) { - return; + if (valid) { + this.props.state.wizard = "username"; + this.props.updateParent(this.props.state); } - - this.props.state.wizard = "username"; - this.props.state.invites = emails; - this.props.updateParent(this.props.state); }, submitAddInvite: function (e) { e.preventDefault(); @@ -461,22 +465,43 @@ SendInivtesPage = React.createClass({ this.props.updateParent(this.props.state); }, getInitialState: function() { - return { }; + return { + emailEnabled: client.isEmailEnabledSynchronous() + }; }, render: function() { - client.track('signup', 'signup_team_05_send_invites'); var name_error = this.state.name_error ? : null; - var emails = []; + var content = null; + var bottomContent = null; - for (var i = 0; i < this.props.state.invites.length; i++) { - if (i == 0) { - emails.push(); - } else { - emails.push(); + if (this.state.emailEnabled) { + var emails = []; + + for (var i = 0; i < this.props.state.invites.length; i++) { + if (i == 0) { + emails.push(); + } else { + emails.push(); + } } + + content = ( +
+ {emails} + +
+ ); + + bottomContent = ( +

{"if you prefer, you can invite " + strings.Team + " members later"}
and skip this step for now.

+ ); + } else { + content = ( +
Email is currently disabled for your team, and emails cannot be sent. Contact your system administrator to enable email and email invitations.
+ ); } return ( @@ -484,11 +509,10 @@ SendInivtesPage = React.createClass({

{"Invite " + utils.toTitleCase(strings.Team) + " Members"}

- { emails } - + {content}
-

{"if you prefer, you can invite " + strings.Team + " members later"}
and skip this step for now.

+ {bottomContent}
Back to previous step