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

[#13104] Accounts request form: auto-unify country names #13117

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

franciscoSavala
Copy link

@franciscoSavala franciscoSavala commented May 21, 2024

Part of #13104

Outline of Solution
Added common variations for countries with help of this dataset. I am waiting for a response from the core team to know the common variations in country names. Until then, this is an idea of what the solution could be.

The solution takes the country given by free text of the request account form and then maps it with known countries. Otherwise, it leaves it as is.

@franciscoSavala
Copy link
Author

#13104 Waiting review...

Copy link
Contributor

@jayasting98 jayasting98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are some thoughts on this.

Comment on lines 121 to 125
'United States': 'USA',
US: 'USA',
America: 'USA',
UK: 'United Kingdom',
Deutschland: 'Germany',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the only possibilities?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some countries to the list with the change in the issue, and also included the possibility to correct any capitalization typos in the listed countries.

Comment on lines 119 to 126
// Country Mapping
const countryMapping: { [key: string]: string } = {
'United States': 'USA',
US: 'USA',
America: 'USA',
UK: 'United Kingdom',
Deutschland: 'Germany',
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there is a better place to put this. I am not completely sure where though; perhaps another reviewer has a better idea. However, maybe at the very least, it should be outside the function, like maybe it should be a class constant.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking of creating another class so that the map can only be accessed with a method and cannot be modified, but I'm not sure if it's the correct apporach.

@jayasting98 jayasting98 added c.Feature User-facing feature; can be new feature or enhancement to existing feature s.ToDiscuss The issue/PR is undergoing discussion/review by the core team labels May 29, 2024
@damithc
Copy link
Contributor

damithc commented May 29, 2024

@franciscoSavala I have updated #13104 with a list of common replacements to include

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Feature User-facing feature; can be new feature or enhancement to existing feature s.ToDiscuss The issue/PR is undergoing discussion/review by the core team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants