-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: Large legal name are not saved and no error message is displayed #29740
Conversation
src/CONST.ts
Outdated
@@ -75,7 +75,7 @@ const CONST = { | |||
OLD_DEFAULT_AVATAR_COUNT: 8, | |||
|
|||
DISPLAY_NAME: { | |||
MAX_LENGTH: 50, | |||
MAX_LENGTH: 40, |
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.
@dukenv0307 CONST.DISPLAY_NAME.MAX_LENGTH
is used in multiple places, this change will affect other validations, I think it's best to fix this in the backend Or we have to create a new const.
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.
I just created a new CONST for this.
Reviewer Checklist
Screenshots/Videos |
@@ -56,12 +56,16 @@ function LegalNamePage(props) { | |||
errors.legalFirstName = 'privatePersonalDetails.error.hasInvalidCharacter'; | |||
} else if (_.isEmpty(values.legalFirstName)) { | |||
errors.legalFirstName = 'common.error.fieldRequired'; | |||
} else if (values.legalFirstName.length > CONST.DISPLAY_NAME.MAX_LENGTH) { |
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.
When more than one method is used to validate the value, the
addErrorMessage
function fromErrorUtils
should be used
Let's use ErrorUtils.addErrorMessage
, more context in FORMS.md
For instance, check the video, both errors should be displayed at the same time :
CleanShot.2023-10-18.at.19.32.14.mp4
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.
Updated
@fedirjh Friendly bump. Can you help review the PR again |
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.
LGTM
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.
cool lgtm as well!
✋ 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/srikarparsi in version: 1.3.88-0 🚀
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.3.88-11 🚀
|
Details
The app should not allow to save and display error when we enter an invalid name
Fixed Issues
$ #19821
PROPOSAL: #19821 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Screen.Recording.2023-10-19.at.11.15.47.mp4
Android: mWeb Chrome
Screen.Recording.2023-10-19.at.11.19.00.mov
iOS: Native
Screen.Recording.2023-10-19.at.11.03.20.mov
iOS: mWeb Safari
Screen.Recording.2023-10-19.at.11.04.23.mov
MacOS: Chrome / Safari
web.8.mp4
MacOS: Desktop
Screen.Recording.2023-10-19.at.11.22.53.mov