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

Store account validated state and display error early on VBA flow #5524

Merged
merged 6 commits into from
Sep 27, 2021

Conversation

robertjchen
Copy link
Contributor

@robertjchen robertjchen commented Sep 25, 2021

Thanks for the review! In addition to API-level preventions, we need to add a friendly message early on in the VBA flow to inform users that they must validate their account in order to proceed. Let's add the message to the Add bank account menu and disable the options there 👍

screenie

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/178698
Ref https://github.com/Expensify/Expensify/issues/177017

Tests / QA

  1. Sign up with new account on OldDot
  2. Select "Get Started" in WelcomeUser inbox task
  3. Get directed to NewDot
  4. Click "Get Started" in the new workspace modal and the "Add bank account" modal will pop up
  5. Witness that both options are disabled and an error message is shown
  6. Validate the account email and go through the steps again to ensure that the options are enabled and the error message is no longer shown.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

2021-09-24_17-18-45 (1)

Mobile Web

Desktop

iOS

Android

@robertjchen robertjchen requested a review from a team as a code owner September 25, 2021 00:32
@robertjchen robertjchen self-assigned this Sep 25, 2021
@MelvinBot MelvinBot requested review from Gonals and removed request for a team September 25, 2021 00:32
@robertjchen robertjchen removed the request for review from Gonals September 25, 2021 00:39
@robertjchen robertjchen force-pushed the robert-vbaUnvalidatedError branch from cf86a26 to 6111cd9 Compare September 25, 2021 00:48
@shawnborton
Copy link
Contributor

For accessibility purposes, do we need to do more than just change the color of the label? Perhaps we need to consider the cursor, or some way to denote that this "button" is disabled in the code?

@robertjchen
Copy link
Contributor Author

@shawnborton Ah, great point! Looks like they added "aria-disabled" support for Pressable components in React Native back in February (which we use for our MenuItems). Updated the PR with the accessibility tweak 👍

@robertjchen robertjchen requested a review from a team September 27, 2021 23:24
@MelvinBot MelvinBot requested review from luacmartins and removed request for a team September 27, 2021 23:25
@github-actions
Copy link
Contributor

⚠️ ⚠️ Heads up! This pull request has the CP Staging label. ⚠️ ⚠️
Merging it will cause it to be immediately deployed to staging, even if the open StagingDeployCash deploy checklist is locked.

Copy link
Contributor

@luacmartins luacmartins left a 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!

@luacmartins luacmartins merged commit 5ddc191 into main Sep 27, 2021
@luacmartins luacmartins deleted the robert-vbaUnvalidatedError branch September 27, 2021 23:38
github-actions bot pushed a commit that referenced this pull request Sep 27, 2021
Store account validated state and display error early on VBA flow

(cherry picked from commit 5ddc191)
@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by @luacmartins in version: 1.1.2-7 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@isagoico
Copy link

@robertjchen hello! We're cureently blocked from testing this PR. Our domain accounts already have the Expensify card so we're not able to access the Get Started button in workspace.

@robertjchen
Copy link
Contributor Author

robertjchen commented Sep 28, 2021

@isagoico We were able to test this flow ourselves after it went out, so I think we can check this off the deploy checklist 👍

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @timszot in version: 1.1.2-7 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @luacmartins in version: 1.1.2-9 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @timszot in version: 1.1.3-1 🚀

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

onPress={() => setBankAccountSubStep(CONST.BANK_ACCOUNT.SETUP_TYPE.MANUAL)}
shouldShowRightIcon
/>
{!this.props.user.validated && (
Copy link
Contributor

Choose a reason for hiding this comment

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

👋 I'm not sure if this was true at the time of creation of this PR, but this might have caused an issue in #18156
This is an edge case, which can be reproduced only if you clear cookies and site data and then sign in again

Before the API call to get user info is completed,this.props.user.validated is undefined, which causes validateAccountError to display for a split second while API call is in progress
We resolved this by displaying a loading indicator while the API call is in progress, but that didn't exist when this PR was created, so {this.props.user.validated === false && ( would have avoided this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wow, great catch and that makes sense 🤯

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.

6 participants