-
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
Update "Additional details" form in KYC wallet upgrade flow #6752
Conversation
add FormScrollView component to DRY things up Fix up Additional Details step in wallet flow undo bad change
|
||
const newErrors = lodashCloneDeep(errors); | ||
lodashUnset(newErrors, fieldName); | ||
Wallet.setAdditionalDetailsErrors(newErrors); |
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 thought about maybe taking the time to abstract some of the logic out of ReimbursementAccountUtils
to reuse here, but decided not to since this will all be replaced eventually by our new forms system whenever it is ready.
App/src/libs/ReimbursementAccountUtils.js
Lines 32 to 43 in 9f2b4f0
function clearError(props, path) { | |
const errors = getErrors(props); | |
if (!lodashGet(errors, path, false)) { | |
// No error found for this path | |
return; | |
} | |
// Clear the existing errors | |
const newErrors = lodashCloneDeep(errors); | |
lodashUnset(newErrors, path); | |
BankAccounts.setBankAccountFormValidationErrors(newErrors); | |
} |
I will create a follow up to address this if it looks like the forms project will take a long time.
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.
Code looks good to me! Had a couple basic comments to add
src/libs/actions/Wallet.js
Outdated
|
||
setAdditionalDetailsLoading(true); | ||
setAdditionalDetailsErrors(null); | ||
setAdditionalDetailsErrorMessage(); |
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.
Even though the default argument is set to ''
, I think it'd be clearer here to have setAdditionalDetailsErrorMessage('')
to make it more obvious that we are clearing the error message. Otherwise, I'm thinking that some other message is getting set.
Thoughts?
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.
Sure I can get behind that reasoning.
@@ -115,6 +115,9 @@ export default { | |||
// Stores information about additional details form entry | |||
WALLET_ADDITIONAL_DETAILS: 'walletAdditionalDetails', | |||
|
|||
// Stores values put into the additional details step of the wallet KYC flow | |||
WALLET_ADDITIONAL_DETAILS_DRAFT: 'walletAdditionalDetailsDraft', |
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.
A little bit confused by this key name, why DRAFT
over something like WALLET_ADDITIONAL_DETAILS_KYC
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.
Is it a DRAFT
because the user might not finish but will need to come back to it?
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 following the pattern we initially set up here:
Lines 133 to 134 in 1c80150
// Stores draft information about the active reimbursement account being set up | |
REIMBURSEMENT_ACCOUNT_DRAFT: 'reimbursementAccountDraft', |
And yeah they are drafts since if the user bails on the flow and returns later they can pick up where they left off.
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.
This hopefully will be a detail of all forms eventually but for now we have to store it somewhere.
// object with field names as keys and boolean for values | ||
const errorFields = _.reduce(response.data.fieldNames, (errors, fieldName) => ({ | ||
...errors, | ||
[fieldName]: 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 like the change to booleans for values, will keep this refactor in mind
onFixTheErrorsLinkPressed={() => { | ||
this.form.scrollTo({y: 0, animated: 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.
nice!
Updated! |
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
Triggered auto assignment to @marcaaron ( |
@nickmurray47 looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
This doesn't look right to me, going to remove the |
Ya I think this is a bug and this did pass all the tests. |
🚀 Deployed to staging by @nickmurray47 in version: 1.1.20-3 🚀
|
I tried to verify this to unblock the deploy checklist, but unfortunately I'm blocked by this bug in the Onfido flow for Android mWeb 😞 |
Ah thanks @Julesssss! I think we can check this off if everything else is working - nobody should be triggering the KYC flow in product yet and we're going to need to E2E test the entire flow on all platforms eventually. |
Ah that's great, thanks for confirming 👍 |
🚀 Deployed to production by @Julesssss in version: 1.1.21-1 🚀
|
Details
Improves the "Additional details" step of the KYC Wallet Upgrade flow so it behaves like the VBA.
Fixed Issues
$ https://github.com/Expensify/Expensify/issues/188531
Tests
QA Steps
Internal QA - perform tests above with a new account on the "Send Money" beta
Tested On
Screenshots
Web
Mobile Web
Desktop
iOS
Android