Set country field to default country when creating new addresses

RESOLVED FIXED in Firefox 59

Status

()

enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: scottwu, Assigned: scottwu)

Tracking

(Blocks 2 bugs)

unspecified
mozilla59
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox59 fixed)

Details

(Whiteboard: [form autofill:V2])

Attachments

(1 attachment)

Assignee

Description

2 years ago
When adding new address, we could populate the country field with default country (if it's supported). This would avoid a scenario described in bug 1421217, where the default country has hidden fields (ex. Germany). The user might be confused when trying to enter a US address and couldn't find the State field.
Assignee

Updated

2 years ago
Assignee: nobody → scwwu
Comment hidden (mozreview-request)

Comment 2

2 years ago
mozreview-review
Comment on attachment 8939769 [details]
Bug 1421538 - Set country field to default country when creating new addresses.

https://reviewboard.mozilla.org/r/210078/#review216092

::: browser/extensions/formautofill/test/browser/browser_editAddressDialog.js:5
(Diff revision 1)
>  "use strict";
>  
>  add_task(async function test_cancelEditAddressDialog() {
> -  await new Promise(resolve => {
> -    let win = window.openDialog(EDIT_ADDRESS_DIALOG_URL);
> +  await testDialog(EDIT_ADDRESS_DIALOG_URL, win => {
> +    let doc = win.document;

A redundant line?

::: browser/extensions/formautofill/test/browser/browser_editAddressDialog.js:22
(Diff revision 1)
> +  SpecialPowers.pushPrefEnv({set: [[DEFAULT_REGION_PREF, "CA"]]});
> +  await testDialog(EDIT_ADDRESS_DIALOG_URL, win => {
> +    let doc = win.document;
> +    is(doc.querySelector("#country").value, "CA",
> +                         "Default country set to Canada");
> +    win.document.querySelector("#cancel").click();

nit: How about `doc.querySelector(...` if `doc` exists.
Attachment #8939769 - Flags: review?(lchang) → review+
Comment hidden (mozreview-request)
Assignee

Comment 4

2 years ago
mozreview-review-reply
Comment on attachment 8939769 [details]
Bug 1421538 - Set country field to default country when creating new addresses.

https://reviewboard.mozilla.org/r/210078/#review216092

Thanks Luke! Fixed the issues and a few eslint problems.
Comment on attachment 8939769 [details]
Bug 1421538 - Set country field to default country when creating new addresses.

Looks good, thanks!
Attachment #8939769 - Flags: review?(schung) → review+
Assignee

Updated

2 years ago
Keywords: checkin-needed

Comment 6

2 years ago
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/9ea106a104bb
Set country field to default country when creating new addresses. r=lchang
Keywords: checkin-needed

Comment 7

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/9ea106a104bb
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.