From 37909f52ad4f9cca9ffecd008956912b4a6cf5c7 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Tue, 11 Aug 2015 15:48:07 -0400 Subject: Disabled the invite members dialog when email is disabled on the server --- web/react/components/invite_member_modal.jsx | 65 +++++++++++++++++++++++----- 1 file changed, 55 insertions(+), 10 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 3eca79bae..fb3d46b0a 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -35,6 +35,10 @@ module.exports = React.createClass({ }); }, handleSubmit: function(e) { + if (!this.state.emailEnabled) { + return; + } + var inviteIds = this.state.inviteIds; var count = inviteIds.length; var invites = []; @@ -147,12 +151,18 @@ module.exports = React.createClass({ idCount: 0, emailErrors: {}, firstNameErrors: {}, - lastNameErrors: {} + lastNameErrors: {}, + emailEnabled: Client.isEmailEnabledSynchronous() }; }, render: function() { var currentUser = UserStore.getCurrentUser(); + var inputDisabled = ''; + if (!this.state.emailEnabled) { + inputDisabled = 'disabled'; + } + if (currentUser != null) { var inviteSections = []; var inviteIds = this.state.inviteIds; @@ -195,13 +205,13 @@ module.exports = React.createClass({ nameFields = (
- + {firstNameError}
- + {lastNameError}
@@ -212,7 +222,7 @@ module.exports = React.createClass({
{removeButton}
- + {emailError}
{nameFields} @@ -225,6 +235,45 @@ module.exports = React.createClass({ serverError =
; } + var content = null; + var sendButton = null; + if (this.state.emailEnabled) { + content = ( +
+ {serverError} + +
+
+ People invited automatically join Town Square channel. +
+ ); + + sendButton = + } else { + var teamInviteLink = null; + if (currentUser && this.props.teamType === 'O') { + var linkUrl = utils.getWindowLocationOrigin() + '/signup_user_complete/?id=' + currentUser.team_id; + var link = Team Invite Link; + + teamInviteLink = ( +

+ You can also invite people using the {link}. +

+ ); + } + + content = ( +
+

Email is currently disabled for your team, and email invitations cannot be sent. Contact your system administrator to enable email and email invitations.

+ {teamInviteLink} +
+ ); + } + return (
- + {sendButton}
-- cgit v1.2.3-1-g7c22