Add possibility to set pagination options on grids#68
Conversation
|
@lchrusciel can I have a review, please? I need to know if and how I should move forward with this. |
lchrusciel
left a comment
There was a problem hiding this comment.
Hey Victor,
this issue is with us for way too long. Your proposal seems to be in a good direction. However generic setting could be done with configuration component indeed. I would like to see it merged in SyliusGridBundle.
/cc @pamil, what is your opinion?
05ab13d to
cf7f221
Compare
pamil
left a comment
There was a problem hiding this comment.
Thanks a lot and sorry for the delay! I've just rebased the PR to the newest master so that CI does not fail anymore. Also resolved @lchrusciel comment and added a comment not to rely on these parameters for defining global behaviour for now.
|
I think in the current form it's pretty good to go. I'd say the next steps, for now, would be "test with order by to-many association field and allow output walkers enabled/disabled per grid" and "update documentation". Then it should be good to merge, we can skip configurable default settings for all grids for now and address that later. If so, I think the best place to set it would be Also, really cool work on https://github.com/vvasiloi/doctrine-pagination! I wonder if there's some solution that is both performant and accurate? Can it be solved somehow with a custom query (for cases like Sylius/Sylius#3775, when using output walkers takes too much time)? |
f13d73f to
2788d8b
Compare
|
@AdamKasp Thanks for picking it up, I forgot about it... 😞 Do you need anything from me? |
14c1308 to
09aeec0
Compare
|
The "use output walker" parameters should allow |
…arguments configurable per grid and add default value for all grids
|
|
||
| if (!isset($configuration['repository']['method'])) { | ||
| return new DataSource($repository->createQueryBuilder('o')); | ||
| return new DataSource($repository->createQueryBuilder('o'), $fetchJoinCollection, $useOutputWalkers); |
There was a problem hiding this comment.
Just a minor thought, but perhaps it would be better to pass the whole configuration array into the data source?
There was a problem hiding this comment.
I have no strong opinion about that change. But now, it looks that every operation on the configuration array occurs in Driver, so it makes sense to do it there and pass only proper parameters to DataSource. Do you see any benefits or potential benefits of changing it?
|
Thank you, Victor, Adam and Grzegorz! 🎉 |
… GridBundle 1.10 (AdamKasp, GSadee) This PR was merged into the 1.9 branch. Discussion ---------- | Q | A | --------------- | ----- | Branch? |master Should be merged after merge PR Sylius/SyliusGridBundle#68 and release new version of `SyliusGridBundle` <!-- - Bug fixes must be submitted against the 1.9 or 1.10 branch (the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- e489775 docs about fetch join collection and output walkers d70f712 [Documentation] Improve note about disabling pagination optioons
|
Thank you, Adam and Grzegorz! |
A similar solution can be applied to the Resource Bundle Sylius/SyliusResourceBundle#148.
The solution is based on this experiment: https://github.com/vvasiloi/doctrine-pagination
TODO:
Additional: