[5.1.x] Automatic conversion to SDC & UI Patterns 2.x

Created on 3 January 2024, 5 months ago
Updated 18 May 2024, 29 days ago

Problem/Motivation

Let's start to run the automatic conversion to SDC and UI Patterns 2.x, as provided by the new ui_patterns_legacy sub-module.

Proposed resolution

Run:

$ drush en ui_patterns_legacy
$ drush upm ui_suite_bootstrap
$ drush upu ui_suite_bootstrap

Remaining tasks

There is only one issue found so far:

Unable to render component "ui_suite_bootstrap:table". A render array or a scalar is expected for the slot "header".

Because SDC is stricter about slots and props data structures than UI Patterns 1.x is with fields and settings.
This is related to 🌱 What do we do with table rows and table cells data structure? Active

This need to be fixed before moving to UI Patterns 2.x

πŸ“Œ Task
Status

Postponed

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

Merge Requests

Comments & Activities

  • Issue created by @pdureau
  • Status changed to Needs work 5 months ago
  • πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

    Thanks!

  • e0ipso Can Picafort

    I see some of the stories are plain text for the slot content. I would love to see them with HTML markup to ensure they are not improperly escaped.

  • πŸ‡«πŸ‡·France mogtofu33

    There is a bit more errors, currently hidden by the ComponentValidator throwing an error.

    Component: ui_suite_bootstrap:dropdown
    [content[5].title] Integer value found, but a string is required
    [dropdown_menu_start] Does not have a value in the enumeration ["start","sm-start","md-start","lg-start","xl-start","xxl-start"]
    [dropdown_menu_end] Does not have a value in the enumeration ["end","sm-end","md-end","lg-end","xl-end","xxl-end"]
    Component: ui_suite_bootstrap:grid_row
    [gutters_horizontal] Does not have a value in the enumeration ["gx-0","gx-1","gx-2","gx-3","gx-4","gx-5"]
    [gutters_vertical] Does not have a value in the enumeration ["gy-0","gy-1","gy-2","gy-3","gy-4","gy-5"]
    [col_xs] Does not have a value in the enumeration ["col-1","col-2","col-3","col-4","col-5","col-6","col-7","col-8","col-9","col-10","col-11","col-12"]
    [col_sm] Does not have a value in the enumeration ["col-sm-1","col-sm-2","col-sm-3","col-sm-4","col-sm-5","col-sm-6","col-sm-7","col-sm-8","col-sm-9","col-sm-10","col-sm-11","col-sm-12"]
    [col_lg] Does not have a value in the enumeration ["col-lg-1","col-lg-2","col-lg-3","col-lg-4","col-lg-5","col-lg-6","col-lg-7","col-lg-8","col-lg-9","col-lg-10","col-lg-11","col-lg-12"]
    [col_xl] Does not have a value in the enumeration ["col-xl-1","col-xl-2","col-xl-3","col-xl-4","col-xl-5","col-xl-6","col-xl-7","col-xl-8","col-xl-9","col-xl-10","col-xl-11","col-xl-12"]
    [col_xxl] Does not have a value in the enumeration ["col-xxl-1","col-xxl-2","col-xxl-3","col-xxl-4","col-xxl-5","col-xxl-6","col-xxl-7","col-xxl-8","col-xxl-9","col-xxl-10","col-xxl-11","col-xxl-12"]
    [spacing_margin_bottom] Does not have a value in the enumeration ["mb-0","mb-1","mb-2","mb-3","mb-4","mb-5","mb-auto"]
    Component: ui_suite_bootstrap:dropdown
    [content[5].title] Integer value found, but a string is required
    Component: ui_suite_bootstrap:dropdown
    [button_attributes] String value found, but an object is required

    I suggest adding a devel module on UI Patterns ✨ Feature for dev, better ComponentValidator Needs review to see all errors and ease devel.

  • πŸ‡«πŸ‡·France pdureau Paris

    Thanks a lot for this comment.

    UI Patterns 2 scope

    Component: ui_suite_bootstrap:dropdown: [content[5].title]

    We may need to remove required: title from links prop type schema in UI Patterns 2.x: https://git.drupalcode.org/project/ui_patterns/-/blob/2.0.x/src/Plugin/U...

     *   schema = {
     *     "type": "array",
     *     "items": {
     *       "type": "object",
     *       "properties": {
     *         "title": {"type": "string"},
     *         "url": { "$ref": "ui-patterns://url" },
     *         "attributes": { "$ref": "ui-patterns://attributes" },
     *         "link_attributes": { "$ref": "ui-patterns://attributes" },
     *         "below": { "type": "array", "items": { "type": "object" } }
     *       },
     *       "required": {"title"}
     *     }
     *   }

    But this required property may be necessary to not catch any array of objects. So we may add an anyOf with the 2 situations:

    • empty object
    • object with required title

    Component: ui_suite_bootstrap:dropdown: "Does not have a value in the enumeration"
    Component: ui_suite_bootstrap:grid_row: "Does not have a value in the enumeration"

    We may need to add a rule in UI Patterns 2.x legacy converter to not add a prop in a story if the preview value is not in the enumeration. Wr may also skip a prop in a story if the preview value resolve to false? (it is the case of all props in this example).

    UI Suite Bootstrap scope

    Component: ui_suite_bootstrap:dropdown: "Does not have a value in the enumeration"
    Component: ui_suite_bootstrap:grid_row: "Does not have a value in the enumeration"

    We can keep this ticket to also fix upstream ui_suite_bootstrap 1.x code.

  • πŸ‡«πŸ‡·France pdureau Paris

    Component: ui_suite_bootstrap:dropdown: "Does not have a value in the enumeration"
    Component: ui_suite_bootstrap:grid_row: "Does not have a value in the enumeration"

    Fixed

  • Assigned to pdureau
  • Status changed to Postponed 29 days ago
  • πŸ‡«πŸ‡·France pdureau Paris
Production build 0.69.0 2024