Skip to content
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 blank screen when showing the WorkspaceResetBankAccount modal #14726

Merged
merged 18 commits into from
Feb 13, 2023

Conversation

MariaHCD
Copy link
Contributor

@MariaHCD MariaHCD commented Feb 1, 2023

Details

Because we return the WorkspaceResentBankAccountModal here, we're inadvertently hiding the Continue with setup form leading to a blank screen. Similarly, we hide the EnableStep and ValidationStep components.

This PR ensure that the ContinueBankAccountSetup, EnableStep and ValidationStep are still visible when the WorkspaceResetBankAccount modal is shown.

Fixed Issues

$ #14692
$ #14566
PROPOSAL: NA

Tests

Bank account in setup

  1. Navigate to Workspace > Connect bank account
  2. Start the process of adding a VBA
  3. Exit the flow midway
  4. Navigate to Workspace > Connect bank account again
  5. Once you see Continue with setup, click Start over
  6. Verify the modal is shown and Continue with step is still shown in the background

Screenshot 2023-02-01 at 1 33 05 PM

  1. Verify that clicking Cancel or the confirm button in the modal works as expected

Verifying bank account

  1. Follow this SO to create a VERIFYING bank account. If you don't have access to the StackOverflow use the following details:
Select "Manually enter account details" and enter Routing number 011401533 and Account number 1111222233331111
Company Info - enter random info but complete all fields. You will fail once and get asked to double check information. Select "Save & Continue" again
Personal Info - use any test data. For last 4 SSN use 3333.
Onfido - add a test ID
Beneficial Owners:
- Toggle terms and conditions
- Toggle confirmation that the information provided is true and accurate
  1. Verify you see the ValidationStep
  2. Click No, start over and verify that the confirm modal is shown along with the ValidationStep in the background

Screenshot 2023-02-01 at 1 50 53 PM

  1. Verify that clicking Cancel or the confirm button in the modal works as expected

Open bank account

  1. Follow this SO to create an OPEN bank account. If you do not have access to the StackOverflow, follow the below steps:
Click "Log into your bank"
- Plaid modal - Choose Wells Fargo (use Bank of America if Wells Fargo is not available)
- Plaid modal - User Id: user_good
- Plaid modal - Password: pass_good
- Plaid modal - Submit
- Plaid modal - If they request a verification code via mobile sms, enter: credential_good when required
- Choose the Saving account: Plaid Saving11122XXXXXX111
- Save & Continue

Company Information (Enter the info below, and anything in non-specified fields):
- Legal Business Name: Alberta Bobbeth Charleson
- Company website: Enter any valid formatted website
- Tax ID number: 123456789
- Confirm company is not on list of restricted businesses

Requestor Information (Enter the info below, and anything in non-specified fields)
- First name: Alberta
- Second name: Charleson
- Toggle confirmation you are authorized to use company bank account
- Save & Continue (Note: You will receive an error asking to "Please verify you name and date of birth". Hit "Save & Continue" again without changing any inputs.)

Beneficial Owners
- Toggle terms and conditions
- Toggle confirmation that the information provided is true and accurate
  1. Verify that you see the EnableStep
  2. Click Disconnect bank account and verify that the confirm modal is shown along with the EnableStep in the background

Screenshot 2023-02-01 at 1 34 53 PM

  1. Verify that clicking Cancel or the confirm button in the modal works as expected

Offline tests

  1. Go offline on the Continue with setup page
  2. Verify that clicking Start over shows the confirmation modal and the background screen does not go blank
  3. Verify that clicking cancel dismisses the confirmation modal
  4. Verify that confirming the modal leads you to the BankAccount step

QA Steps

Same as test steps

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is correct English and approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Open.bank.account.webm
Verifying.bank.account.webm
Bank.account.in.setup.webm
Mobile Web - Chrome

Screenshot_20230201-144451

Screenshot_20230201-144432

Mobile Web - Safari

Simulator Screen Shot - iPhone 14 - 2023-02-01 at 14 43 30
Simulator Screen Shot - iPhone 14 - 2023-02-01 at 14 43 06

Desktop

Screenshot 2023-02-02 at 1 25 01 PM

Screenshot 2023-02-02 at 1 22 56 PM

iOS

Screenshot 2023-02-09 at 3 32 16 PM

Android

Screenshot 2023-02-09 at 3 46 26 PM

@MariaHCD MariaHCD self-assigned this Feb 1, 2023
…account-reset-fix

# Conflicts:
#	src/pages/ReimbursementAccount/ValidationStep.js
@MariaHCD MariaHCD marked this pull request as ready for review February 2, 2023 10:30
@MariaHCD MariaHCD requested a review from a team as a code owner February 2, 2023 10:30
@MariaHCD MariaHCD requested a review from nkuoch February 2, 2023 10:30
@melvin-bot melvin-bot bot requested review from ctkochan22 and rushatgabhane and removed request for a team February 2, 2023 10:31
@melvin-bot
Copy link

melvin-bot bot commented Feb 2, 2023

@rushatgabhane @ctkochan22 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]

BankAccounts.requestResetFreePlanBankAccount();
}}
/>
{this.props.reimbursementAccount.shouldShowResetModal && (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thoughts about putting this direcly within ContinueBankAccountSetup?

...withLocalizePropTypes,
};

const defaultProps = {
onConfirm: null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or you can default to () => {} and then no need for if (props.onConfirm) { below

@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 3, 2023

Updated!

One thing I noticed when testing (and I'm not sure what the cause is) but if you click start over and then quickly click Connect with Plaid or Connect manually, it takes you to the next page but then quickly reverts back to the previous page with the options:

1.New.Expensify.webm

@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 3, 2023

Ah, I think the above error is because the subStep is being overridden and set to null when resetFreePlanBankAccount completes

@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 3, 2023

Fixed it by adding isLoading to the Onyx data for RestartBankAccountSetup so we have a loading screen until the API command is complete:

1.New.Expensify.1.webm

@MariaHCD MariaHCD requested a review from nkuoch February 3, 2023 10:05
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: {isLoading: false},
},
]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing comma

@rushatgabhane
Copy link
Member

rushatgabhane commented Feb 3, 2023

@MariaHCD
@ctkochan22 is it just me or

Bug: iOS - blank screen

Steps

  1. On WEB - enter bank details manually and reach step 3 (personal info).
  2. Close the bank setup
  3. On iOS - go to connect bank account page
  4. You might see a blank screen here
  5. In case you don't see a blank screen, go back until you reach connect bank page.
  6. You'll see a blank screen here
Screen.Recording.2023-02-04.at.2.53.39.AM.mov

@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 6, 2023

Thanks for testing @rushatgabhane! Let me see if I can reproduce the issue.

@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 6, 2023

Okay, I can reproduce it too:

Looking into it but appreciate any ideas/suggestions for why this might be happening! Strange that it only happens on iOS. Let me also try Android native.

@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 6, 2023

Okay, I thought might've been due to the routing but both are the same on web and iOS:

Route on web:

{
    "key": "ReimbursementAccount-y-7304S1Zt9qyPemSVhr_",
    "name": "ReimbursementAccount",
    "path": "/bank-account/",
    "params": {
        "stepToOpen": "BankAccountStep"
    }
}

Route on iOS:

{
   "key":"ReimbursementAccount-5pIjiTW7wxxB8i2NwmGUP",
   "name":"ReimbursementAccount",
   "params":{
      "stepToOpen":"BankAccountStep"
   },
   "path":"/bank-account/"
}

But for some reason, the ContinueBankAccountSetup isn't showing on iOS. Will investigate further.

@rushatgabhane
Copy link
Member

rushatgabhane commented Feb 7, 2023

ohh, investigating

@MariaHCD MariaHCD dismissed stale reviews from ctkochan22 and nkuoch via bfc75e8 February 9, 2023 11:31
@MariaHCD
Copy link
Contributor Author

MariaHCD commented Feb 9, 2023

Okay, I'm not sure why but the blank screen on iOS was due to wrapping ContinueBankAccountSetup in <View>:

Screenshot 2023-02-09 at 3 31 04 PM

Removed the tags, re-tested and now it looks better:

Simulator.Screen.Recording.-.iPhone.14.-.2023-02-09.at.15.29.16.mp4

Copy link
Contributor

@ctkochan22 ctkochan22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm strange. The view must have been a remnant when there were more components in there.

@rushatgabhane if you can test today that would be amazing!

Copy link
Member

@rushatgabhane rushatgabhane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MariaHCD
Copy link
Contributor Author

Thanks, @rushatgabhane!

@MariaHCD MariaHCD merged commit 8dffdf8 into main Feb 13, 2023
@MariaHCD MariaHCD deleted the maria-workspace-bank-account-reset-fix branch February 13, 2023 13:10
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by https://github.com/MariaHCD in version: 1.2.71-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/francoisl in version: 1.2.71-1 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

{
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: ONYXKEYS.REIMBURSEMENT_ACCOUNT,
value: {isLoading: true},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a note for myself and reviewers, adding isLoading here caused this side effect: #15114

#15114 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants