-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: validate legal name #66171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: validate legal name #66171
Conversation
|
@shubham1206agra Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/Videos |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/techievivek in version: 9.1.83-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.1.83-5 🚀
|
| } else if (!isValidLegalName(values.legalFirstName)) { | ||
| addErrorMessage(errors, 'legalFirstName', translate('privatePersonalDetails.error.hasInvalidCharacter')); | ||
| } else if (values.legalFirstName.length > CONST.LEGAL_NAME.MAX_LENGTH) { | ||
| addErrorMessage( | ||
| errors, | ||
| 'legalFirstName', | ||
| translate('common.error.characterLimitExceedCounter', {length: values.legalFirstName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}), | ||
| ); | ||
| } | ||
| if (doesContainReservedWord(values.legalFirstName, CONST.DISPLAY_NAME.RESERVED_NAMES)) { | ||
| addErrorMessage(errors, 'legalFirstName', translate('personalDetails.error.containsReservedWord')); | ||
| } | ||
| } | ||
|
|
||
| if (typeof values.legalLastName === 'string') { | ||
| if (!values.legalLastName) { | ||
| errors.legalLastName = translate('common.error.fieldRequired'); | ||
| } else if (!isValidLegalName(values.legalLastName)) { | ||
| addErrorMessage(errors, 'legalLastName', translate('privatePersonalDetails.error.hasInvalidCharacter')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We finally decided that the legal name can be anything but multiple spaces. We ended up removing these validations in
#76842






Explanation of Change
Fixed Issues
$ #65223
PROPOSAL: #65223 (comment)
Tests
Verify that: An error is shown.
Offline tests
QA Steps
Verify that: An error is shown.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-07-15.at.22.20.16.mov
Android: mWeb Chrome
Screen.Recording.2025-07-15.at.22.20.42.mov
iOS: Native
Screen.Recording.2025-07-15.at.22.20.59.mov
iOS: mWeb Safari
Screen.Recording.2025-07-15.at.22.21.28.mov
MacOS: Chrome / Safari
Screen.Recording.2025-07-15.at.22.21.51.mov
MacOS: Desktop
Screen.Recording.2025-07-15.at.22.22.12.mov