From 11b22c6a029a8ead122eb36aa815dc0d0942b20e Mon Sep 17 00:00:00 2001 From: stevepodell Date: Tue, 4 Mar 2025 09:34:10 -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/utils/utilities.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/js/utils/utilities.js diff --git a/src/js/utils/utilities.js b/src/js/utils/utilities.js new file mode 100644 index 0000000..1f6ac3c --- /dev/null +++ b/src/js/utils/utilities.js @@ -0,0 +1,7 @@ +// eslint-disable-next-line import/prefer-default-export +export const alphabetizePeoplesObject = (obj) => { + const arrayOfObjects = Object.keys(obj).map((key) => ({ ...obj[key], id: key })); + arrayOfObjects.sort((a, b) => (a.lastName + a.firstName).localeCompare(b.lastName + b.firstName)); + return arrayOfObjects; +}; +