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

Add VBA flow Part 1 #3459

Merged
merged 27 commits into from
Jun 11, 2021
Merged

Add VBA flow Part 1 #3459

merged 27 commits into from
Jun 11, 2021

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Jun 9, 2021

Details

Adds the Verified Bank Account flow to E.cash

For this PR I am just cleaning things up a bit and laying down some scaffolding. We will:

  • Create a new route /bank-account/new for adding the VBA
  • Extract the Plaid logic we need from the PBA flow so it can be used in both views
  • Add the view for manually adding a bank account

We will not be hooking up to any APIs just yet...

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/166041

Tests

  1. Navigate to /bank-account/new
  2. Verify the add method selection options are shown
  3. Select manual
  4. Verify you can only press the button when valid account number + routing number are entered
  5. Select Log Into Bank
  6. Verify the Plaid widget appears
  7. Enter chase bank info user_good pass_good + Continue
  8. Verify the options are shown in a Picker
  9. Select an option and enter password
  10. Repeat Plaid steps for /add-personal-bank-account route and verify the selection screen appears + an account can be added (confirm via Web-Expensify).

Note: Testing on native/desktop is tricky atm but can be done by using a deep link for native and/or putting the navigate() method on window like this:

diff --git a/src/libs/Navigation/Navigation.js b/src/libs/Navigation/Navigation.js
index 7fe26fcf3..0abf6ddee 100644
--- a/src/libs/Navigation/Navigation.js
+++ b/src/libs/Navigation/Navigation.js
@@ -66,6 +66,8 @@ function navigate(route = ROUTES.HOME) {
     linkTo(navigationRef.current, route);
 }

+window.ecashNavigate = navigate;
+
 /**
  * Dismisses a screen presented modally and returns us back to the previous view.
  *

then calling window.ecashNavigate('/bank-account/new') from console / native debugger session

QA Steps

No QA - We will test the entire flow together at the end

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

2021-06-09_13-12-28
2021-06-09_13-12-32
2021-06-09_13-12-44
2021-06-09_13-12-59
2021-06-09_13-13-10
2021-06-09_13-13-16
2021-06-09_13-13-20
2021-06-09_13-13-26
2021-06-09_13-13-30

Mobile Web

2021-06-09_13-17-13
2021-06-09_13-17-17
2021-06-09_13-24-35
2021-06-09_13-24-49
2021-06-09_13-24-59
2021-06-09_13-25-07
2021-06-09_13-25-33
2021-06-09_13-25-33
2021-06-09_13-25-37
2021-06-09_13-25-41
2021-06-09_13-25-52

Desktop

2021-06-09_14-35-45
2021-06-09_14-35-56
2021-06-09_14-36-15
2021-06-09_14-36-21
2021-06-09_14-37-08

iOS

2021-06-09_13-28-40
2021-06-09_13-28-53
2021-06-09_13-29-08
2021-06-09_13-29-14
2021-06-09_13-29-19
2021-06-09_13-29-29
2021-06-09_13-32-51
2021-06-09_13-36-42

Android

2021-06-09_13-56-04
2021-06-09_13-57-34
2021-06-09_13-57-56
2021-06-09_13-58-40
2021-06-09_13-59-17
2021-06-09_13-59-17
2021-06-09_13-59-23
2021-06-09_13-59-41

@marcaaron marcaaron self-assigned this Jun 9, 2021
@marcaaron marcaaron changed the title [WIP] Add VBA flow [WIP] Add VBA flow Part 1 Jun 9, 2021
{!_.isEmpty(this.props.text) && (
<Text style={[styles.mb5]}>{this.props.text}</Text>
)}
{/* @TODO there are a bunch of logos to incorporate here to replace this name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created an issue here to follow up on this eventually https://github.com/Expensify/Expensify/issues/166782

src/languages/en.js Outdated Show resolved Hide resolved
}

canSubmitManually() {
// @TODO add better validation
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm thinking at least check for a 9 digit routing number + that both are all numbers? I'll look at how web-secure is handling this.

}

addManualAccount() {
// @TODO call API to add account manually
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do in the next PR.

@marcaaron marcaaron changed the title [WIP] Add VBA flow Part 1 [HOLD] Add VBA flow Part 1 Jun 9, 2021
@marcaaron
Copy link
Contributor Author

marcaaron commented Jun 9, 2021

Still waiting on some assets but this should be ready for an initial review. assets added

@marcaaron marcaaron marked this pull request as ready for review June 9, 2021 22:43
@marcaaron marcaaron requested a review from a team as a code owner June 9, 2021 22:43
@marcaaron marcaaron changed the title [HOLD] Add VBA flow Part 1 Add VBA flow Part 1 Jun 9, 2021
Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Sorry, just a preliminary review for now. Didn't have time to finish this right now.

src/pages/BusinessBankAccount/NewPage.js Outdated Show resolved Hide resolved
src/ROUTES.js Show resolved Hide resolved
src/components/TextLink.js Outdated Show resolved Hide resolved
src/components/AddPlaidBankAccount.js Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Outdated Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Outdated Show resolved Hide resolved
};

const CheckboxWithLabel = ({
LabelComponent, isChecked, onPress, style,
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB, Should be moved to separate lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure we enforce this so if eslint doesn't mind I don't mind 😄

@marcaaron
Copy link
Contributor Author

This is ready for review.

Copy link
Contributor

@roryabraham roryabraham left a comment

Choose a reason for hiding this comment

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

Also NAB but if you wanted to Checkbox and CheckboxWithLabel would probably be good candidates to include in storybook

src/pages/BusinessBankAccount/NewPage.js Show resolved Hide resolved
src/components/AddPlaidBankAccount.js Outdated Show resolved Hide resolved
src/components/AddPlaidBankAccount.js Show resolved Hide resolved
src/components/AddPlaidBankAccount.js Show resolved Hide resolved
src/components/AddPlaidBankAccount.js Show resolved Hide resolved
src/components/CheckboxWithLabel.js Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Outdated Show resolved Hide resolved
src/pages/BusinessBankAccount/NewPage.js Outdated Show resolved Hide resolved
src/pages/EnablePayments/TermsStep.js Outdated Show resolved Hide resolved
style={styles.mb4}
isChecked={this.state.hasAcceptedDisclosure}
onPress={this.toggleDisclosure}
LabelComponent={() => (
<Text>
{`${this.props.translate('termsStep.haveReadAndAgree')} `}

<TextLink href="https://use.expensify.com/fees">
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it's safe to put a Pressable inside a Text, but I don't think you're supposed to.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can (and should) be un-nested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I'm not entirely sure either. But this flow isn't being used yet so if it's broken because of this. We'll find out eventually 😂

@marcaaron
Copy link
Contributor Author

Thanks for the review @roryabraham !

Also NAB but if you wanted to Checkbox and CheckboxWithLabel would probably be good candidates to include in storybook

Fixed up a few things but I'm going to create a follow up issue for this one and a few others you've mentioned. Great stuff overall.

errorText: '',
};

const TextInputWithLabel = props => (
<>
<Text style={[styles.formLabel]}>{props.label}</Text>
{!_.isEmpty(props.label) && <Text style={[styles.formLabel]}>{props.label}</Text>}
Copy link
Contributor

Choose a reason for hiding this comment

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

NAB: Why are we making props.label optional? Seems strange to make a label optional on a component called TextInputWithLabel. I also don't see you using the errorText prop anywhere where you're using TextInputWithLabel without the label prop, so I'm wondering if this change is necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorta answered this in the other comment. But this component is likely going to change in the future when we apply some standardization to TextInputs across the app as it's kind of a mess. But we gotta keep rolling.

style={[styles.exampleCheckImage, styles.mb5]}
source={exampleCheckImage}
/>
<TextInputWithLabel
Copy link
Contributor

Choose a reason for hiding this comment

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

Followup of my comment from earlier, can't you just use vanilla TextInputs here? I'm probably missing something.

Copy link
Contributor Author

@marcaaron marcaaron Jun 11, 2021

Choose a reason for hiding this comment

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

I think this decision will make more sense once...

  1. We add error handling + take advantage of the errorText (this is just a scaffolding step)
  2. all the inputs get refactored and we use TextInputWithLabel as a base to build off of to create the text inputs that @shawnborton would prefer we build out eventually.

@@ -78,48 +71,42 @@ class TermsStep extends React.Component {
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Copy link
Contributor

Choose a reason for hiding this comment

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

wat, this is definitely a placeholder I assume

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah it is

@marcaaron
Copy link
Contributor Author

@MonilBhavsar gonna move forward with this one but lemme know if you have any additional comments :)

@marcaaron marcaaron merged commit 157db96 into main Jun 11, 2021
@marcaaron marcaaron deleted the marcaaron-addBusinessBankAccountPage branch June 11, 2021 01:44
@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.

@MonilBhavsar
Copy link
Contributor

MonilBhavsar commented Jun 11, 2021

Thanks! looks good and tests well for me considering the scope of the PR

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging in version: 1.0.68-0🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.68-4🚀

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

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

Successfully merging this pull request may close these issues.

5 participants