Skip to content

Commit

Permalink
Merge pull request #225 from taigaio/issue/search-with-accents
Browse files Browse the repository at this point in the history
fix: search users with accents
  • Loading branch information
CarlosLVar authored Jan 13, 2025
2 parents 17d20af + 1957161 commit 396e9c4
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ SelectUserDirective = (
roles = []
lightboxService.open($el)

normalize = (text) ->
text.toUpperCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '')

getFilteredUsers = (text="") ->
selected = _.compact(_.sortBy(
_.filter(users, (x) ->
Expand All @@ -34,8 +37,9 @@ SelectUserDirective = (
if row.type == 'user' && _.find(selected, ['id', row.id])
return false

name = row.name.toUpperCase()
text = text.toUpperCase()
name = normalize(row.name)
text = normalize(text)

return _.includes(name, text)

collection = _.union(
Expand Down

0 comments on commit 396e9c4

Please sign in to comment.