-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
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" #24477
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
searchValue: `${countryISO}${countryName}`.toLowerCase().replaceAll(CONST.REGEX.NON_ALPHABETIC_AND_NON_LATIN_CHARS, ''), |
searchValue: `${state.stateISO}${state.stateName}`.toLowerCase().replaceAll(CONST.REGEX.NON_ALPHABETIC_AND_NON_LATIN_CHARS, ''), |
App/src/libs/searchCountryOptions.js
Line 11 in ea944e7
const trimmedSearchValue = searchValue.toLowerCase().replaceAll(CONST.REGEX.NON_ALPHABETIC_AND_NON_LATIN_CHARS, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
_.deburr
to 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android