-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Refactor] Form validation translated error #20228
[Refactor] Form validation translated error #20228
Conversation
@fedirjh let me know when this is ready for review |
Web TestsIOS TestsmWeb Safari TestsAndroid TestsmWeb Chrome TestsDesktop Tests |
… of different TaskTitle forms
…methods of different Personal details forms
… of different TaskTitle forms
…methods of different Personal details forms
…ements' into Form-validation-translate-enhancements # Conflicts: # src/pages/settings/Profile/PersonalDetails/AddressPage.js
e4ddba0
to
bbbca31
Compare
Translate is done twice only for concatenated errors (multiline errors) generated by |
One minor thing:
Reserved room name : e.g |
Reviewer Checklist
Screenshots/VideosWebPersonal Details web-3.movMobile Web - ChromeManual Bank Account mchrome-8.movmchrome-8.2.movMobile Web - SafariTask Title msafari-2.movDesktopSecondary Contact, Security, Debit Card desktop4-6.moviOSWorkspace Room Name ios-1.movios-1.2.movAndroidWorkspace android-7.mov |
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.
Tested all possible cases.
@luacmartins all yours!
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.
Oops! I thought you applied my suggestion
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. @fedirjh we have conflicts
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! @stitesExpensify all yours
Gonna merge to avoid more conflicts since we are touching 34 files. |
✋ 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/luacmartins in version: 1.3.28-0 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.28-5 🚀
|
cc @luacmartins
Details
This pr is a follow-up to the previous changes made in PR #19324 and PR #20093. While those PRs introduced initial updates to improve error handling by implementing key-based error storage, it was identified that there are still remaining form validation methods that require updates to align with the new mechanism.
The purpose of this follow-up PR is to comprehensively cover all form validation methods and ensure they return the error key rather than the translated string. By doing so, we aim to achieve consistent and streamlined error handling across the entire application, eliminating any remnants of the old translation-based approach.
Fixed Issues
$ #20472
#20093
#20093 (comment)
Tests
Test 1 : Workspace Room Name
admins
TestName
. Room names can only include lowercase letters, numbers and hyphensTest 2 : Task Title
Please enter a title
Please enter a title
Test 3 : Personal Details
Concierge;,
and verify both errors are displayedTest 4 : Secondary Contact
Test 5 : Security
Test 6 : Debit Card
Test 7 : Workspace
You need to define a name for your workspace.
Please enter a valid rate
Test 8 : Manual Bank Account
Company information
stepPersonal information
stepOffline 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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android