From b8a9b9c9ac4e57fb3ea7f4af492454a41b895195 Mon Sep 17 00:00:00 2001 From: Bogdan Cochior <bogdan.cochior@thinslices.com> Date: Fri, 14 Sep 2018 15:43:32 +0300 Subject: [PATCH] fix(heInvite): hide actions if HE is Unassigned --- .../src/PersonInvitation.js | 73 ++++++++++--------- .../src/components/Admin/utils.js | 2 +- 2 files changed, 38 insertions(+), 37 deletions(-) diff --git a/packages/component-faraday-ui/src/PersonInvitation.js b/packages/component-faraday-ui/src/PersonInvitation.js index 5199bdce0..563573c38 100644 --- a/packages/component-faraday-ui/src/PersonInvitation.js +++ b/packages/component-faraday-ui/src/PersonInvitation.js @@ -14,42 +14,43 @@ const PersonInvitation = ({ }) => ( <Root {...rest}> <Text>{name}</Text> - {!hasAnswer && ( - <Fragment> - <OpenModal - isFetching={isFetching} - onConfirm={resendInvitation} - title="Are you sure you want to resend the invitation?" - > - {showModal => ( - <IconButton - icon="refresh-cw" - iconSize={2} - ml={2} - onClick={showModal} - secondary - /> - )} - </OpenModal> - <OpenModal - confirmText="Remove invite" - isFetching={isFetching} - onConfirm={revokeInvitation} - subtitle="Clicking ‘Remove’ will allow you to invite a different Handling Editor" - title="Remove invitation to Handling Editor?" - > - {showModal => ( - <IconButton - icon="x-circle" - iconSize={2} - ml={2} - onClick={showModal} - secondary - /> - )} - </OpenModal> - </Fragment> - )} + {!hasAnswer && + name !== 'Unassigned' && ( + <Fragment> + <OpenModal + isFetching={isFetching} + onConfirm={resendInvitation} + title="Are you sure you want to resend the invitation?" + > + {showModal => ( + <IconButton + icon="refresh-cw" + iconSize={2} + ml={2} + onClick={showModal} + secondary + /> + )} + </OpenModal> + <OpenModal + confirmText="Remove invite" + isFetching={isFetching} + onConfirm={revokeInvitation} + subtitle="Clicking ‘Remove’ will allow you to invite a different Handling Editor" + title="Remove invitation to Handling Editor?" + > + {showModal => ( + <IconButton + icon="x-circle" + iconSize={2} + ml={2} + onClick={showModal} + secondary + /> + )} + </OpenModal> + </Fragment> + )} </Root> ) diff --git a/packages/components-faraday/src/components/Admin/utils.js b/packages/components-faraday/src/components/Admin/utils.js index 1c91cb462..bbea0fd90 100644 --- a/packages/components-faraday/src/components/Admin/utils.js +++ b/packages/components-faraday/src/components/Admin/utils.js @@ -9,7 +9,7 @@ const generatePasswordHash = () => ).join('') export const setAdmin = values => { - const newValues = { ...values } + const newValues = { ...values, isActive: true } if (newValues.roles && newValues.roles.includes('admin')) { newValues.admin = true } else { -- GitLab