Kreyu / data-table-bundle

Streamlines creation process of the data tables in Symfony applications. NOT PRODUCTION READY.
https://data-table-bundle.swroblewski.pl
MIT License
75 stars 14 forks source link

#30 Integration with Symfony Profiler #90

Closed alexandre-castelain closed 4 months ago

alexandre-castelain commented 5 months ago

Hello,

This is a first draft to add this bundle to the profiler.

I don't add a lot of information, but at the moment we have :

Maybe I should add the "Options" to everything, unfortunately, when there's a closure, it's not possible to profile it (obviously).

It's not a game-changer yet, but it could be ! :)

Take a look and tell me if you like it. Have a good day,

Alexandre

alexandre-castelain commented 5 months ago

Hello @Kreyu !

Sorry for the long wait since the last time, I have been quite busy. I'm trying to find time here and there to make progress on these MRs.

Regarding your feedback, I have taken it into account. I have also started to rework the data collection as you suggested. I have used events and was heavily inspired by how Forms work.

For now, only the filters have been reworked. Can you confirm that this is how you envisioned it?

Is there anything important that you think I might have missed? Thank you for your feedback!

Have a good day, Alexandre

Kreyu commented 4 months ago

Hey @alexandre-castelain, thanks for your time, and sorry for the delay. I'll try to look into this in the following days, as I need to study how this integration is handled in the form component itself, and to test it in a real app to be able to review this more... confidently 😄

Cheers!

alexandre-castelain commented 4 months ago

Hey !

No problem, I understand that it's not your priority. We only have one 24h in a day ! :)

I tried to resolve the filters callback, especially for the row actions, but it doesn't make sense, because each line have a different value.

Let me know if you want me to explain anything about my code.

Have a good day, Alexandre

Kreyu commented 4 months ago

Hey again! 😄

Overall, great job. I've added small fixes here and there, mostly visual. We're still missing a crucial part of this integration - collecting views. By views, I mean objects such as:

Similar to Form component, we cannot collect view objects using events - calling the createView() method does not dispatch any event. I did some digging and discovered following classes in Forms:

Those objects work as a proxy for resolved type and its factory. Resolved types are classes that are creating views, therefore, we can create something similar, and collect view data from here 😄 Thanks to that, for example, we'll be able to display a list in the profiler containing resolved column options for each value row.

For now, I think we can use your work as a first "draft" of this feature, and we can build on top of it. Thanks for your time and effort!