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_extra branch 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.

CommentFileSizeAuthor
#4 example_styles.jpg31.83 KBmogtofu33

Issue fork ui_styles-3616763

Command icon 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

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs work » Needs review
mogtofu33’s picture

StatusFileSize
new31.83 KB

Here is an exemple of summary rendered.

Example styles

grimreaper’s picture

Assigned: Unassigned » grimreaper

grimreaper’s picture

Version: 8.x-1.x-dev » 2.x-dev
Category: Task » Feature request

  • grimreaper committed 1fe5dc5b on 2.x
    feat: #3616763 Add settingsSummary() to the ui_styles_attributes source...

  • grimreaper committed 2bc239e1 on 8.x-1.x authored by mogtofu33
    feat: #3616763 Add settingsSummary() to the ui_styles_attributes source...
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs review » Fixed

Merged.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.