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

Fixed address clear detected & modified the state #5954

Merged
merged 5 commits into from
Oct 22, 2021

Conversation

Santhosh-Sellavel
Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel commented Oct 19, 2021

@stitesExpensify

Details

If the address was cleared in VBA Company step but address states was not cleared technically, updated the code that will clear the address states when the address is modified.

Fixed Issues

$ #5920

Tests & QA Steps

  1. Go to https://staging.new.expensify.com
  2. Log in with expensifail account
  3. Go to Workspace and Click on Connect Bank account
  4. Log in with Chase credentials
  5. In the company info page select any autofill address and clear the address
  6. Fill in rest of the fields and hit save and continue
  7. Will show error now.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

DESKTOP.mov

iOS

iOS_01.mp4

Android

@Santhosh-Sellavel Santhosh-Sellavel requested a review from a team as a code owner October 19, 2021 23:24
@MelvinBot MelvinBot requested review from danieldoglas and removed request for a team October 19, 2021 23:24
@Santhosh-Sellavel
Copy link
Collaborator Author

@stitesExpensify had made some additional changes apart from the proposed changes. To ensure everything works well.

Adding onChangeText: () => saveLocationDetails({}), this alone creates few unexpected behaviour
resets saved address while reloading the page going back to previous step coming back to current step.

@roryabraham
Copy link
Contributor

Something weird happened here and I think @stitesExpensify should've been assigned as a reviewer here because he's the CME on the linked issue. Also since this fixes a deploy blocker I'm assigning the CP Staging label.

@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.

onChangeText: (text) => {
// Ensure whether an address is selected already has address value initialized.
if (!_.isEmpty(googlePlacesRef.current.getAddressText())) {
if (_.isEmpty(text) || !_.isEqual(text, props.value)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I'm confused why we're clearing the value if text is not the same as props.value. Can you help me understand?

Also NAB because this is personal preference, but I'm not a fan of the nested if statements – I think something like this would be slightly clearer:

const isTextValid = !_.isEmpty(text) && _.isEqual(text, props.value);
if (!_.isEmpty(googlePlacesRef.current.getAddressText()) && !isTextValid) {
    saveLocationDetails({});
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm confused why we're clearing the value if text is not the same as props.value. Can you help me understand?

Because it text will change whenever you modify the address input & props.value will update only if the address is selected in the autocomplete list.

Yes, it makes sense I'll update the suggested changes here.

@Santhosh-Sellavel
Copy link
Collaborator Author

Santhosh-Sellavel commented Oct 20, 2021

@roryabraham it happened to couple more times, when @stitesExpensify was CME, his account was not getting assigned as reviewer.

@roryabraham
Copy link
Contributor

Retrying E2E tests for ya

@Santhosh-Sellavel
Copy link
Collaborator Author

It's failing for all recently updated PRs. @roryabraham

@roryabraham
Copy link
Contributor

Agree it's probably unrelated

@stitesExpensify
Copy link
Contributor

Something weird happened here and I think @stitesExpensify should've been assigned as a reviewer here because he's the CME on the linked issue. Also since this fixes a deploy blocker I'm assigning the CP Staging label.

Probably because I'm not on the contributor management team technically?

@roryabraham
Copy link
Contributor

Probably because I'm not on the contributor management team technically?

Join us 🙃

@stitesExpensify
Copy link
Contributor

@Santhosh-Sellavel can you pull main and push it up to fix e2e tests?

@Santhosh-Sellavel
Copy link
Collaborator Author

Santhosh-Sellavel commented Oct 21, 2021

@stitesExpensify if possible can you restart the iOS Tests again? I already merged once from the main. In my other PRs also, I faced the same issue it is fixed now.

@Santhosh-Sellavel
Copy link
Collaborator Author

Merged again now let's wait and check thanks!

@stitesExpensify
Copy link
Contributor

Looks like it passed! CC: @roryabraham

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.

Tested well on web:

image

@roryabraham roryabraham merged commit f5cff3f into Expensify:main Oct 22, 2021
@roryabraham
Copy link
Contributor

Verified on staging web:

image

@isagoico
Copy link

isagoico commented Oct 22, 2021

Testing this atm on the following environments:

  • Android
  • Desktop
  • iOS
  • mWeb

@OSBotify
Copy link
Contributor

🚀 Cherry-picked to staging by @roryabraham in version: 1.1.8-9 🚀

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

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

@roryabraham
Copy link
Contributor

Passed QA on iOS:

IMG_BCDB69FAA5C8-1

@roryabraham
Copy link
Contributor

Passed QA on desktop:

image

@roryabraham
Copy link
Contributor

QA passed on iOS Safari:

IMG_81AFDAB2F584-1

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.8-9 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @roryabraham in version: 1.1.8-10 🚀

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

@roryabraham
Copy link
Contributor

Something weird happened here – This was CP'd to staging in version 1.1.8-9 (and we verified it there). But for some reason that deploy comment didn't land on this PR. Then it says it was deployed to staging in 1.1.8-10, which I think is a symptom of this issue.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @roryabraham in version: 1.1.10-2 🚀

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.

None yet

5 participants