Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(filterFilter): comparator should return true if deep object key is undefined #6623

Closed
wants to merge 3 commits into from

Conversation

Narretz
Copy link
Contributor

@Narretz Narretz commented Mar 9, 2014

Since the filtering of deep object predicates was fixed in b4eed8a, an undefined key in a deep object predicate did not return true un the comparator like it does for non-nested object predicates and strings. See this plunker:

http://plnkr.co/edit/uB7Mta?p=preview

At first, p2_filter is undefined, and the filer returns no results. When you type in the input, the filter is set, and when you clear the input, it is set to empty string, returning all results.

The first commit in the pull request adds a check to the comparator to see if a key is undefined.
The second commit adds the same test for non-nested objects predicate, in line with the string filter test
The third commit fixes multiple style issues in filterSpec.js

I separated them to make the actual issue more visible

Closes #6222

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6623)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@Narretz
Copy link
Contributor Author

Narretz commented Apr 11, 2014

No love for this? It's a simple fix.

@quantizor
Copy link

@Narretz I've had filterFilter commits sitting for a while too, guess it's just not a priority for them. #6695

@gkalpak
Copy link
Member

gkalpak commented Dec 9, 2014

Based on #9757 (comment) and #9757 (comment), I believe we don't want to merge this, so closing.

@Narretz: Feel free to re-open if you change your mind 😄

@gkalpak gkalpak closed this Dec 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Filters for nested objects not working
6 participants