-
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
Highlight all errors in VBA flow - Personal information and Additional information steps #5259
Conversation
Pending:
App/src/libs/ValidationUtils.js Lines 103 to 113 in 0f4abe1
Maybe the
|
@marcaaron , before continuing further, can I have your thoughts on this:
|
That feels kind of like we are moving backwards and will have to change a lot to make it all consistent. It might be something we could consider for the design doc we are planning, but not something I'd probably not implement in this PR. Rather than store the error text could we have the input handle multiple error keys somehow? |
Yes, I would say is possible without too much effort and uglyness, it is just one field that has this problem. I'll change them to boolean again and handle |
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 know this is still in draft but just ran through to leave some comments since I took a look.
Handle multiple errors for Date of birth with multiple keys.
Nice catch, since the feature is not being broadly promoted yet, I maybe would suggest creating a new issue for this and continuing to focus on solving the multiple errors issue. |
@flodnv 's PR removed the error message "Requestors must be over 18 years old" I'm introducing it again because of this slack comment, but changing the "requestor" wording. |
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 and tests well. Great work!
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.
Changes look good. There is just one place that needs to be addressed. The rest of my notes are NAB.
return {beneficialOwners}; | ||
}); | ||
if (inputKey === 'dob') { | ||
this.clearError(`beneficialOwnersErrors.${ownerIndex}.dobAge`); |
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.
NAB, I think this is OK for now. But we're going to have to figure out a better way to handle individual fields with multiple possible errors in the future.
|
||
if (inputKey === 'dob') { | ||
this.clearError('dobAge'); | ||
} |
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.
NAB, I think this logic could benefit from some brief documentation explaining that dob
is unique from other fields as there are two kinds of validation happening.
Probably eventually we could have something like dob_invalid
and dob_minimumAge
where the front part indicates the fieldName
and the next part indicates which error. Or move to a structure like
errors: {
identity: {
dob: {
invalid: true,
minimumAge: true,
}
}
}
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'm leaving the same comment on each part we do something with 'dob' related to multiple errors/validations
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 like this structure 😬
errors: {
identity: {
dob: {
invalid: true,
minimumAge: true,
}
}
}
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.
+1 this looks like a good way of handling the multiple errors
Testing now and everything looks good except "First name" "Last name" and "Personal address" fields on the beneficial owners step look to be not required when a form is submitted without any info? I'm not sure that's right. I think we need this information? But it would be good to have someone from ops verify. |
I think we should just go ahead and add a |
We can also do this in a follow up. |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Asked in #ops, Katie also thinks this should be required information. |
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 and tests well! Thanks @aldo-expensify!
🚀 Deployed to staging by @marcaaron in version: 1.1.4-1 🚀
|
🚀 Deployed to production by @chiragsalian in version: 1.1.5-1 🚀
|
Details
Changes:
isValidIdentity
becamevalidateIdentity
, which returns an object with the errors.errors
in reimbursementAccountPropTypes to accommodate beneficial owners errors in "Additional information Step (/bank-account/contract)"Fixed Issues
$ #4785
We are working in this issue step by step. This PR updates the error handling specifically for the company information step in the VBA flow.
Tests AND QA Steps
Setup
Personal Information Step
Click "Save & continue" before filling anything, all fields are mandatory and all of them should have inline errors:![Screen Shot 2021-09-30 at 1 35 02 PM](https://user-images.githubusercontent.com/87341702/135526511-ebd4d6e3-2002-45e7-bcfc-457c514e7f82.png)
Start filling the different fields. Each field's inline errors should disappear as soon as they are changed. Use
Alberta
as first name andCharleson
as last name.Choose as "Date of birth" a recent date, example:
2021-10-10
Click "Save & continue". The "Date of birth" should have the error "Requestors must be over 18 years old"![Screen Shot 2021-09-30 at 1 38 04 PM](https://user-images.githubusercontent.com/87341702/135526809-4f439521-0320-4a60-8077-b6c2e9057543.png)
Choose as "Date of birth" a date older than 18 years, example:
2000-10-10
Click "Save & continue". If all fields pass the validation, we should get to the "Additional information" step (/bank-account/contract)
Additional information Step (beneficial owners)
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android