-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix(filterFilter): correctly handle deep expression objects #9757
Conversation
Some considerations:
|
3b040cd
to
b72583f
Compare
Great work! I don't want to piggyback on the PR or anything, but can you check if this PR can be incorporated in your fix? It seems like a good fit. #6623 We could also check other filter issues for possible tests to add. |
@@ -79,7 +78,6 @@ describe('Filter: filter', function() { | |||
expect(filter(items, {'first.name':'misko', 'last.name':''})).toEqual([items[0]]); | |||
}); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stop removing these =)
So yeah, I would just ditch the first commit --- 2 lines between specs are nice, and used in most of the test suite --- removing them just makes it more inconsistent. As for the minor whitespace changes, those should be picked up by jscs once we get it doing that, but who really cares if we're honest? |
@caitp: I also removed empty new lines before a closing Anyway, those changes (along with a few white-space changes, to make things consistent and inline with the new jscs rules) are placed in a separate commit, so they can't be ignored (only...you know...they really shouldn't, because consistency is a good thing). |
these are test cases, consistency for minor things like that doesn't matter aw hole lot, so long as they are at least following the formal style guidelines imo. I suggest opening a separate bug for fixing style nits unrelated to this functional change so that it's easier to review (less gunk in the diff) |
@caitp: Hm...I thought putting those changes in a separate commit was enough, but it apparently isn't. I'll remove the commit and put it in a separate PR then. @Narretz: I am not sure if it's a fix or a feat. It depends on how it was supposed to work. If Regarding #6623: |
0d9a987
to
d412eab
Compare
@gkalpak you probably need to rebase now that the other part is merged. yeah you do |
d412eab
to
7bd2a58
Compare
…prop Basically, implement the logic detailed in the 2nd point of angular#9757 (comment)
2664892
to
d27f4c5
Compare
…prop Basically, implement the logic detailed in the 2nd point of angular#9757 (comment)
Previously, trying to use a deep expression object (i.e. an object whose properties can be objects themselves) did not work correctly. This commit refactors `filterFilter`, making it simpler and adding support for filtering collections of arbitrarily deep objects. Closes angular#7323 Closes angular#9698
…ed properties Closes angular#9984
…prop Basically, implement the logic detailed in the 2nd point of angular#9757 (comment)
d27f4c5
to
5d40a89
Compare
So I know I threatened to land this a few weeks ago --- I think we want this, but it looks like some stuff has been added since, and it's really hard to keep track of this diff u_u Generally I trust @gkalpak's judgement though, so it's probably good. @petebacondarwin can we land this today? |
It's a big diff but I like that there are only additions in the test file and this is not the most central part of Angular. Let's get this in. |
Alright *fingers crossed no regressions* |
IT IS DONE ✨ |
…prop Basically, implement the logic detailed in the 2nd point of #9757 (comment)
✨ ✨ OMG ✨ ✨ I think I'm gonna 😂 |
Enable filterFilter to filter deep object by string again. It used to work like this before angular#9757, 1.3.6.
Enable filterFilter with string expression to filter objects with deep properties. It used to work like this before angular#9757 and v1.3.6.
Previously, trying to use a deep expression object (i.e. an object whose properties can be objects themselves) did not work correctly. This commit refactors
filterFilter
, making it simpler and adding support for filtering collections of arbitrarily deep objects.Closes #9698
BTW, I used "non-IE8" stuff (like `Array.prototype.some/every`) for the sake of conciseness and clarity, so this is not directly back-portable to 1.2.x. If there is interest, I can create a IE8 compatible version (using `for-loops` etc).