Problem/Motivation

Today, we need to put the "#" prefix everywhere it is expected by the render API, and we are forced to put doublequote around those properties.

"#type": "pattern"
"#id": "grid_row"
"#fields":
  content:
    - "#type": "pattern_preview"
      "#id": "card"
      "#variant": "default"
   -  "#type": "html_tag"
      "#tag": "div"
      "#attributes":
        class:
          - py-5
          - bg-light
"#settings":
  with_container: true
  gutters: g-3

We need to be able to do that instead:

type: pattern
id: grid_row
fields:
  content:
    - type: pattern_preview
      id: card
      variant: default
   -  type: html_tag
      tag: div
      attributes:
        class:
          - py-5
          - bg-light
settings:
  with_container: true
  gutters: g-3

Proposed resolution

UI Patterns 2.0.x has a a methods which looks interesting:
ComponentElementAlter::processStoriesSlots()

Let's investigate

API changes

yes, but not breakable. Prefixed properties will still work

We also need to add a test

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

Issue summary: View changes
pdureau’s picture

Status: Active » Postponed

We may need to fix something in ComponentElementAlter::processStoriesSlots() before

pdureau’s picture

Once this issue is done, we can borrow the logic: #3477573: [2.0.0-beta4] Better stories slots processing

grimreaper’s picture

Version: 1.0.0-beta5 » 1.x-dev
Assigned: pdureau » grimreaper
pdureau’s picture

Status: Postponed » Active

grimreaper’s picture

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

Assigned: pdureau » Unassigned
Status: Needs review » Fixed

  • pdureau committed 1115b343 on 1.x authored by grimreaper
    Issue #3414730 by grimreaper, pdureau: Get rid of the mandatory #...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.