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

Make dropdown menu with searchable country names #202

Open
JoryGriffith opened this issue Nov 13, 2024 · 9 comments
Open

Make dropdown menu with searchable country names #202

JoryGriffith opened this issue Nov 13, 2024 · 9 comments

Comments

@JoryGriffith
Copy link
Contributor

It would be great to have a drop down menu with searchable country names because it is too easy to miswrite.

@jmlord
Copy link
Contributor

jmlord commented Nov 13, 2024

This is absolutely necessary! Current workaround is to use the markdown feature in the input description to link to the list of acceptable values.

Proposed solution 1:

  • Add and document two new custom types: "country" and "region" <-- is region the good snigle-word alternative to "state or province"?
  • Support those in the UI
    (this is very narrow, works for this case only)

Proposed solution 2:

  • Support a link attribute in the options attribute, as such:
options_example:
  label: Options example
  description: The user has to select between a fixed number of text options. Also called select or enum. The script receives the selected option as text.
  type: options
  options: http://site.com/api/optionList
  example: third option

More expandable, but then we'd need to set expectations on the option formats we can read.

@glaroc, thoughts?

@tpoisot
Copy link

tpoisot commented Nov 13, 2024

What about using GADM? They have a curated collection of territories and their subdivisions.

(and using the word "Country" may be debatable as well, not everyone agrees on what a country is...)

@glaroc
Copy link
Contributor

glaroc commented Nov 13, 2024

The complicated part is the dependent dropdowns. For example, the choice of states/provinces has to depend on the choice of country. For the dependent dropdown, we could have something like

options_country:
  label: Country selector
  description: Choice of countries
  type: options
  options: http://site.com/api/countryList
  example: Colombia
options_province:
  label: State/province selectore
  description: Choice of state/province
  type: options_dependence 
  options: http://site.com/api/provinceList/{options_country}
  example: Putomayo

@gottacatchenall
Copy link
Contributor

Quickest fix here is probably to query everything in GADM once and make a static JSON of the regions/subregions/subsubregions hierarchy

@glaroc
Copy link
Contributor

glaroc commented Nov 13, 2024

We have these endpoints already here:
https://geoio.biodiversite-quebec.ca/country_list
and
https://geoio.biodiversite-quebec.ca/state_list?country_name=Colombia

@gottacatchenall
Copy link
Contributor

(and using the word "Country" may be debatable as well, not everyone agrees on what a country is...)

Huge agree here. These are things that should be addressed at a higher level of governance within GEO-BON, but the choices we make here could absolutely impact the reception of this platform by national policy makers, e.g. the decision to include Taiwan in the country list above.

@glaroc
Copy link
Contributor

glaroc commented Nov 13, 2024

We obviously won't be the ones making those decisions. We could use the same country list the CBD/UN uses. Or change the title to Country/Territory

@tpoisot
Copy link

tpoisot commented Nov 13, 2024

We could use the same country list the CBD/UN uses. Or change the title to Country/Territory

Agreed, and I think that's a decision for which we can ask advice from GEOBON leadership. Happy to bring it up on discourse for the IC.

@jmlord
Copy link
Contributor

jmlord commented Nov 14, 2024

We have these endpoints already here: https://geoio.biodiversite-quebec.ca/country_list and https://geoio.biodiversite-quebec.ca/state_list?country_name=Colombia

Bare minimum, these should be linked in the description of the scripts referring to this country list while we find a more permanent solution.

As for the debate on what a country is, I'd gladly wash my hands of it and refer to some international authority... as long as they provide the polygons along with the region names!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: TODO
Development

No branches or pull requests

5 participants