-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat: Allow to remove fields, filters and action from extended grid #264
feat: Allow to remove fields, filters and action from extended grid #264
Conversation
What's wrong with just disabling them? |
@vvasiloi disabling things when configuring a grid with yaml is not that bad I guess. The thing is, when configuring a grid in php with the I mean, if we take a look at how Symfony form component works, we can remove forms from extended types with a dedicated method. IMO this should work in the same way and as I see it, disabling things is kind of a hack. |
5b40c98
to
77d17fb
Compare
That's really awesome. I think a PHPUnit test with an extended grid and a removed field is missing. |
b2c9569
to
db04d97
Compare
@Florian-Merle Dors that work with no grid inheritance, just updating an existing grid configuration In a first file configuration sylius_admin_grid:
fields:
name:
type: string In a second file configuration sylius_admin_grid:
fields:
removals:
fields: ['name'] |
db04d97
to
dcb4d54
Compare
dcb4d54
to
1e85607
Compare
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.
Thank you, it's a nice feature 👍 I have one doubt that need to be resolved and IMO it's good to be merged 🎉
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 have a little bit of mixed feelings and have the perspective, that if disabling on the inherited grids would work, that would be a cleaner and simpler solution, as we already have an implementation of it. My main problem with the introduction of field removal is that we will have two ways to achieve exact same thing. Which one should we recommend?
But I don't think, that this consideration should block us from merging it, as the proposed solution is good, solves a particular issue and does not interfere with our current design.
I had also mixed feelings about it, but this comment convinced me it's a good way to go. I believe we can deprecate the One more thing, we do not have the documentation for that 💃 So it's another thing that can be done in a separated PR 🖖 Btw, I've allowed myself to fix the comment I left above, I will merge it when it's green 🚀 |
Thanks, Florian! 🥇 |
As of today, it's not possible to remove a field, a filter or an action from an extended grid.
For instance, in the case of Sylius
customer_order
grid in order to remove both the customer filter and the customer field, they are not removed but disabled.This PR allows to solve this issue. For instance the
customer_grid
definition could be replaced by the followingAlso fields, filters and actions from an extended grid can be removed using the
GridBuilder
.