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 #3407218: What do we do with table rows and table cells data structure? and will also be done by hui_suite_bootstrap

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

Status: Active » Needs work

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.

pdureau’s picture

Assigned: Unassigned » pdureau
Status: Needs work » Postponed

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

pdureau’s picture

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.

mogtofu33’s picture

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.
pdureau’s picture

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]

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

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'
smustgrave’s picture

Status: Postponed » Needs work

  • smustgrave committed f50c9631 on 4.0.x
    Issue #3412077: Automatic conversion to SDC & UI Patterns 2.x
    
smustgrave’s picture

Version: 3.0.x-dev » 4.0.x-dev
Status: Needs work » Fixed

Will open up some follow ups following internal testing

Status: Fixed » Closed (fixed)

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