From f0a7b845b880bd7b322ba6cf2ade1ebcbe7dc396 Mon Sep 17 00:00:00 2001 From: stevepodell Date: Mon, 3 Mar 2025 16:39:49 -0800 Subject: [PATCH] The race conditions and hanging tab (which was due to a strange bug if you use a html form tag without a submit in React). Uses viewerAccessRights to determine admin like rights. There is a new "Create Account for Someone Else" button for users with admin like rights, that allows them to create a person, but not verify their emails. When that new user logs in with the credentials that they were sent, they will have to verify their email at that time. There might be some edge cases, but it is ready to go. --- src/js/pages/SystemSettings/PermissionsAdministration.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/pages/SystemSettings/PermissionsAdministration.jsx b/src/js/pages/SystemSettings/PermissionsAdministration.jsx index 3a6e721..84bf67b 100644 --- a/src/js/pages/SystemSettings/PermissionsAdministration.jsx +++ b/src/js/pages/SystemSettings/PermissionsAdministration.jsx @@ -72,7 +72,7 @@ const PermissionsAdministration = ({ classes }) => { const cancelClicked = (event) => { const pieces = event.target.id.split('-'); const personId = parseInt(pieces[2]); - const activePerson = peopleWorkingArray.find((p) => p.id === personId); + const activePerson = peopleWorkingArray.find((p) => parseInt(p.id) === personId); const personCached = Object.values(allPeopleCache).find((p) => p.id === personId); Object.assign(activePerson, personCached); setButtonState(SET.DISABLE, personId); @@ -81,8 +81,8 @@ const PermissionsAdministration = ({ classes }) => { const saveClicked = (event) => { const personId = parseInt(event.target.id.split('-')[2]); - const activePerson = peopleWorkingArray.find((p) => p.id === personId); - const personCached = Object.values(allPeopleCache).find((p) => p.id === personId); + const activePerson = peopleWorkingArray.find((p) => parseInt(p.id) === personId); + const personCached = Object.values(allPeopleCache).find((p) => parseInt(p.id) === personId); const data = {}; Object.keys(activePerson).forEach((key) => { @@ -110,7 +110,7 @@ const PermissionsAdministration = ({ classes }) => { if (canEditPermissionsAnyone) { const pieces = event.target.id.split('-'); const personId = parseInt(pieces[2]); - const person = peopleWorkingArray.find((p) => p.id === personId); + const person = peopleWorkingArray.find((p) => parseInt(p.id) === personId); switch (pieces[1]) { case 'admin': person.isAdmin = event.target.checked;