Merge pull request #4211 from appsmithorg/fix/4134-table-filter-case-insensitive

Fix/4134 table filter case insensitive
This commit is contained in:
Somangshu Goswami 2021-05-05 12:02:27 +05:30 committed by GitHub
commit 6d41a4eb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -317,7 +317,10 @@ export default {
}, },
contains: (a, b) => { contains: (a, b) => {
try { try {
return a.toString().includes(b.toString()); return a
.toString()
.toLowerCase()
.includes(b.toString().toLowerCase());
} catch (e) { } catch (e) {
return false; return false;
} }
@ -331,15 +334,20 @@ export default {
}, },
startsWith: (a, b) => { startsWith: (a, b) => {
try { try {
return a.toString().indexOf(b.toString()) === 0; return (
a
.toString()
.toLowerCase()
.indexOf(b.toString().toLowerCase()) === 0
);
} catch (e) { } catch (e) {
return false; return false;
} }
}, },
endsWith: (a, b) => { endsWith: (a, b) => {
try { try {
const _a = a.toString(); const _a = a.toString().toLowerCase();
const _b = b.toString(); const _b = b.toString().toLowerCase();
return _a.length === _a.indexOf(_b) + _b.length; return _a.length === _a.indexOf(_b) + _b.length;
} catch (e) { } catch (e) {