Problem/Motivation
As a site builder, I want to have a visual representation of the libraries that are attached within the template so that I can have a clear picture of things affecting this page.
Proposed resolution
Add a libraries widget to the component_override entity form. The imported twig file should be scanned for library attachments and the widget should visualize those libraries and allow manipulating/extending the libraries attached to the component_override. When the component_override is rendered, the libraries should be attached. The libraries should not be displayed inside the template editor on the component_override form.
User interface changes
- These attachments should be visualized within the component_override entity form as a new field on the Component Override entity.
- This field should be populated with the discovered libraries from the template
- Existing libraries from the core libraries api should be able to be selected and added to this form element(s)
- Element should be multi-value
- Element should support removing libraries from the override
Data model changes
Add a libraries property (array) to the component_override config entity.
Issue fork component_library-3262430
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
s_leu commentedComment #4
s_leu commentedI couldn't change the MR target branch on the MR created automatically on the issue fork, so I filed a custom MR that can be used to review the changes relevant for this issue against the changes of the parent issue here: https://git.drupalcode.org/issue/component_library-3259011/-/merge_reque...
Comment #5
tim bozeman commentedThe changes from #3259011: Add Component Overrides have been merged to the 1.0.x branch. Maybe just rebasing would make it easier to review ¯\_(ツ)_/¯
Comment #6
fabianx commentedI would probably attach the libraries in front of the template - just because that's usually the convention where to do that.
Comment #7
heddnLet's rebase the MR so it is easier to review.
Comment #8
s_leu commentedThe branch is rebased now and the MR ready for merging. Unfortunately I was unable to get tests running locally, thus I didn't add the code extending the tests in the main branch of the MR, but pushed it here: https://git.drupalcode.org/issue/component_library-3262430/-/tree/326243...
Comment #9
tim bozeman commentedThe Override Mode UI is about ready so, I rebased this branch against #3264776: Add an Override Mode UI. It seems to be working, but do you want to double check I didn't break anything @s_leu?
Comment #10
tim bozeman commentedRebased again against 1.0.x.
Comment #11
s_leu commentedThanks for the rebases @Tim Bozeman . I checked it and made some changes, mainly dropping obsolete code that got obsolete after the rebase and the changes it introduced. Everything is still working as expected, so this is ready for another review by someone else. Or should we RTBC it already?
Comment #13
tim bozeman commentedVery nice. Thanks!
Comment #14
tim bozeman commented