-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use filters on nested properties #4882
base: 4.x
Are you sure you want to change the base?
Conversation
Closes #4881 |
Thanks @Marcachips for this PR 👍 |
This PR is really interesting and can be very useful. Is there any plan to merge it ? |
Hi, Any news about this feature?.. We still cannot use filters on embedded properties... |
Hey there, currently facing an issue this PR would fix, merging would be really great. Is there anything I/we can do to help? |
Is there any reason this PR is still not merged ? It would be great to have the possibility to filter on nested properties ! |
I think the most important thing here are missing tests - I doubt @javiereguiluz will merge it without them. |
same here, would be nice if it will be merged. |
@Marcachips will you add tests or do you need help? |
I plan to write tests before the end of this week. I don't need help for now, but thanks 👍 |
@kiler129 i know but this one doesnt work wost nested entities, like product.category |
79c1acd
to
cec6ecc
Compare
cec6ecc
to
af0bb9f
Compare
Tests are pushed ! |
Hello, your PR looks very nice, what are the "blocked point" now? |
Hello, this PR will be very helpful |
/** @var FilterInterface */ | ||
private $wrappedFilter; | ||
|
||
public static function new(string $propertyName, string $label = null): self |
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.
I don't see a reason for this method to be present, it just confuses more. There is no new()
method in FilterInterface
, so I think this should be removed.
Also, I see a point in renaming wrap()
to new()
to make it more natural alongside with other filters.
/** | ||
* @author Brandon Marcachi <[email protected]> | ||
*/ | ||
final class NestedFilter implements FilterInterface |
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.
Could you please elaborate a bit: can this be implemented without adding NestedFilter
? Why you chose this way?
For me, it looks much more natural to not have a wrapper for filters – similar to Fields. Just add a dot to filter and you're done... Isn't it?
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.
Hello,
Thank you for the PR and the review. Not sure but I think it's much more complex than just add a dot tbh. Otherwise I really don't understand why this feature is not already implemented. I did a PR for that job and I had to modify much more files to handle all cases due to internal mechanism : #4840
Any news about this PR? |
@Marcachips @javiereguiluz Any news for this great feature ? |
Hello @javiereguiluz ! |
Ping of this great feature @javiereguiluz @Marcachips |
Ping ? |
i would also like to have it fixed to get my filter working as intended ♥ |
Hi, up ? |
@javiereguiluz Some news about this PR ? Thanks |
I would also welcome this feature. |
No news on this one? |
If you cannot wait for this MR please check my naive implementation. https://gist.github.com/teklakct/ed154ccadc18b1463a139f09d3286355
PS. I think there is an option to slightly enhance the |
Just got notifications that related issues have been automatically closed (#4881 (comment), #4966 (comment)), so I'm not sure if this will get merged anytime soon 🙁. |
@ToshY we're closing many old issues automatically ... for PRs, I'll review them manually to see if they are still relevant and if we can reuse parts of them. |
@javiereguiluz Thanks for the clarification. It would still be nice to have a PR like this getting merged. |
up, I think it's a must have. |
I did not have time to do things properly in a fork and PR, but here is the rerolled patch to apply to EA 4.24 to enable the NestedFilter. |
This PR makes filters support properties with dot notation by using a new filter as wrapper.
The NestedConfigurator is able to configure the wrapped filter by (re)invoking the configurators collection and copy configured FormType and options to display the correct wrapped filter view.
The NestedFilter is able to apply required left joins for a given path and delegate query customization to wrapped filter by recreating adapted arguments (like FilterDataDto and EntityDto)
There is no tests for now, but i can add it if you are interested by the purpose.