Closed Bug 1474905 Opened 6 years ago Closed 5 years ago

Use a dropdown for the state/province field, where possible

Categories

(Toolkit :: Form Autofill, defect, P1)

63 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla66
Tracking Status
firefox66 --- verified

People

(Reporter: hyacoub, Assigned: jaws)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webpayments])

User Story

If we have the list of available regions/provinces/states from our address data, we should display a dropdown instead of a text field.

We need to handle:
* autofill (trying to) save a value that isn't one of the options.
* countries where we don't have the list of regions

Attachments

(2 files)

[Affected versions]: 
Nightly 63.0a1

[Affected platforms]:
Platforms: Windows 10 x 64, Mac OS X 10.12 and Ubuntu 16.04 x64.

[Steps to reproduce]:
1. In about:config set the pref dom.payments.request.enabled to "true".
2. Go to "https://rsolomakhin.github.io/pr/us/" page and click on "Buy".
3. For FTU flow add shipping address and payment method information by filling all the required fields correctly and make sure state is California and click on "Save".
4. Or in case you have already saved addresses or payment methods.
5. From "Payment method" page click on "add" under "Shipping option" section and fill all the required fields correctly and make sure state is California and click on "Save".

[Expected result]:
"$0.00 Free shipping in California" should be displayed under shipping option ones the state address is California.

[Actual result]:
Adding an address from California isn't reflected on the shipping option.
Under shipping option "$5.00 Standard shipping in US" is displayed instead of "$0.00 Free shipping in California".
Whiteboard: [webpayments] [triage]
Priority: -- → P2
Whiteboard: [webpayments] [triage] → [webpayments]
Did you have the value "California" in the state field or "CA"? I think you have "California" and that's the issue since we need to return "CA". Can you confirm the problem doesn't happen with a state of "CA"
Flags: needinfo?(hani.yacoub)
Yes, I did have the value "California" in the state field. I changed it to "CA" and now it's not reproducible. 
I'll change the status to Invalid.
Status: NEW → RESOLVED
Closed: 6 years ago
Flags: needinfo?(hani.yacoub)
Resolution: --- → INVALID
Priority: P2 → --
Whiteboard: [webpayments]
We can use this bug to track converting to a dropdown for the state/province field.
Status: RESOLVED → REOPENED
User Story: (updated)
Priority: -- → P3
Resolution: INVALID → ---
Summary: Adding an address from California isn't reflected on the shipping option → Use a dropdown for the state/province field, where possible
Whiteboard: [webpayments-reserve]
Status: REOPENED → NEW
This should use the sub_keys and sub_names properties in addressReferences.js to build the dropdown. The sub_keys will be used for the regionCode and sub_names will be used for the region.
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Priority: P3 → P1
Flags: qe-verify?
Whiteboard: [webpayments-reserve] → [webpayments]
Component: WebPayments UI → Form Autofill
Flags: qe-verify? → qe-verify+
Product: Firefox → Toolkit
QA Contact: hani.yacoub
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c4d1729c029e
Use a dropdown for the state/province field when possible. r=MattN
Backed out for browser chrome failures on browser_editCreditCardDialog.js

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=c4d1729c029e2c17058c0f093fe9cc0037be0e51&tochange=9e64208641b85674cde06b89592f5ef273a0b02e&searchStr=browser%2Cchrome&group_state=expanded&selectedJob=217078854

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=217078854&repo=autoland&lineNumber=4927

Backout link: https://hg.mozilla.org/integration/autoland/rev/9e64208641b85674cde06b89592f5ef273a0b02e

[task 2018-12-14T19:35:26.079Z] 19:35:26     INFO - TEST-PASS | browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js | cc-number field should be showing invalid credit card number - 
[task 2018-12-14T19:35:26.080Z] 19:35:26     INFO - Buffered messages finished
[task 2018-12-14T19:35:26.082Z] 19:35:26     INFO - TEST-UNEXPECTED-FAIL | browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js | save button should be disabled due to invalid credit card number - 
[task 2018-12-14T19:35:26.082Z] 19:35:26     INFO - Stack trace:
[task 2018-12-14T19:35:26.083Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:test_ok:1292
[task 2018-12-14T19:35:26.083Z] 19:35:26     INFO - chrome://mochitests/content/browser/browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js:test_editInvalidCreditCardNumber/<:281
[task 2018-12-14T19:35:26.084Z] 19:35:26     INFO - chrome://mochitests/content/browser/browser/extensions/formautofill/test/browser/head.js:testDialog:361
[task 2018-12-14T19:35:26.084Z] 19:35:26     INFO - chrome://mochitests/content/browser/browser/extensions/formautofill/test/browser/browser_editCreditCardDialog.js:test_editInvalidCreditCardNumber:277
[task 2018-12-14T19:35:26.084Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1093
[task 2018-12-14T19:35:26.085Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1084
[task 2018-12-14T19:35:26.086Z] 19:35:26     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:982
[task 2018-12-14T19:35:26.087Z] 19:35:26     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:803
Flags: needinfo?(jaws)
Flags: needinfo?(jaws)
https://hg.mozilla.org/mozilla-central/rev/8d084837f5ee
https://hg.mozilla.org/mozilla-central/rev/99ce4343e015
Status: ASSIGNED → RESOLVED
Closed: 6 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66

I confirm that "state/province" field are displayed, where possible (ex. US, CA and AU).
Verified as fixed on Firefox Nightly 66.0a1 on Windows 10 x 64, Mac OS X 10.13 and on Ubuntu 16.04 x64.

Logged Bug 1519081 - "State" field is displayed even after selecting a Country/Region with no list of state/Province

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Depends on: 1519081
Depends on: 1519788
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: