-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add a Country dropdown menu list in the Address Editor #24917
Comments
It looks like A-S expects the country to be in the ISO 3166 format, as seen in their SQL scheme definition. The complete list of these can be retrieved easily on Android using Locale.getISOCountries. It looks like the JSON referenced above has the added benefit of including format information, including what fields are required to consider an address valid for each locale. I'd suggest that we take the simple path for this issue, and just use @gabrielluong thoughts? Let me know if the above plan sounds actionable and I'll get started. |
I am okay with starting with I don't expect A-S to handle the validation for us. Their philosophy has always been to provide the storage and syncing capabilities and let the consumers do the rest. My ideal solution would be to handle the sharing and exposing of this data through GV APIs since the source of truth in this case is in this Alternatively, the most basic solution with 100% confidence is to just provide a Country dropdown that displays only Canada and United States (matching the casing and spelling as provided in |
Was this ticket intended to also capture a state/province dropdown? If that's the case, we might be best off by just moving forward on exposing a GV API. Switching between countries on desktop not only updates the state/province list, but changes field names and which fields are available. In terms of just country data, I think I can say pretty definitely that desktop expects the Additionally, the country code is what's used to index entries in Since our designs seem to show country codes (except USA should be US), I don't think we need to worry about spelling differences for countries specifically. States/provinces will be another matter entirely, as on desktop I can only find abbreviations used for US states. Those might require a design update for a longer or even multi-line dropdown. The other design consideration is whether we'll be showing the long-form country name when the dropdown is active. It may make it easier for users to find the country they're looking for. I don't think this would impact the way we save/sync data though. Ultimately, I think we could pretty easily implement something for I'll defer to you whether we should punt on this until we can get an appropriate API in place. |
I put a higher estimate on this originally thinking we would do something to load a selection of the json fields from I think we mentioned our preferences for having a GV API in one of our backlog glooming meeting, but given GV's 102 sprint backlog, I don't see any room where they would be able to provide us an API that wraps
I wouldn't worry about the country codes being different in the design. I would mostly likely defer to what the display name for Desktop is. I don't know what to think about getting a region's displayed name right now since that goes pretty deep into the platform https://searchfox.org/mozilla-central/search?q=getRegionDisplayNames&path=. My first order of priority is ensuring the underlying synced values are the same for Country and State/Province. Getting the correct displayed name for Country should be easy enough for this issue, and we can think about the display name for State/Provide in the separate issue. I would be okay with just displaying the State/Province Code in the interim if that is the only thing that is provided to us in the dataset in
So, I would suggest for the time being to move forward with an interim solution that would be suitable for our needs. The most likely candidate would be just take the data in |
I talked with Agi a bit yesterday about the best way to share the address reference data between desktop and mobile. He and I agree that any API to retrieve it at runtime through GV -> gecko would be fairly awkward. He suggested that we move address reference into a JSON file and generate static classes for desktop and mobile for it during central builds. With that method we can create an idiomatic class in Java and host it in GV and recreate the initial JS file for desktop. I think that's likely out-of-scope for this ticket. Would it be best to file a follow-up against GV in bugzilla? |
This makes sense. One of my early thoughts was to move objects in the jsm into a json and just consume it. I would file GV issues through in Bugzilla and not track it here. |
bugzilla ticket to expose address data |
Why only 2 countries visible in the list? US and canada |
Replace the existing country input text field with a dropdown of country values.
Examine how the Desktop Country dropdown is generated (could be this https://searchfox.org/mozilla-central/source/toolkit/components/formautofill/addressmetadata/addressReferences.js but should verify). We're assuming we want to implement a similar Country dropdown instead of having users manually enter their country, but we can also limit this to only US/CA since we are only supporting those countries initially. Ideally, we should see if Android provides something for us to validate addresses or provides a list of countries as well.
Acceptance Criteria
support-utils
in AC. Please confer findings before proceeding.No design was available at time of writing.
┆Issue is synchronized with this Jira Task
The text was updated successfully, but these errors were encountered: