wok
wok copied to clipboard
Bootgrid Filter does not support code point normalization
There are some characters in Unicode which have multiple code point representations. For example, the character "Ç" has two data representations: one is pre-composed form U+00C7, and the other, de-composed form U+0043 U+0327. If the character is compared in difference forms, the bootgrid filter does not work as intended. Therefore, normalization is necessary.
Unicode Normalization Forms are formally defined normalization of Unicode strings which make it possible to determine whether any two Unicode strings are equivalent to each other.
To achieve this in bootgrid, we have to normalize the search pattern and the data in which it will be search to ensure that its normalized.
For example without normalization if I have below two data in bootgrid list, one is precomposed and another is decomposed from of accent e. tést1 tést2 And if user search for "é", currently only tést1 is listed.
After normalization, with filter as "é" both tést1 and tést2 will be listed.
@archu-s Are you going to work on it?
I think the code change will be in bootgrid library. @samhenri : Could you please let me know your input on this, as the changes will be in bootgrid library.
@archu-s wok.bootgrid is used for User Log tab only, Ginger instance is ginger.bootgrid. I think this change is valid for both use cases but Wok implementation is slightly different from Ginger so I'm wondering what is the best approach for this. I think to avoid repeating code this should placed in a separate script in Wok and the appropriate changes made ginger.bootgrid and wok.bootgrid to extend the default Bootgrid filter.
@samhenri :The changes I think needed for this issue is in library jquery-bootgrid.js. As soon as we enter any value in filter it calls the library's function of bootgrid for filter, we do not have this filter function customize neither in wok.bootgrid nor in ginger.bootgrid, both of this uses the library's function for filter on keyup.
I think we should edit the default jquery-bootgrid library, hence modifying it would make it impossible to update to a newer version later.
I have raised issue in git of jquery-bootgrid, I do not see any response til now on this. https://github.com/rstaib/jquery-bootgrid/issues/296