Automatic conversion to SDC & UI Patterns 2.x

Created on 3 January 2024, 12 months ago
Updated 16 August 2024, 4 months 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_uswds
$ drush upu ui_suite_uswds

Remaining tasks

A few issues were found:

Unable to render component "ui_suite_uswds:table". A render array or a scalar is expected for the slot "header"
Unable to render component "ui_suite_uswds:social_links_group". A render array or a scalar is expected for the slot "items"
Unable to render component "ui_suite_uswds:footer". A render array or a scalar is expected for the slot "footer_social_links" 
Unable to render component "ui_suite_uswds:process_list". A render array or a scalar is expected for the slot "items"
Unable to render component "ui_suite_uswds:icon_list". A render array or a scalar is expected for the slot "items"
Unable to render component "ui_suite_uswds:collection_item". A render array or a scalar is expected for the slot "meta_items_list"

Because SDC is stricter about slots and props data structures than UI Patterns 1.x is with fields and settings. This need to be fixed before moving to UI Patterns 2.x

The one about table component is related to 🌱 What do we do with table rows and table cells data structure? Active and will also be done by h ui_suite_bootstrap β†’

πŸ“Œ Task
Status

Fixed

Version

4.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
  • Pipeline finished with Success
    12 months ago
    Total: 153s
    #71097
  • Status changed to Needs work 12 months ago
  • πŸ‡«πŸ‡·France pdureau Paris

    This issue has been fixed on UI Patterns 2.x side:

    Unable to render component "ui_suite_uswds:collection_item". A render array or a scalar is expected for the slot "meta_items_list"

    So let's remove it from the scope of this ticket.

    However, I have found another one:

    Unable to render component "ui_suite_uswds:language_selector". A render array or a scalar is expected for the  
             slot "items" when using the render element with the "#slots" property 

    I am suggesting:

      settings:
        items:
          type: links
          label: "Language buttons"
          preview:
            - title: English"
              url: "/"
              attributes:
                lang: en
            - title: Spanish"
              url: "/es"
              attributes:
                lang: es
            - title: French"
              url: "/fr"
              attributes:
                lang: fr

    Don't forget to change the Twig template too.

    And I doubt the lang attributes is expected in this example. According to https://designsystem.digital.gov/components/language-selector/ lang and xml:lang are expected when the label is in the targeted language, not when in English.

    Anyway, it is nice to manipulate the attributes object for each item, because it will be filled by Drupal if needed, and it is nice to duplicate the value for xml:lang as you already doing.

  • Pipeline finished with Success
    12 months ago
    Total: 203s
    #71855
  • Assigned to pdureau
  • Status changed to Postponed 11 months ago
  • πŸ‡«πŸ‡·France pdureau Paris

    i keep on my side, and will do a new conversion test when UI Patterns 2.x will hit a development milestone

  • Pipeline finished with Success
    11 months ago
    Total: 144s
    #87005
  • πŸ‡«πŸ‡·France pdureau Paris

    Monthly update: https://git.drupalcode.org/project/ui_suite_uswds/-/commit/5badac4cb9c97...

    Only one remaining issue:
    Unable to render component "ui_suite_uswds:table". A render array or a scalar is expected for the slot "header"

    Let's check what UI Suite Bootstrap is planning to do.

  • Pipeline finished with Success
    11 months ago
    Total: 256s
    #87130
  • Pipeline finished with Success
    9 months ago
    Total: 205s
    #137981
  • Pipeline finished with Failed
    9 months ago
    Total: 42s
    #137991
  • πŸ‡«πŸ‡·France mogtofu33

    Some minor errors left (detected with ui_patterns_devel):

    Component: ui_suite_uswds:in_page_nav
    [heading_selectors[0]] Does not have a value in the enumeration [2,3,4,5,6]
    [heading_selectors[1]] Does not have a value in the enumeration [2,3,4,5,6]
    Component: ui_suite_uswds:grid_row
    [card] Does not have a value in the enumeration [...]
    [mobile_lg] Does not have a value in the enumeration [...]
    [tablet_lg] Does not have a value in the enumeration [...]
    [desktop_lg] Does not have a value in the enumeration [...]
    [widescreen] Does not have a value in the enumeration [...]
    Component: ui_suite_uswds:button
    [url] NULL value found, but a string or an object is required. This may be because the property is empty instead of having data present. If possible fix the source data, use the |default() twig filter, or update the schema to allow multiple types.
  • Pipeline finished with Failed
    7 months ago
    Total: 45s
    #175855
  • πŸ‡«πŸ‡·France pdureau Paris

    Component: ui_suite_uswds:grid_row
    [card] Does not have a value in the enumeration [...]
    [mobile_lg] Does not have a value in the enumeration [...]
    [tablet_lg] Does not have a value in the enumeration [...]
    [desktop_lg] Does not have a value in the enumeration [...]
    [widescreen] Does not have a value in the enumeration [...]

    Already fixed on UI Patterns 2.x (legacy module) side.

    Component: ui_suite_uswds:in_page_nav
    [heading_selectors[0]] Does not have a value in the enumeration [2,3,4,5,6]
    [heading_selectors[1]] Does not have a value in the enumeration [2,3,4,5,6]

    Need to be fixed on UI Patterns 2.x (legacy module) side: cast the preview value according to the prop type.

    Component: ui_suite_uswds:button
    [url] NULL value found, but a string or an object is required. This may be because the property is empty instead of having data present. If possible fix the source data, use the |default() twig filter, or update the schema to allow multiple types.

    I don't understand because it looks OK:

        props:
          url: 'https://example.com'
  • Pipeline finished with Failed
    7 months ago
    Total: 41s
    #175864
  • Pipeline finished with Failed
    7 months ago
    Total: 42s
    #175884
  • Pipeline finished with Failed
    7 months ago
    Total: 42s
    #175896
  • Pipeline finished with Success
    5 months ago
    Total: 139s
    #220178
  • Status changed to Needs work 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
  • Status changed to Fixed 5 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Will open up some follow ups following internal testing

  • Merge request !80Draft: Resolve #3412077 "Test" β†’ (Closed) created by smustgrave
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024