UI: sync country list & add flags to tb-contact country selector & search country
Pull Request description
UI only changes, would like to have this in 3.6.4: Issue regarding PR https://github.com/thingsboard/thingsboard/issues/10246
This would change how the country selector looks, today:
After:
Notes for docs: Added country flag next to country name in selector
Problems
There are a mismatch in country lists and I am wondering how to continue. I have done this for now:
- Added "Antarctica"
- Added "Bonaire, Sint Eustatius and Saba"
- Added "Bouvet Island"
- Skipped "Brunei Darussalam" as this exists as "Brunei"
- Skipped "Cocos (Keeling) Islands" as this exists as "Cocos"
- Skipped "Congo" as this exists as "Congo-Kinshasa" and "Congo-Brazzaville"
- Skipped "Congo, The Democratic Republic of the" as this exists as "Congo-Kinshasa" and "Congo-Brazzaville"
- Skipped "Côte d'Ivoire" as this exists as "Côte d’Ivoire" (different ' character)
- Skipped "Falkland Islands (Malvinas)" as this exists as "Falkland Islands"
- Added "French Southern Territories"
- Added "Heard Island and McDonald Islands"
- Skipped "Holy See (Vatican City State)" as this exists as "Vatican City"
- Skipped "Iran, Islamic Republic of" as this exists as "Iran"
- Skipped "Korea, Democratic People's Republic of" as this exists as "North Korea" and "South Korea"
- Skipped "Korea, Republic of" as this exists as "North Korea" and "South Korea"
- Skipped "Lao People's Democratic Republic" as this exists as "Laos"
- Skipped "Macao" as this exists as "Macau"
- Skipped "Macedonia, Republic Of" as this exists as "Macedonia"
- Skipped "Micronesia, Federated States of" as this exists as "Micronesia"
- Skipped "Moldova, Republic of" as this exists as "Moldova"
- Skipped "Palestinian Territory, Occupied" - exists as "Palestine" but what should this be?
- Added Pitcairn
- Skipped "Reunion" as this exists as "Réunion"
- Skipped "Russian Federation" as this exists as "Russia"
- Skipped "Saint Helena, Ascension and Tristan da Cunha" as this exists as "Saint Helena"
- Skipped "Saint Martin (French Part)" as this exists as "Saint Martin"
- Skipped "Sao Tome and Principe" as this exists as "São Tomé and Príncipe"
- Skipped "Sint Maarten (Dutch Part)" as this exists as "Sint Maarten"
- Added "South Georgia and the South Sandwich Islands"
- Skipped "Suriname" as this exists as "Suriname" ? not sure why this, maybe different unicode chars?
- Skipped "Syrian Arab Republic" as this exists as "Syria"
- Skipped "Tanzania, United Republic of" as this exists as "Tanzania"
- Skipped "United States Minor Outlying Islands" - What shall I do here??
- Skipped "Viet Nam" as this exists as "Vietnam"
- Skipped "Virgin Islands, British" as this exists as "British Virgin Islands"
- Skipped "Virgin Islands, U.S." as this exists as "U.S. Virgin Islands"
What should I about these? As written in my issue, if someone has a country that wont match with the name perfectly then when opening the tb-contact component it wont show. An idea to fix this would be to have an "oldname" property on the country if the name fails, but for example Korea or Congo, how should we know which one you are referring too?
General checklist
- [x] You have reviewed the guidelines document.
- [x] Labels that classify your pull request have been added.
- [x] The milestone is specified and corresponds to fix version.
- [x] Description references specific issue.
- [x] Description contains human-readable scope of changes.
- [x] Description contains brief notes about what needs to be added to the documentation.
- [x] No merge conflicts, commented blocks of code, code formatting issues.
- [ ] Changes are backward compatible or upgrade script is provided.
- [ ] Similar PR is opened for PE version to simplify merge. Crosslinks between PRs added. Required for internal contributors only.
Front-End feature checklist
- [x] Screenshots with affected component(s) are added. The best option is to provide 2 screens: before and after changes;
- [x] If you change the widget or other API, ensure it is backward-compatible or upgrade script is present.
- [ ] Ensure new API is documented here
Back-End feature checklist
(Havn't modified backend)
- [x] Added corresponding unit and/or integration test(s). Provide written explanation in the PR description if you have failed to add tests.
- [x] If new dependency was added: the dependency tree is checked for conflicts.
- [x] If new service was added: the service is marked with corresponding @TbCoreComponent, @TbRuleEngineComponent, @TbTransportComponent, etc.
- [x] If new REST API was added: the RestClient.java was updated, issue for Python REST client is created.
- [x] If new yml property was added: make sure a description is added (above or near the property).
Going to edit fist message soon, but if the old list is needed I am thinking we can add like a allCountires.map(country => country.name)
I need help with the following:
- Add label
- Add Milestone
Thank you for adding the label and milestone, if you could tell me how to proceed with the mismatch problem or if that will be ignored I would gladly finish up this PR!
Edit: Update, using the "oldname" property i suggested we could get full backwards compatibility except for:
- Skipped "Congo" as this exists as "Congo-Kinshasa" and "Congo-Brazzaville"
- Skipped "Congo, The Democratic Republic of the" as this exists as "Congo-Kinshasa" and "Congo-Brazzaville"
Maybe:
- Skipped "Palestinian Territory, Occupied" - exists as "Palestine", what exactly does this refer to?
Still unsure what do do with:
- Skipped "United States Minor Outlying Islands" - What shall I do here??
All others would work with a "oldname" property as a fallback and when updating the entity the new name would be saved.
Added searchable countries:
and if country is selected while phone input is empty the phone input country gets updated
This counts as not empty and therefor not updated
Hi @Philip2809 , I am a contributor with a long TB story. I decided to wait a bit to look what would happen after your first questions in this pull request. Now I want to warn to (maybe) to save you from disappointment.
TB team hasn't either time or something else (I think) to discuss our PRs. So either just implement as you want and wait (...and wait again) for a review, or just implement for yourself (if you use TB CE for your business needs) and spare your nerves. Believe me(
If someone wants to object to me, welcome. The good must win)))
Hi @Philip2809 , I am a contributor with a long TB story. I decided to wait a bit to look what would happen after your first questions in this pull request. Now I want to warn to (maybe) to save you from disappointment.
TB team hasn't either time or something else (I think) to discuss our PRs. So either just implement as you want and wait (...and wait again) for a review, or just implement for yourself (if you use TB CE for your business needs) and spare your nerves. Believe me(
If someone wants to object to me, welcome. The good must win)))
Hey! Thank you for your comment, I kinda understood this was the case and I have already implemented this in our own TB CE ui but wanted to contribute it here as well because I felt it was a nice quality of life feature.