LuccaSA / lucca-front

documentation
https://prisme.lucca.io
MIT License
38 stars 4 forks source link

[Simple select] When using directive (eg users/establishments), diacritics are badly escaped #2903

Open Nurovek opened 1 week ago

Nurovek commented 1 week ago

When using a simple-select with, for instance, a users directive to feed it, and trying to search with a clue containing diacritics, the queryParam for clue seems to have been url encoded twice

e.g I want to type "Hélène" http://localhost:4200/api/v3/users/search?fields=id,firstName,lastName,picture.href&clue=h%25C3%25A9l%25C3%25A8ne&paging=0,20 image

Instead of having h%C3%A9l%C3%A8ne, we have the above badly-formatted string.

I have to type "Helene" in the clue box in order to retrieve this user. image

Is this something to fix lucca-front side ? Or is it intended to be overridden app by app without sanitizing it (the sanitizeClueFilter function)?

bastienguillon commented 6 days ago

Some teams have fixed this behavior by decoding the clue returned by the lu-simple-select : example. I don't think this behavior is intended

GuillaumeNury commented 4 days ago

Damn, we are encoding it twice: image

Flavien is on it

Supamiu commented 4 days ago

While fixing this, I noticed that we're also doing a split(' ').join(','), effectively replacing space characters with commas, is that something we need to keep for the API calls? I'll assume yes for now.