Test SDC conversion script and guide with demo_design_system/components/01-atoms/select

Created on 14 August 2024, about 1 month ago
Updated 9 September 2024, 9 days ago

Problem/Motivation

This issue is for Akhil Babu to test the SDC conversion script and the guide using:

  • demo_design_system/components/01-atoms/select

Steps to reproduce

Proposed resolution

Go through the conversion guide and try to convert the component using the script and report any feedback.

Remaining tasks

  • Review guide
  • Follow guide to use the script
  • Convert demo_design_system/components/01-atoms/select
  • Report feedback here

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
  • Assigned to Akhil Babu
  • Pipeline finished with Success
    about 1 month ago
    Total: 282s
    #257841
  • 🇮🇳India Akhil Babu Chengannur

    Here is the output after running the script

    name: Select
    
    status: experimental
    
    group: Atoms
    
    props:
    
      type: object
      required:
        - options
    
      properties:
        theme:
          type: string
          title: Theme
          description: 'Theme: light, dark.'
          default: light
          enum:
            - light
            - dark
    
        is_multiple:
          type: boolean
          title: Is multiple.
    
        options:
          type: array
          title: Options
          description: 'Options:'
          items:
            type: object
    
            properties:
              type:
                type: string
                title: Type
                description: 'Option type: option group (optgroup) or option (option).'
    
              label:
                type: string
                title: Label
                description: Option label.
    
              value:
                type: string
                title: Value
                description: Option value.
    
              selected:
                type: string
                title: Selected
                description: Flag whether option is selected.
    
              options:
                type: array
                title: Options
                description: 'Array of options (applies to optgroup type):'
    
        is_invalid:
          type: boolean
          title: Denote if the control is invalid.
    
        is_disabled:
          type: boolean
          title: Denote if the control is disabled.
    
        is_required:
          type: boolean
          title: Denote if the control is required.
    
        attributes:
          type: string
          title: Attributes
          description: Additional attributes.
    
        modifier_class:
          type: string
          title: Modifier class
          description: Additional classes.
    
    
  • 🇮🇳India Akhil Babu Chengannur
     *   - options: [array] Array of options (applies to optgroup type):
     *     - label: [string] Option label.
     *     - value: [string] Option value.
     *     - is_selected: [string] Flag whether option is selected.
     *     - is_disabled: [string] Flag whether option is disabled.
    

    The script didnot convert the properties inside the nested options field (Options -> Options). Current output is

    options:
      type: array
      title: Options
      description: 'Array of options (applies to optgroup type):'
    

    I think it should have been like

    options:
      type: array
      title: Options
      description: 'Array of options (applies to optgroup type):'
      items:
        label:
          type: string
          title: Label
          description: Option label.
    
        value:
          type: string
          title: Value
          description: Option value.
    
        is_selected:
          type: string
          title: Selected
          description: Flag whether option is selected.
    
        is_disabled:
          type: string
          title: Selected
          description: Flag whether option is disabled.
    
  • 🇮🇳India Akhil Babu Chengannur

    Also, fields like selected, options.options.is_selected, options.options.is_disabled are documented as string fields in the twig file. But shouldn't these be boolean fields? (The logic in the twig confirms the same)

    {% if sub_option.is_selected %}selected="selected"{% endif %} 
    {% if sub_option.is_disabled %}disabled{% endif %}
    
  • Issue was unassigned.
  • Status changed to Needs review 30 days ago
  • 🇮🇳India Akhil Babu Chengannur
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks 🙏 can you compare your work against the recent dev changes? There was just a commit of all baseline yaml and readme files. It would be helpful to compare your results against that to see if they align or the files should be updated with some of your suggestions

  • 🇮🇳India anand.toshniwal93

    I will check script today for above mentioned issue by Akhil.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Thanks!

  • 🇮🇳India Akhil Babu Chengannur
  • Status changed to Postponed 29 days ago
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Marking postponed until we have the updated script.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Looks like the script isn't quite right but we are leaving this postponed because we need to understand more about arrays and nesting in the yaml files before moving forward.

  • Status changed to Fixed 9 days ago
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I don't think we'll update the script in the future at this point (TBD) and we need to wait on XB to support arrays:

    🐛 Arrays in SDDS SDC YAMLs are causing fatal errors in XB Postponed

    so closing this as fixed for the testing. Thanks!

Production build 0.71.5 2024