Problem/Motivation
The ui_styles_attributes source plugin (Drupal\ui_styles_ui_patterns\Plugin\UiPatterns\Source\AttributesStyles) does not implement settingsSummary(). Any UI listing sources by their summary shows nothing for it, even when styles are selected.
Related: #3568363 in UI Patterns, which aggregates each source's settingsSummary() into the component summary.
Steps to reproduce
- Enable
ui_styles_ui_patterns. - On a component prop of type
attributes, pick the Styles source and select a few styles. - The source has no summary, while other sources report theirs.
Proposed resolution
Implement settingsSummary() in AttributesStyles: inject plugin.manager.ui_styles, read the styles setting, and return the selected options labels.
Both config structures are handled: the legacy _ui_styles_extra shape via UiStylesUtility::extractSelectedStyles(), and the current selected key. Unknown style plugins are skipped; an unknown option falls back to its raw id.
Remaining tasks
- Review the MR.
- Decide whether the legacy
_ui_styles_extrabranch is worth keeping here, or dropped with the rest in UI Styles 2.
User interface changes
The Styles source now reports a summary of the selected style options.
API changes
None. AttributesStyles gains a constructor and create(); the plugin is not meant to be instantiated directly.
Data model changes
None.
| Comment | File | Size | Author |
|---|
Issue fork ui_styles-3616763
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 #3
mogtofu33 commentedComment #4
mogtofu33 commentedHere is an exemple of summary rendered.
Comment #5
grimreaperComment #7
grimreaperComment #10
grimreaperMerged.
Thanks!