Hotfix: gerbil search contains operator — drop trailing '*' (Gridify =* is contains; name=*a not name=*a*) + e2e mock mirrors real Gridify
This commit is contained in:
@@ -27,7 +27,10 @@ function matchesFilter(row: Row, filter: string | null): boolean {
|
||||
if (!filter) return true
|
||||
return filter.split(',').every((andPart) =>
|
||||
andPart.split('|').some((cond) => {
|
||||
let m = cond.match(/^(\w+)=\*(.*)\*(\/i)?$/)
|
||||
// Gridify "contains": `field=*value` — value runs to the end (optionally /i).
|
||||
// Mirror the REAL backend: no trailing `*` (the old `=\*(.*)\*` regex hid the
|
||||
// SQL-LIKE `name=*a*` bug that returned 0 rows against real Gridify).
|
||||
let m = cond.match(/^(\w+)=\*(.*?)(\/i)?$/)
|
||||
if (m) {
|
||||
return String(row[m[1]] ?? '')
|
||||
.toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user