Problem/Motivation

In Display builder we print the settings value of a component in the Layers panel (and could be some other places).
Currently the ComponentSource provide only the id and variant name.

On display builder it's a simple flattening of the array if not nested as you can see here.

It's a starting point good enough, could handle nested settings source (like icons) a bit better, but I think it's an edge case, for most source we just want the first level key => value to text.

Steps to reproduce

Proposed resolution

Implement the buildComponentSettingItem() from display builder in ComponentSource().

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mogtofu33 created an issue.

pdureau’s picture

Once #3571009: Add SourceWithSlotsInterface and LayoutSource is done on UI Patterns side, we will remove ComponentSource from Display Builder codebase. So we must also do this change.

However, let's not take the current implementation of ComponentSource::settingsSummary() from Display Builder where:

  • The main logic is a bit heavy and split in ::processProperty(), ::processStandardProperty(), ::normalizeValue(), ::flattenArrayToString()
  • There is also some logic related to UI Styles: ::formatUiStyleSummary(), ::isUiStyleAttribute()

Instead of all this, can we try to implement ComponentSource::settingsSummary() by simply looping on the prop sources and aggregate each source implementation of SourceInterface::settingsSummary().

The part about UI Styles will reside in ui_styles_attributes source plugin.