Display multiple error messages simultaneously#15745
Conversation
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@neil-marcellini @mollfpr One of you needs to 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] |
ArekChr
left a comment
There was a problem hiding this comment.
Overall, I have reviewed the code and have no issues to report. LGTM
70e844f to
10b8c45
Compare
10b8c45 to
b02301e
Compare
|
@fedirjh good points, thank you! Already did the updates, leaving discussions unresolved for now for better visibility |
|
Well done @TMisiukiewicz! The codes look good! I’ll test it this morning. And thank you @fedirjh for the review 👍 |
neil-marcellini
left a comment
There was a problem hiding this comment.
Let's make some changes to the approach so that less changes are required overall.
|
cc @luacmartins if you want to review since this is related to forms. |
luacmartins
left a comment
There was a problem hiding this comment.
I agree with @neil-marcellini here. I think that we should keep the errors object empty if there are no errors. Additionally, I think that we should create strings with line breaks for rendering errorText
c23cac7 to
53e46f5
Compare
neil-marcellini
left a comment
There was a problem hiding this comment.
Awesome, this is looking much cleaner now. Great work!
@luacmartins brought up a really good point that we should go one step further and set the error passed to the Form under inputID to a string with line breaks, if needed. I think we can modify addErrorMessage to do that and it will keep things even more consistent with the prop types.
0bb0d37 to
18c1829
Compare
|
applied the changes, you can review it again ✅ |
neil-marcellini
left a comment
There was a problem hiding this comment.
Good to go from me!
18c1829 to
e773908
Compare
|
@neil-marcellini thanks for spotting trailing space, removed that, seems like re-approval from your side is needed |
|
@mollfpr you're the C+ here right? Would you please give another review and fill out the checklist. Then we'll be good to merge 🚀 |
|
@neil-marcellini Sure! I'll complete this now! |
Reviewer Checklist
Screenshots/VideosWeb15745.Web.movMobile Web - Chrome15745.mWeb.Chrome.movMobile Web - Safari15745.mWeb.Safari.mp4Desktop15745.Desktop.moviOS15745.iOS.mp4Android15745.Android.mov |
mollfpr
left a comment
There was a problem hiding this comment.
Well done @TMisiukiewicz 👍
LGTM @neil-marcellini 🚀
luacmartins
left a comment
There was a problem hiding this comment.
LGTM and it's much simpler. Thanks for working on this!
|
✋ 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.2.84-0 🚀
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 1.2.84-0 🚀
|
|
@ayazhussain79 I have closed that issue since it's the intended behavior |
|
Ok sir |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.2.84-1 🚀
|
Details
This Pull Request introduces showing multiple error messages simultaneously for a single input. Before, if the input value had multiple validators and more than one of failed, it displayed only the last error based on the order in the code.
Fixed Issues
$ #15156
PROPOSAL: #15156 (comment)
Tests
Expensify,,Offline tests
n/a
QA Steps
Expensify,,PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)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
Web
WEB.mov
Mobile Web - Chrome
ANDROID.WEB.mov
Mobile Web - Safari
IOS.WEB.mov
Desktop
DESKTOP.mov
iOS
IOS.mov
Android
ANDROID.mov