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

fix: Correctly match users with umlaut charachters in search (SQSERVICES-1894) #14634

Merged
merged 9 commits into from
Feb 8, 2023

Conversation

thisisamir98
Copy link
Contributor

@thisisamir98 thisisamir98 commented Feb 6, 2023

BugSQSERVICES-1894 issue searching for users with special characters in their name

With the help of library speakingurl when we search the name of the user is converted from "Müge" to "muege" and then we try to match it with the searched value.

With this PR we're gonna also convert "Müge" to "muge" and try to match it with the searched value and give it a weight.

Also fixed some TS strict errors along the way.

image

@codecov
Copy link

codecov bot commented Feb 6, 2023

Codecov Report

Merging #14634 (ccc090f) into dev (fdeba20) will increase coverage by 0.00%.
The diff coverage is 90.00%.

@@           Coverage Diff           @@
##              dev   #14634   +/-   ##
=======================================
  Coverage   42.60%   42.61%           
=======================================
  Files         615      616    +1     
  Lines       21039    21054   +15     
  Branches     4806     4811    +5     
=======================================
+ Hits         8964     8972    +8     
- Misses      10959    10966    +7     
  Partials     1116     1116           

Comment on lines +117 to +120
const property = prop as keyof User;
return typeof userEntity[property] === 'function'
? (userEntity[property] as Function)()
: userEntity[property];
Copy link
Contributor

Choose a reason for hiding this comment

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

curious about why this section changed. id assume including an extra 'as' would be slightly less precisely typed but maybe there was a reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

we have this error because ts-compiler is unable to recognize property is a key of User, had to change it to this to fix the error.

thisisamir98 and others added 6 commits February 7, 2023 11:27
Co-authored-by: Timothy LeBon <tlebon@gmail.com>
Co-authored-by: Timothy LeBon <tlebon@gmail.com>
Co-authored-by: Timothy LeBon <tlebon@gmail.com>
Co-authored-by: Timothy LeBon <tlebon@gmail.com>
Co-authored-by: Timothy LeBon <tlebon@gmail.com>
@thisisamir98 thisisamir98 merged commit 9607fe4 into dev Feb 8, 2023
@thisisamir98 thisisamir98 deleted the fix-1894 branch February 8, 2023 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants