fix: username field is not populated by exact input#145
Open
MusaleTejas wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #145 +/- ##
==========================================
- Coverage 6.81% 6.78% -0.04%
- Complexity 601 604 +3
==========================================
Files 20 20
Lines 3036 3050 +14
==========================================
Hits 207 207
- Misses 2829 2843 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR resolves the issue where the username field on the OneAccess dashboard does not display the exact username/login of the user, falling back instead to the prefix of their email address (
email.split('@')[0]).To address this, we now synchronize and store the actual WordPress
user_logininside thesites_infoJSON database field for each site, retrieve it during REST queries, and display the exact username in the frontend interface.Changes
inc/Modules/Rest/Actions_Controller.php): Includedusernameinprepare_user_dataand sanitized it insanitize_user_data.inc/Modules/Core/DB.php): Added support forusernameinsidesites_infoJSON during user insertion, updates, and manually mapped users.inc/Modules/Rest/Governing_Site_Controller.php): Extracted the exact username fromsites_infoand exposed it at the user level in theget_usersAPI response.assets/src/components/SharedUsers.tsx): UpdatedSharedUserinterface and transformed the API response mapping to renderuser.username(with the email split as a fallback for legacy records).