From f7bc210f6eea0690853094236568093df01933c8 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 19 Jun 2015 09:42:46 -0700 Subject: Removed checking for first and last name in invite member form, should not be required even if they are allowed --- web/react/components/invite_member_modal.jsx | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'web') diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 1d2bbed84..8732219fa 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -28,20 +28,7 @@ module.exports = React.createClass({ if (config.AllowInviteNames) { invite.first_name = this.refs["first_name"+index].getDOMNode().value.trim(); - if (!invite.first_name ) { - first_name_errors[index] = "This is a required field"; - valid = false; - } else { - first_name_errors[index] = ""; - } - invite.last_name = this.refs["last_name"+index].getDOMNode().value.trim(); - if (!invite.last_name ) { - last_name_errors[index] = "This is a required field"; - valid = false; - } else { - last_name_errors[index] = ""; - } } invites.push(invite); @@ -114,8 +101,6 @@ module.exports = React.createClass({ for (var i = 0; i < invite_ids.length; i++) { var index = invite_ids[i]; var email_error = this.state.email_errors[index] ? : null; - var first_name_error = this.state.first_name_errors[index] ? : null; - var last_name_error = this.state.last_name_errors[index] ? : null; invite_sections[index] = (
@@ -129,15 +114,13 @@ module.exports = React.createClass({ { email_error }
{ config.AllowInviteNames ? -
+
- { first_name_error }
: "" } { config.AllowInviteNames ? -
+
- { last_name_error }
: "" }
-- cgit v1.2.3-1-g7c22 From e9d7844a9cd4675697a9729e6964ad6c1e8b43d9 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Fri, 19 Jun 2015 09:50:53 -0700 Subject: Readded error checking for for first and last names but made the requirement a config toggle instead of always required --- web/react/components/invite_member_modal.jsx | 21 +++++++++++++++++++-- web/static/config/config.js | 1 + 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'web') diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 8732219fa..0d7e5c3a1 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -28,7 +28,20 @@ module.exports = React.createClass({ if (config.AllowInviteNames) { invite.first_name = this.refs["first_name"+index].getDOMNode().value.trim(); + if (!invite.first_name && config.RequireInviteNames) { + first_name_errors[index] = "This is a required field"; + valid = false; + } else { + first_name_errors[index] = ""; + } + invite.last_name = this.refs["last_name"+index].getDOMNode().value.trim(); + if (!invite.last_name && config.RequireInviteNames) { + last_name_errors[index] = "This is a required field"; + valid = false; + } else { + last_name_errors[index] = ""; + } } invites.push(invite); @@ -101,6 +114,8 @@ module.exports = React.createClass({ for (var i = 0; i < invite_ids.length; i++) { var index = invite_ids[i]; var email_error = this.state.email_errors[index] ? : null; + var first_name_error = this.state.first_name_errors[index] ? : null; + var last_name_error = this.state.last_name_errors[index] ? : null; invite_sections[index] = (
@@ -114,13 +129,15 @@ module.exports = React.createClass({ { email_error }
{ config.AllowInviteNames ? -
+
+ { first_name_error }
: "" } { config.AllowInviteNames ? -
+
+ { last_name_error }
: "" }
diff --git a/web/static/config/config.js b/web/static/config/config.js index 82d4bbf70..45c713da2 100644 --- a/web/static/config/config.js +++ b/web/static/config/config.js @@ -13,6 +13,7 @@ var config = { // Feature switches AllowPublicLink: true, AllowInviteNames: true, + RequireInviteNames: false, AllowSignupDomainsWizard: false, // Privacy switches -- cgit v1.2.3-1-g7c22