From e0bc9ac50fbc9a444fd4573bcfe0c20858b488dc Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Sun, 18 Oct 2020 04:31:54 -0400 Subject: [PATCH] Duplicate save/invite button at top Adds the Save / Invite User button at the top also --- .../server/users/EditSubuserModal.tsx | 71 +++++++++++-------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/resources/scripts/components/server/users/EditSubuserModal.tsx b/resources/scripts/components/server/users/EditSubuserModal.tsx index d81d15f08..117869703 100644 --- a/resources/scripts/components/server/users/EditSubuserModal.tsx +++ b/resources/scripts/components/server/users/EditSubuserModal.tsx @@ -41,7 +41,7 @@ const PermissionLabel = styled.label` ${tw`border-neutral-500 bg-neutral-800`}; } } - + &:not(:first-of-type) { ${tw`mt-4 sm:mt-2`}; } @@ -90,11 +90,11 @@ const PermissionTitledBox = memo(({ isEditable, permission, permissions, classNa

{permission}

{isEditable && - values.permissions.includes(p))} - onChange={onCheckboxClicked} - /> + values.permissions.includes(p))} + onChange={onCheckboxClicked} + /> }
} @@ -132,30 +132,39 @@ const EditSubuserModal = forwardRef(({ subuser, ...pr return ( -

- {subuser ? - `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` - : - 'Create new subuser' - } -

- - {(!user.rootAdmin && loggedInPermissions[0] !== '*') && -
-

- Only permissions which your account is currently assigned may be selected when creating or - modifying other users. -

+
+
+

+ {subuser ? + `${canEditUser ? 'Modify' : 'View'} permissions for ${subuser.email}` + : + 'Create new subuser ' + } +

+
+
+ +
+ + {(!user.rootAdmin && loggedInPermissions[0] !== '*') && +
+

+ Only permissions which your account is currently assigned may be selected when creating or + modifying other users. +

+
} {!subuser && -
- -
+
+ +
}
{Object.keys(permissions).filter(key => key !== 'websocket').map((key, index) => { @@ -190,9 +199,9 @@ const EditSubuserModal = forwardRef(({ subuser, ...pr
{permissions[key].keys[pkey].length > 0 && -

- {permissions[key].keys[pkey]} -

+

+ {permissions[key].keys[pkey]} +

}
@@ -258,7 +267,7 @@ export default ({ subuser, ...props }: Props) => { })} >
- + );