Test UI Suite SDC validator for SDDS project

Created on 6 August 2024, 8 months ago
Updated 21 August 2024, 8 months ago

Problem/Motivation

We need SDC validation, and UI Suite β†’ has created an SDC validator because they are converting themes to SDC.

There is one outstanding issue:

πŸ› [2.0.0-beta1] Component validator: Add blocks and attributes to variables checks Needs review

Steps to reproduce

Proposed resolution

Test the UI Suite SDC validator.

Remaining tasks

  • Install, review and test
  • Create follow up issues for integration and docs

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

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

Comments & Activities

  • Issue created by @Kristen Pol
  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    This is working!

    kristens-mbp-2:ui_patterns_devel kristenpol$ dddr ui-patterns:validate starshot_demo starshot_demo:button
     [notice] Start validation of starshot_demo...
     ---------------------- ---------- ---------------------------------------------------------------------------- -------- ------ ------------------------------------------------------------- 
      Component              Severity   Message                                                                      Type     Line   Source                                                       
     ---------------------- ---------- ---------------------------------------------------------------------------- -------- ------ ------------------------------------------------------------- 
      starshot_demo:button   Notice     You should declare a story in                                                Schema   -                                                                   
                                        the definition.                                                                                                                                           
      starshot_demo:button   Error      Missing type for this                                                        Schema   16     theme:                                                       
                                        property.                                                                                                                                                 
      starshot_demo:button   Warning    Gray list Twig filter:                                                       Twig     28     {% set type_class = type ? 'ct-button--%s'|format(type) :    
                                        `format`.                                                                                    '' %}                                                        
      starshot_demo:button   Warning    Gray list Twig filter:                                                       Twig     29     {% set kind_class = kind ? 'ct-button--%s'|format(kind) :    
                                        `format`.                                                                                    '' %}                                                        
      starshot_demo:button   Warning    Gray list Twig filter:                                                       Twig     30     {% set size_class = 'ct-button--%s'|format(size) %}          
                                        `format`.                                                                                                                                                 
      starshot_demo:button   Error      Unknown variable:                                                            Twig     31     {% set dismiss_class = is_dismissable ?                      
                                        `is_dismissable`.                                                                            'ct-button--dismiss' : '' %}                                 
      starshot_demo:button   Warning    Gray list Twig filter:                                                       Twig     33     {% set theme_class =                                         
                                        `format`.                                                                                    'ct-theme-%s'|format(theme|default('light')) %}              
      starshot_demo:button   Warning    Gray list Twig filter:                                                       Twig     34     {% set modifier_class = '%s %s %s %s %s %s                   
                                        `format`.                                                                                    %s'|format(theme_class, type_class, kind_class, size_class,  
                                                                                                                                     dismiss_class, is_external, modifier_class|default('')) %}   
      starshot_demo:button   Warning    Use slots instead of hard
    embedding a component in the
    template with `includ   Twig     39     {% include '@base/icon/icon.twig' with {                     
                                        e`.                                                                                                                                                       
      starshot_demo:button   Warning    Use slots instead of hard
    embedding a component in the
    template with `includ   Twig     64     {% include '@base/icon/icon.twig' with {                     
                                        e`.                                                                                                                                                       
      starshot_demo:button   Error      The exact same as just                                                       Twig     75     {% if attributes is not empty %}{{- attributes|raw -}}{%     
                                        testing the variable, empty                                                                  endif %}                                                     
                                        is not needed.                                                                                                                                            
      starshot_demo:button   Error      The exact same as just                                                       Twig     87     {% if attributes is not empty %}{{- attributes|raw -}}{%     
                                        testing the variable, empty                                                                  endif %}                                                     
                                        is not needed.                                                                                                                                            
      starshot_demo:button   Error      The exact same as just                                                       Twig     98     {% if attributes is not empty %}{{- attributes|raw -}}{%     
                                        testing the variable, empty                                                                  endif %}                                                     
                                        is not needed.                                                                                                                                            
     ---------------------- ---------- ---------------------------------------------------------------------------- -------- ------ ------------------------------------------------------------- 
    
    
  • Issue was unassigned.
  • Status changed to Fixed 8 months ago
  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    To install and run:

    ddev composer require 'drupal/ui_patterns:2.0.x-dev@dev'
    ddev drush en ui_patterns_devel
    ddev drush ui-patterns:validate starshot_demo starshot_demo:button
    

    There will be follow up issues to document and start using this.

  • πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

    Following up with Pierre on these and adding some notes from him:

    We can ignore these:

    1. You should declare a story in the definition

    this is a message specific to components authors targeting UI Patterns (which is SDC + a few additions) We will add a annotation to precise that in the message

    2. Gray list Twig filter: format

    means it is in WIP, not put in black list nor white list yet. The "grey list" will disappear step by step, when we add coverage of the Twig function and filters

    3. more coming soon [will edit this comment]

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

Production build 0.71.5 2024