
Problem/Motivation
Display overview of the styles and layouts.
Proposed resolution
So the starting point here is some "Paragraphs Collection" admin - reports page. That page will have two tabs: Layouts, Styles.
And later more with more discoveries. We need this for better design consistency.
Columns should be:
- Style icon
- Style name
- Style description
Provide UI screenshots
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#23 | layout_and_styles-2860820-23.patch | 22.67 KB | VladimirMarko |
#23 | interdiff-2860820-21-23.txt | 893 bytes | VladimirMarko |
#23 | layout_and_styles-2860820-23-test-only.patch | 2.75 KB | VladimirMarko |
#14 | Layouts overview 2.png | 55.91 KB | VladimirMarko |
#13 | Styles overview.png | 35.99 KB | VladimirMarko |
Comments
Comment #2
ginovski CreditAttribution: ginovski at MD Systems GmbH commentedComment #3
ginovski CreditAttribution: ginovski at MD Systems GmbH commentedComment #4
VladimirMarko CreditAttribution: VladimirMarko commentedComment #5
VladimirMarko CreditAttribution: VladimirMarko commentedThis is my progress thus far.
Comment #6
VladimirMarko CreditAttribution: VladimirMarko commentedAdded functions to get from grid layouts to entities in which those layouts are being used.
Comment #7
VladimirMarko CreditAttribution: VladimirMarko commentedDeleted all Paragraph entities stuff. Added functions for styles.
Comment #8
miro_dietikerThis is an admin UI feature, please provide a screenshot of the UI.
I think we should generalise this method to getParagraphTypesWithPlugin($plugin_id)
Comment #9
VladimirMarko CreditAttribution: VladimirMarko commentedWork in progress. I still need to add the right classes to the table entries.
Comment #10
ginovski CreditAttribution: ginovski at MD Systems GmbH commentedThere is a followup for this #2860830: Add group filter in the layout and style overview page, we can move everything associated with filters in that issue and keep it simple here.
The description should be more general, since there might be some new plugins in the overview. Maybe something like:
"Overview of the behavior plugins"
We can drop the (grid layout plugin) and (styles plugin)
Comment #11
VladimirMarko CreditAttribution: VladimirMarko commentedWork in progress. The styles overview is now working nicely. I will work on refactoring the grid layout overview code into the working styles code now.
@Ginovski
I will make the generalization changes later. Everything #2860830: Add group filter in the layout and style overview page wants is already in this patch, however. I am not going to split it anymore. That would mean far too much useless refactoring.
Comment #12
miro_dietikerYeah, let's try to avoid changing the goal. Just complete the current scope properly.
Basic test coverage is still a must to get this in. To speedup, we could do JS tests in a follow-up.
Eliminate the term Sensor.
IMHO these permissions are pretty fine.
Comment #13
VladimirMarko CreditAttribution: VladimirMarko commentedThe styles and the layouts overview now both look nice and the search is functional everywhere.

Moving on to writing the tests.
Comment #14
VladimirMarko CreditAttribution: VladimirMarko commentedFixed wrong labeling in the layouts overview.

Comment #15
miro_dietikerBetter make an example.
What are discoverable items?
This method calls a different method that delivers two pretty much different things based on a string argument.
Instead, the called method should deliver what is uniform and the caller should do the specific things.
All these switches should not exist.
Do not create methods that do two different things based on an argument.
Instead, put parts that are similar code-wise and outsource them in a method you call.
Comment #16
VladimirMarko CreditAttribution: VladimirMarko commentedComment #17
VladimirMarko CreditAttribution: VladimirMarko commentedAdded a test. Removed all the
switch
statements and broke up both affected methods into two methods each.Comment #19
primsi CreditAttribution: primsi at MD Systems GmbH for MD Systems GmbH commentedBoth this files are actually used in admin context, so I would do overview.admin.js
Commented out code.
IMHO we could just add an example and shorten this text.
Ordered or grouped?
Same here, an example would be helpful.
I think ParagraphsType::loadMultiple() should do it here.
Maybe I am not getting something but, do we need the list built by get*OrderedBy... elsewhere too? If it's only here shouldn't we rather have a list of behavior ids as keys and paragraph types that use them as values? If that's the case we could get rid of a some of the above methods. Also if we load multiple and store them there I think we wont need to load them separately here.
Just implode the list where you use it.
I think you could use container instead of markup.
Not sure if this needs escaping, doesn't twig do that for us already?
Description should be translatable elsewhere. If it's not an issue should be opened. Also Details should probably be "Description not available" imho.
Same remark about escaping and use of container as above
If that's meant to be above, let's move filters to the top of this method.
Given that the styles method is quite similar same remarks as for the grid one apply.
Comment #20
VladimirMarko CreditAttribution: VladimirMarko commented8. That wouldn't work. I need the
'#plain_text'
keys for it to be rendered correctly inside the table.10.
'#markup'
always needs escaping. However, it's no longer an issue here, as I removed all the occurrences from the current patch.11. I have created a new issue to make the descriptions (and titles) translatable: #2867856: Titles and descriptions of grid layouts and styles are not being translated
I implemented all the other suggestions.
Comment #21
VladimirMarko CreditAttribution: VladimirMarko commentedRe-roll.
Comment #23
VladimirMarko CreditAttribution: VladimirMarko at MD Systems GmbH commentedAdjusted the test to accommodate a change to the present grid layouts.
Comment #26
primsi CreditAttribution: primsi at MD Systems GmbH for MD Systems GmbH commentedComment #27
primsi CreditAttribution: primsi at MD Systems GmbH for MD Systems GmbH commentedOverlooked "To speedup, we could do JS tests in a follow-up.", re-opening. Please close when the follow up is created
Comment #28
miro_dietikerLooks pretty nice. Committed as is.
Back to needs-work to discuss the missing steps and create all follow-ups. Then plz close.
Follow-up: If i limit the grid paragraph type in paragraphs_collection_demo to two layouts, all others disappear. Layouts without usage should also be listed. Same for the group.
Follow-up: Should we remove the term "Grid" completely from the layout plugin? Can we really only handle grids? Not yet sure.
If not, i think we should be clear that the tab list Grid layouts, not layouts in general.
We need a meta about evolving the management UI of layout and grid. All related features should be grouped there. For instance, also the creating of new groups through the UI.
Comment #29
ginovski CreditAttribution: ginovski at MD Systems GmbH commentedAdded followups #2869297: Create JS Tests for layout and style overview page, #2869309: Allow styles without groups in the behavior form, #2869306: Display grid layouts and styles without usage in the overview page.
Also a suggestion issue:
#2869316: Add column count filter for the layouts in overview page
Comment #30
ginovski CreditAttribution: ginovski at MD Systems GmbH commentedCreated the meta issue for UI improvement #2869318: [META] Improve UI of the layout and styles overview page and the grid layout label #2869322: Label of the grid layout plugin