Pattern preview: no unecessary lists

Created on 27 March 2023, over 1 year ago

Problem/Motivation

There are many patterns fields where the example is a list of renderables although a single renderable is expected:

     image:
       label: "Image"
       description: "Card image."
       preview:
        - theme: "image"
          uri: "assets/card-image.svg"
          alt: "© 2017 John Smith photography"

Or although a single renderable is enough:

       label: "Content"
       description: "The quote"
       preview:
        - type: html_tag
          tag: p
          value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante."
          attributes:
            class:
              - "mb-0"

List of renderables are renderables, so it works as expected, but it may be confusing for contributors.

Proposed resolution

Flatten the structure. Push directly for 4.x, do a MR for 5.x

📌 Task
Status

Fixed

Version

5.0

Component

Code

Created by

🇫🇷France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024