Skip to content

Commit

Permalink
The race conditions and hanging tab (which was due to a strange bug i…
Browse files Browse the repository at this point in the history
…f 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.
  • Loading branch information
SailingSteve committed Mar 4, 2025
1 parent 46a68e2 commit f0a7b84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/pages/SystemSettings/PermissionsAdministration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) => {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f0a7b84

Please sign in to comment.