Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-2314

Conditional option doesn't properly reset values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • 1.7.0, 1.7.1, 1.7.2, 1.8.0
    • Software Templates
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • Moderate

      Description of problem:

      Selecting conditional option doesn't properly reset values depending on another condition.

      Prerequisites (if any, like setup, operators/versions):

      Register the following template 

       

      apiVersion: scaffolder.backstage.io/v1beta3
      kind: Template
      metadata:  
        name: conditional-fields
        title: Conditional fields
        description: Test conditional fields 
      spec:
        parameters:
          - title: Fill in some steps
            properties:
              condition:
                type: string
                enum:
                  - A
                  - B
                ui:widget: radio
                ui:options:
                  inline: true
            dependencies:
              condition:
                allOf:
                  - if:
                      properties:
                        condition:
                          const: A
                    then:
                      properties:
                        extraOption:
                          title: Extra option for A
                          type: string
      steps:
          - id: log-extraOption      
            name: Print extraOption
            action:
            debug:log 
            input: 
              message: Condition ${{ parameters.extraOption }}      
      output:
        text:
        - title: Success
          content: "Template completed"

       

       

       

      Steps to Reproduce

      1.  start the template
      1. choose condition A
      2. fill extra option
      3. choose condition B
      4. run the template

      Actual results:

      log-extraOption print the value inserted into the field extraOption before changing condition to B 

      Expected results:

      log-extraOption step print an empty string for extraOption

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

      Here the ISSUE on the upstream project

      https://github.com/backstage/backstage/issues/27872

              Unassigned Unassigned
              rh-ee-mbertuzz Manuel Bertuzzi
              RHIDP - Cope
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: