8000 Extract palette and boxes building in data container by aschempp · Pull Request #8285 · contao/contao · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Extract palette and boxes building in data container #8285

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

Open
wants to merge 7 commits into
base: 5.x
Choose a base branch
from

Conversation

aschempp
Copy link
Member

This continues my quest to simplify and unify the data containers.

Palettes and boxes currently generate a lot of duplicate code and inconsistencies in all three (DC_Table, DC_Folder, DC_File) data containers. They are not 100% identical, so this implementation makes sure it is consistent with DC_Table.

It also adds preliminary support for named palettes for DC_Folder (because of unified code), which might be useful e.g. to have a palette for a specific file type. I have not manually tested this though! It also would support legends when editing files (since they are parsed), but I have not implemented rendering them in DC_Folder itself (since it didn't exist). Let me know if I should add that.

@aschempp aschempp added this to the 5.6 milestone Apr 16, 2025
@aschempp aschempp requested a review from a team April 16, 2025 07:06
@aschempp aschempp self-assigned this Apr 16, 2025
@aschempp aschempp requested a review from leofeyer as a code owner April 16, 2025 07:06
@Toflar
Copy link
Member
Toflar commented Apr 16, 2025

I would argue that we don't add anything at all to DC_Folder anymore. A Turbo-based file manager would render it useless anyway.

@aschempp
Copy link
Member Author

I agree that's a reason not to (currently) add legend support. But a turbo-based file manager should also allow me to render (custom) fields possibliy in palettes, maybe from a DCA? Since everything in Contao works that way? But that's a discussion for a different ticket :)

@aschempp
Copy link
Member Author

I have an incredible new feature idea that would require this PR. CS and tests fixed now. I hope this can make it into 5.6? 🙃

Copy link
Member
@Toflar Toflar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested if things still work like before but I'd argue that we can still fix things. This is already a win because it moves logic from the behemoths that are the DC_* classes to a separate service which is now even covered by tests. So this is a 👍 for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0