-
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
[HOLD for payment 2023-06-01] [$1000] The Home Address State/Province field is autofilled with the country for UK addresses #18674
Comments
Triggered auto assignment to @kadiealexander ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to ensure that State/Province field is filled with a state or province, rather than a country. What is the root cause of that problem?The administrative_area_level_1 param that we're currently using from addressComponents to fill out the State/Province field is actually the country (England, Wales, Scotland, etc.) for UK addresses. According to Google's docs, administrative_area_level_1 is only really "guaranteed" to be a state for US addresses. What changes do you think we should make in order to solve the problem?For UK addresses, we should use administrative_area_level_2 instead. So we need to pull it in here, maybe calling it stateFallback: App/src/components/AddressSearch/index.js Lines 109 to 130 in 2bdeca5
Making sure in the getAddressComponents call that we pull in the long_name as we are not using the state picker for non-US addresses. So we'll get something like: const { street_number: streetNumber, route: streetName, subpremise, locality, sublocality, postal_town: postalTown, postal_code: zipCode, administrative_area_level_1: state, administrative_area_level_2: stateFallback, country, } = GooglePlacesUtils.getAddressComponents(addressComponents, { street_number: 'long_name', route: 'long_name', subpremise: 'long_name', locality: 'long_name', sublocality: 'long_name', postal_town: 'long_name', postal_code: 'long_name', administrative_area_level_1: 'short_name', administrative_area_level_2: 'long_name', country: 'short_name', }); Then we use the field to override the state for UK addresses only, which can go after this: App/src/components/AddressSearch/index.js Lines 163 to 167 in 2bdeca5
// UK addresses return the country (e.g. England) in the state field we use for other countries if (country === 'GB') { values.state = stateFallback; } Test addressesNon-US addresses where administrative_area_level_1 IS the state/province:
|
@kavimuru could you please tag the person who submitted the proposal in the post? |
Job added to Upwork: https://www.upwork.com/jobs/~0101458ae8ee232f2f |
Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
Triggered auto assignment to @MonilBhavsar ( |
@kadiealexander That one's mine (see here). I'm going to repost as it looks like some of the formatting went wonky! |
ProposalPlease re-state the problem that we are trying to solve in this issue.We want to ensure that State/Province field is filled with a state or province, rather than a country. What is the root cause of that problem?The What changes do you think we should make in order to solve the problem?For UK addresses, we should use App/src/components/AddressSearch/index.js Lines 109 to 130 in 2bdeca5
Making sure in the
Then we use the field to override the state for UK addresses only, which can go after this: App/src/components/AddressSearch/index.js Lines 163 to 167 in 2bdeca5
Test addressesNon-US addresses where
UK addresses where
|
We discussed in the bug report slack thread, and the expected behavior is - For UK addresses, we won't display country(England/Wales/Scotland/Northern Ireland) in state/province field, instead get the real state/province from google API cc @mollfpr |
Sorry for the delay! I'll start reviewing the proposals! |
@MonilBhavsar checked the @jjcoffee proposal, and it works well. We can go with their proposal!. 🎀 👀 🎀 C+ reviewed! |
Looks good to me too 👍 |
📣 @jjcoffee You have been assigned to this job by @MonilBhavsar! |
@MonilBhavsar @mollfpr PR is ready! |
@mollfpr, @jjcoffee, @MonilBhavsar, @kadiealexander Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Chill Melv - we're just waiting for production deploy |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.17-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-06-01. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
No offending PR. This is an edge case and improvement for UK addresses.
Regression should be enough.
Indeed.
Propose regression step
|
@kadiealexander Accepted, thanks! Also just to note that the reporting bonus is also due for me. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
State/Province field should only be populated with a state or county
Actual Result:
State/Province field is populated with a country
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.12.0
Reproducible in staging?: y
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by: @jjcoffee
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1683624757070259
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: