[WC-3417]: Datagrid Text Filter: fix string filter's empty and non-empty operators#2225
Open
rahmanunver wants to merge 1 commit into
Open
[WC-3417]: Datagrid Text Filter: fix string filter's empty and non-empty operators#2225rahmanunver wants to merge 1 commit into
rahmanunver wants to merge 1 commit into
Conversation
r0b1n
reviewed
May 22, 2026
Comment on lines
+37
to
+40
| // Mendix runtime emits lowercase "string"; the shared test mock emits "String". | ||
| // Accept both so detection works in tests AND in production. | ||
| const vt = exp.arg2.valueType as string; | ||
| return (vt === "string" || vt === "String") && exp.arg2.value === ""; |
Collaborator
There was a problem hiding this comment.
What? If mock is not behaving the same as the real life, we should fix the mock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
The DataGrid 2 text filter's
EmptyandNot emptyoperators returned the same results for rows whose text was entered, cleared, and saved again.The Mendix runtime delivers cleared string attributes to us as
""(empty string), notnull. Our filter store was emittingequals(attr, literal(undefined)), which only matchesnull-valued rows, so""rows fell through both operators.We chose to fix this in the filter store rather than upstream because the value arrives at our filter as a legitimate string — changing how the runtime or input widgets persist cleared fields would affect every consumer of String attributes, not just this filter. Scoping the fix to
StringInputFilterStorekeeps the blast radius contained.The string filter now emits a compound condition:
Empty→or(equals(attr, undefined), equals(attr, ""))Not empty→and(notEqual(attr, undefined), notEqual(attr, ""))NumberandDatestores are untouched —Numbercannot hold"", andDateclears persist asnull.What should be covered while testing?
"").Empty→ cleared row appears.Not empty→ cleared row is hidden.Emptyand stay hidden underNot empty.