Problem/Motivation

Following #3511112: [2.0.1] Make Componenent element builder alterable, the hook is used in Display Builder with a custom _third_party_settings property.

Proposed resolution

Let's make this property official by introducing:

    third_party_settings:
      type: mapping
      label: 'Third party settings'

Remaining tasks

However, this proposal is different from other definitions in Core:

layout_builder.section:
  type: mapping
  label: 'Layout section'
  mapping:
    ...
    third_party_settings:
      type: sequence
      label: 'Third party settings'
      sequence:
        type: '[%parent.%parent.%type].third_party.[%key]'
config_entity:
  type: mapping
  mapping:
    ...
    third_party_settings:
      requiredKey: false
      type: sequence
      label: 'Third party settings'
      sequence:
        type: '[%parent.%parent.%type].third_party.[%key]'

Is it also the opportunity to be more complaint with Core usage?

API changes

Display Builder will need to update _third_party_settings to third_party_settings and maybe change the structure.

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

pdureau created an issue. See original summary.

pdureau’s picture

Title: [2.0.7] Add third_party_settings to ui_patterns_slot_source schema » [2.0.8] Add third_party_settings to ui_patterns_slot_source schema
Assigned: pdureau » grimreaper
Status: Active » Needs review

@grimreaper: Let's talk about that because you are the config schema fan.

grimreaper’s picture

Assigned: grimreaper » pdureau
Status: Needs review » Needs work
pdureau’s picture

Assigned: pdureau » grimreaper
Status: Needs work » Needs review

Fixed.

What about this question: Is it OK this proposal is different from other definitions in Core?

layout_builder.section:
  type: mapping
  label: 'Layout section'
  mapping:
    ...
    third_party_settings:
      type: sequence
      label: 'Third party settings'
      sequence:
        type: '[%parent.%parent.%type].third_party.[%key]'
config_entity:
  type: mapping
  mapping:
    ...
    third_party_settings:
      requiredKey: false
      type: sequence
      label: 'Third party settings'
      sequence:
        type: '[%parent.%parent.%type].third_party.[%key]'
grimreaper’s picture

Assigned: grimreaper » pdureau
Status: Needs review » Needs work
theme_settings:
  type: config_object
  mapping:
...
    third_party_settings:
      # Third party settings are always optional: they're an optional extension
      # point.
      requiredKey: false
      type: sequence
      label: 'Third party settings'
      sequence:
        type: theme_settings.third_party.[%key]

I was not aware theme settings also got third_party_settings, thinking about ui_styles_entity_status, ui_skins....

field_formatter:
  type: mapping
  label: 'Field formatter'
  mapping:
...
    third_party_settings:
      # Third party settings are always optional: they're an optional extension
      # point.
      requiredKey: false
      type: sequence
      label: 'Third party settings'
      sequence:
        type: field.formatter.third_party.[%key]
core.entity_form_display.*.*.*:
  type: config_entity
  label: 'Entity form display'
  mapping:
...
    content:
      type: sequence
      label: 'Field widgets'
      sequence:
        type: mapping
        label: 'Field widget'
        mapping:
 ...
          third_party_settings:
            # Third party settings are always optional: they're an optional extension
            # point.
            requiredKey: false
            type: sequence
            label: 'Third party settings'
            sequence:
              type: field.widget.third_party.[%key]

I think it is ok to not have automatically type: '[%parent.%parent.%type].third_party.[%key]', but in the current state, the sequence type needs to be specified.

pdureau’s picture

Assigned: pdureau » Unassigned
Status: Needs work » Postponed

We can do this:

--- a/config/schema/ui_patterns.schema.yml
+++ b/config/schema/ui_patterns.schema.yml
@@ -67,6 +67,12 @@ ui_patterns_slot_source:
     third_party_settings:
       type: sequence
       label: 'Third party settings'
+      sequence:
+        type: ui_patterns_slot_source.third_party_setting.[%key]
     _weight:
       type: weight
       label: 'Slot source weight'

And then do this in UI Patterns:

ui_patterns_slot_source.third_party_setting.ui_styles:
  label: 'UI Styles settings'
  type: ui_styles.selected_mapping
pdureau’s picture

Title: [2.0.8] Add third_party_settings to ui_patterns_slot_source schema » [2.0.9] Add third_party_settings to ui_patterns_slot_source schema
Status: Postponed » Active
pdureau’s picture

Title: [2.0.9] Add third_party_settings to ui_patterns_slot_source schema » Add third_party_settings to ui_patterns_slot_source schema
pdureau’s picture

just_like_good_vibes made their first commit to this issue’s fork.

just_like_good_vibes’s picture

Assigned: Unassigned » grimreaper

hello Florent, can you tell us if it would be good to merge. i was not sure if discussions were finished or not for this issue.

grimreaper’s picture

Status: Active » Needs review
grimreaper’s picture

Assigned: grimreaper » just_like_good_vibes
Status: Needs review » Reviewed & tested by the community

Config schema problem on Display Builder side, as it ignores too much stuff.

So I manually added third_party_settings in a ui_patterns_block and checked with config_inspector.

I pushed a small change which is now ok for me.

UIP2 still has a lot of config schema problem due to ignores too. But this will be for another issue.

So currently pipeline is blocked due to the Core security release of this evening. But it is RTBC for me.

I let you re-trigger the pipeline when you will want to merge it.

Thanks!