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

Accounts request form: auto-unify country names #13104

Open
damithc opened this issue Apr 30, 2024 · 7 comments · May be fixed by #13166
Open

Accounts request form: auto-unify country names #13104

damithc opened this issue Apr 30, 2024 · 7 comments · May be fixed by #13166
Labels
enhancement New feature or request p.Low Very little impact; unlikely to do in the near future

Comments

@damithc
Copy link
Contributor

damithc commented Apr 30, 2024

image

Current:

  • Users type in the country name as free text, which means the same country can be represented in many ways e.g., United States, USA, US, etc.
  • For the sake of keeping data somewhat uniform, the admin manually edits the country field to a common one e.g., USA for the above example.

Suggested:

  • Hardcode an internal map of commonly used variations and replace them automatically when saving the account request. This is a bit hackish, but can reduce the manual editing the admin needs to do. If taking this route, ask me for such common variations that should be tackled (probably less than 10, but happens frequently). Here is the list:
    • USA: U.S.A, United States, America, ...
    • UK: ...
    • UAE: ...
    • Germany: Deutschland
    • Netherlands: ...
    • Belgium: België
    • Brazil: Brasil
    • Spain: España
    • Mexico: México
    • Italy: Italia
  • Alternatively, we can also think of allowing users to choose from a drop-down but this has it's own issues e.g., disagreements of which are considered countries. In any case, some institutions are not anchored into one country, which means we still have to provide the free text route.
@damithc damithc added p.Low Very little impact; unlikely to do in the near future enhancement New feature or request labels Apr 30, 2024
@franciscoSavala
Copy link
Contributor

I would like to contribute with the first alternative, it would be useful to have the common variations of the countries

@Shihuihuang1103
Copy link

@damithc I think we can implement a search bar for Country/Region that allows the user to input a value and choose a match from a drop-down menu. If the input doesn't match with any item, then we can simply store the user input? If you think it's a good idea, I can work on it.

example:
Screenshot 2024-05-27 at 9 02 00 AM

@damithc
Copy link
Contributor Author

damithc commented May 29, 2024

@damithc I think we can implement a search bar for Country/Region that allows the user to input a value and choose a match from a drop-down menu. If the input doesn't match with any item, then we can simply store the user input? If you think it's a good idea, I can work on it.

@Shihuihuang1103 Thanks for your interest in this issue. I'm curious as to which list of countries do you propose to use?

@Shihuihuang1103
Copy link

@damithc I found these two sources for list of countries and regions:

Please let me know if you think either of the above lists would be a good reference for this feature, or if you have another list in mind.
Thank you!

@itstrueitstrueitsrealitsreal
Copy link
Contributor

@damithc @Shihuihuang1103 Hi, I was doing some research related to this issue, and I think that the ISO 3166 standard would be a good reference point for implementing this feature, as it is a universally accepted standard for country identification, and are easily integrated into the existing codebase with libraries such as iso-3166-1-alpha-2 and iso-3166-1.

@damithc
Copy link
Contributor Author

damithc commented Jul 3, 2024

@damithc @Shihuihuang1103 Hi, I was doing some research related to this issue, and I think that the ISO 3166 standard would be a good reference point for implementing this feature, as it is a universally accepted standard for country identification, and are easily integrated into the existing codebase with libraries such as iso-3166-1-alpha-2 and iso-3166-1.

@itstrueitstrueitsrealitsreal Sorry, I missed this earlier. Yes, this seems like a good way to go, provided users will still have the option to type their own as well.

domoberzin added a commit that referenced this issue Jul 11, 2024
* Added unified countries for InstructorRequestForm

* Added tests for InstructorRequestForm for unified countries

* Fixed lint errors for InstructorRequestForm

* Added countries and moved countrymapping

* Tests Fixed

---------

Co-authored-by: Francisco Savala <[email protected]>
Co-authored-by: Wei Qing <[email protected]>
Co-authored-by: Ching Ming Yuan <[email protected]>
Co-authored-by: domoberzin <[email protected]>
@itstrueitstrueitsrealitsreal itstrueitstrueitsrealitsreal linked a pull request Aug 8, 2024 that will close this issue
@franko1508
Copy link

Hey , I am taking a class where I am supposed to contribute to an open source project . Is there a chance me and my team can try to solve this problem by attempting to create a drop down menu , the way someone mentioned it before ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p.Low Very little impact; unlikely to do in the near future
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants