fix(table-core): auto-remove empty arrHas filter values like the other array filters#6356
Conversation
…r array filters arrHas was the only array-valued filter function without an autoRemove handler, so an empty array filter value was never removed and hid every row.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
✅ Files skipped from review due to trivial changes (11)
📝 WalkthroughWalkthrough
ChangesarrHas autoRemove
Example formatting updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit be97b81
☁️ Nx Cloud last updated this comment at |
arrHasis the only one of the four array-valued filter functions that doesn't define anautoRemovehandler. Its siblingsarrIncludes,arrIncludesAllandarrIncludesSomeall use the same one:Because
arrHashas none,shouldAutoRemoveFilterfalls back to the built-in rules, which only drop a filter when the value isundefinedor an empty string. An empty array ([]) gets through, so the filter stays active and[].some(...)returnsfalsefor every row. The column then hides everything instead of behaving like "no filter set". The other three array filters auto-remove an empty array and show all rows, and #6332 recently made the range filters (between/betweenInclusive) do the same for empty pairs.This gives
arrHasthe sameautoRemoveas the rest of the array-filter family: empty or blank values are removed, a non-empty array keeps the filter active.I added a regression test under a new
Array Filtersblock, mirroring the existingbetween/betweenInclusiveautoRemove tests.Summary by CodeRabbit
undefined,null, empty strings, and empty arrays) are automatically ignored.