From 66425c97e49615111448aa24e31225dfa3b51cda Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Wed, 17 Jun 2015 18:37:28 -0700 Subject: [PATCH 1/3] Added ability to remove the first entry of a Invite New Members list (or clear it if there's only one entry --- web/react/components/invite_member_modal.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 1d2bbed84d..a1b8da6e45 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -90,10 +90,12 @@ module.exports = React.createClass({ this.setState({ invite_ids: invite_ids, id_count: count }); }, removeInviteFields: function(index) { + var count = this.state.id_count; var invite_ids = this.state.invite_ids; var i = invite_ids.indexOf(index); - if (index > -1) invite_ids.splice(i, 1); - this.setState({ invite_ids: invite_ids }); + if (i > -1) invite_ids.splice(i, 1); + if (!invite_ids.length) invite_ids.push(++count); + this.setState({ invite_ids: invite_ids, id_count: count }); }, getInitialState: function() { return { @@ -119,7 +121,7 @@ module.exports = React.createClass({ invite_sections[index] = (
- { i ? + { true ?
From 4e8e00e94fbe7ed07025b7d8906a3cd9209b687f Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Thu, 18 Jun 2015 17:15:21 -0700 Subject: [PATCH 2/3] Fixed ability to be able to delete a specific invite field within the invite new member form instead of just removing the bottom one every time --- web/react/components/invite_member_modal.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index a1b8da6e45..2ab43d2a0c 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -123,7 +123,7 @@ module.exports = React.createClass({
{ true ?
- +
: ""}
From c94d6a1c00f42f132736528b036e6c96507a83df Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Thu, 18 Jun 2015 17:16:59 -0700 Subject: [PATCH 3/3] Removed extraneous conditional --- web/react/components/invite_member_modal.jsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/react/components/invite_member_modal.jsx b/web/react/components/invite_member_modal.jsx index 2ab43d2a0c..b5b1e31289 100644 --- a/web/react/components/invite_member_modal.jsx +++ b/web/react/components/invite_member_modal.jsx @@ -121,11 +121,9 @@ module.exports = React.createClass({ invite_sections[index] = (
- { true ?
- : ""}
{ email_error }