The country name is not displayed when you start entering "cote" or "cote d'Ivoire" without a diacritic, and instead you see "no results found"#24477
The country name is not displayed when you start entering "cote" or "cote d'Ivoire" without a diacritic, and instead you see "no results found"#24477aldo-expensify merged 3 commits intoExpensify:mainfrom Pluto0104:pluto0104/issue-24344
Conversation
|
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@mananjadhav I apologize for repeatedly requesting a review on closed pull requests. I am new to contributing to Expensify and I made a mistake by not signing the CLA with Gpg on my commits. However, I have now resolved the issue with the CLA sign and this is the final version. Please review it and inform me if you have any concerns or questions. |
|
Hey thanks for getting it sorted. Yeah first time could be problematic, once this is through it'll be easier. And you can always ask for help on the #expensify-open-source channel. We can retroactively add signed commits, etc. |
mananjadhav
left a comment
There was a problem hiding this comment.
Code change is fine. Testing now.
I would've preferred if we only added deburr instead of replacing underscore calls, but this is fine too.
Reviewer Checklist
Screenshots/VideosWebweb-diacritic-search.movMobile Web - Chromemweb-chrome-diacritic-search.movMobile Web - Safarimweb-safari-diacritic-search.movDesktopdesktop-diacritic-search.moviOSios-diacritic-search.movAndroidandroid-diacritic-search.mov |
|
Thanks for the quick one @Pluto0104. @aldo-expensify All yours. 🎀 👀 🎀 C+ reviewed. |
There was a problem hiding this comment.
Since _.chain(searchValue).deburr().toLower().value().replaceAll(CONST.REGEX.NON_ALPHABETIC_AND_NON_LATIN_CHARS, ''); or similar is used in three places and they should really match, can we extract that into a function? 🙏
I'm referring to these places:
App/src/libs/searchCountryOptions.js
Line 11 in ea944e7
aldo-expensify
left a comment
There was a problem hiding this comment.
Worked well for me, thanks for the quick work!
@mananjadhav do you want to have a last look before merge?
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Reviewed it retroactively, changes are fine. Thanks for merging it @aldo-expensify. |
|
Thank you for your time, @aldo-expensify, @mananjadhav |
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 1.3.55-0 🚀
|
|
🚀 Deployed to staging by https://github.com/aldo-expensify in version: 1.3.56-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
I have read the CLA Document and I hereby sign the CLA
Details
The country name is not displayed when you start entering "cote" or "cote d'Ivoire" without a diacritic, and instead you see "no results found".
It's because the app does not handle diacritics or special characters properly when searching or matching country names.
We can use
_.deburrto remove diacritics from a string. This is a built-in function from lodash, which is a library that we already use in our app. This will make your code more concise and readable. (I'll import lodash module instead of underscore as_)Fixed Issues
$ #24344
PROPOSAL: #24344 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android