-
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 and refactor VBBA setup flow #13236
Conversation
Hey, I noticed you changed some webpack configuration files. This can break production builds. Did you remember to run a production build locally to verify they still work? |
945fc23
to
6f042c2
Compare
b3dca8b
to
d7b5176
Compare
95e827b
to
52974c0
Compare
Allow to go back from offline view Fix and refactor startOver modal Refactor getDefaultStateForField so people dont think reimbursementAccountDraft is not used
✋ 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/ctkochan22 in version: 1.2.58-0 🚀
|
@nkuoch seems this PR causing the deploy blocker issue as in the diff --git a/src/libs/actions/BankAccounts.js b/src/libs/actions/BankAccounts.js
index b6aea981e..11fe41607 100644
--- a/src/libs/actions/BankAccounts.js
+++ b/src/libs/actions/BankAccounts.js
@@ -7,6 +7,7 @@ import DateUtils from '../DateUtils';
import * as PlaidDataProps from '../../pages/ReimbursementAccount/plaidDataPropTypes';
import Navigation from '../Navigation/Navigation';
import ROUTES from '../../ROUTES';
+import * as ReimbursementAccount from './ReimbursementAccount';
export {
goToWithdrawalAccountSetupStep,
@@ -38,7 +39,7 @@ function clearPlaid() {
}
function openPlaidView() {
- clearPlaid().then(() => this.setBankAccountSubStep(CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID));
+ clearPlaid().then(() => ReimbursementAccount.setBankAccountSubStep(CONST.BANK_ACCOUNT.SETUP_TYPE.PLAID));
} |
🚀 Deployed to production by https://github.com/chiragsalian in version: 1.2.58-4 🚀
|
@nkuoch Are we supposed to be able to edit the company name and tax ID once we've saved them once and advanced to the |
I confirm we're not supposed to be able to edit them once we've reached the requestor step. |
Oh weird. I can't reproduce it anymore either 🤔 Anyways, thanks for confirming! |
Nvm, I can still reproduce on main/staging/prod on iOS/android |
if (this.props.reimbursementAccount.shouldShowResetModal && Boolean(achData.bankAccountID)) { | ||
return ( | ||
<WorkspaceResetBankAccountModal reimbursementAccount={this.props.reimbursementAccount} /> | ||
); | ||
} |
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.
Just as an FYI, this caused #14692
We missed testing for the Start over
feature in this PR so we didn't notice that there was a blank screen behind the confirmation modal.
👋 Hi, we've identified this PR as 1/2 of the cause of #14972. The logic in function getDefaultStateForField(reimbursementAccountDraft, reimbursementAccount, fieldName, defaultValue = '') {
return lodashGet(reimbursementAccountDraft, fieldName)
|| lodashGet(reimbursementAccount, ['achData', fieldName], defaultValue);
} In this case, this could've been avoided by doing some more robust testing to ensure that the default state value matched what we were expecting in a variety of scenarios. We've got a proposed regression test here that should cover this scenario 🙌 |
@@ -93,7 +98,10 @@ class AddPersonalBankAccountPage extends React.Component { | |||
description={this.props.translate('addPersonalBankAccountPage.successMessage')} | |||
shouldShowButton | |||
buttonText={this.props.translate('common.continue')} | |||
onButtonPress={() => Navigation.navigate(ROUTES.SETTINGS_PAYMENTS)} | |||
onButtonPress={() => { | |||
BankAccounts.clearPersonalBankAccount(); |
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.
Clearing this early cause a regression #15202
I am tagging this PR to highlight an issue fixed here. All conditions in ternary expressions or left-hand operands on conditional renders, should be boolean. This PR is one of the PRs that uses conditional render with string operands, hence I am tagging it here for the contributors to check. We've also updated the item in the checklist with this PR to avoid this issue in the future. |
case CONST.BANK_ACCOUNT.STEP.VALIDATION: | ||
if (_.contains([BankAccount.STATE.VERIFYING, BankAccount.STATE.SETUP], achData.state)) { | ||
BankAccounts.goToWithdrawalAccountSetupStep(CONST.BANK_ACCOUNT.STEP.ACH_CONTRACT); | ||
} else if (achData.state === BankAccount.STATE.PENDING) { |
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.
We did not take into account the user being offline while adding this condition. This caused #21837 to come up later.
onSelected: () => { | ||
BankAccounts.clearPlaid(); |
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.
Coming from #32906, this change caused a regression, after this change the plaid token is not cleared.
Details
Refactoring and fixing different issues in the vbba setup flow:
eslint-disable-next-line react/no-unused-prop-types
and other engineers thinking they can remove them because unused.Fixed Issues
$ #13166
$ #12708
$ https://github.com/Expensify/Expensify/issues/245747
$ #11777
$ #12123
$ #13598
$ #13911
$ https://github.com/Expensify/Expensify/issues/231253
$ https://github.com/Expensify/Expensify/issues/236672
$ https://github.com/Expensify/Expensify/issues/217507
$ #14157
Tests
To be tested with Web PR: https://github.com/Expensify/Web-Expensify/pull/35797
Same as in QA Steps
Offline steps
Included in QA Steps
QA Steps
Just complete the VBBA setup flow with random data and doing this:
click on the left arrow from the right panel for each step (to test the "back" behavior)
Note: after resubmitting the requestor step, you shouldn't see Onfido again unless you modify your name
Make sure you can also add a personal bank account
No console error should appear
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesWaiting 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)Screenshots/Videos
Web
See screenshots from QA Steps
Mobile Web
vbbaIOSSafari.mp4
Desktop
Test start back & back from each step
2023-01-17_11-43-06.mp4
Test start over
remove.mp4
Test changing Plaid bank account
2023-01-17_11-58-50.mp4
Test adding a personal bank account
2023-01-17_12-01-54.mp4
iOS
Test back from each step
TestAllTheWayBackFromOnfidoAndContinue.mp4
TestBackFromBenefStepAndOpen.mp4
Android
Offline Plaid: https://recordit.co/TR5KrMlOto
Backwards works for BankAccountStep: https://recordit.co/0Shseu59kF
Backwards from Requestor Step and Onfido: https://recordit.co/ldlH7Wugkp
Beneficial Owners: https://recordit.co/VnmIixo3QR