Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-96689

Add support for validation of configuration when creating or importing fragments

    Details

      Description

      Context

      When web developers are defining the configuration of a fragment using the required JSON format, it is easy for them to make accidental mistakes. The purpose of this story is to provide validation of the configuration definition providing accurate information about any errors.

      Note: The FieldSet label should be optional and the field names must be unique.

      Acceptance Criteria

      1. Configuration validation with Fragment Toolkit with a valid configuration

      • Given a fragment with a valid configuration,
      • when the fragment is imported with the fragment toolkit, 
      • then the import succeeds
      • and the configuration is imported along with the fragment code.

      2. Configuration validation with Fragment Toolkit with an invalid configuration

      • Given a fragment with an invalid configuration,
      • when the fragment is imported with the fragment toolkit,
      • then the import fails
      • and an error message is show informing the developer of the error.

      3. Configuration validation in Fragment Editor with an invalid configuration is previewed

      • Given a fragment with an invalid configuration,
      • when the fragment is previewed in the preview pane,
      • then the preview pane shows an error message is show informing the developer of the error.

      4. Configuration validation in Fragment Editor with an invalid configuration cannot be saved

      • Given a fragment with an invalid configuration,
      • when the fragment is saved with the fragment toolkit,
      • then the save fails informing the user that there is an error**

      Technical details

      • It's recommended to use JSON schema to perform the validation

       

        Attachments

          Issue Links

          1.
          When deploying modules with contributed fragments take into account configuration to validate whether html field is syntactically correct Freemarker code and add only the valid fragments LPS-97702 Technical Task Closed Brian Chan  
          2.
          When Freemarker code cannot be rendered, indicate line and column causing the error in the Fragment Editor LPS-98571 Technical Task Closed Brian Chan  
          3.
          When fragment configuration is invalid, indicate line and column causing the error in the Error Message LPS-98714 Technical Task Closed Brian Chan  
          4.
          Validate configuration for programatic fragments LPS-99068 Technical Task Closed Brian Chan  
          5.
          Validate configuration fields of type text LPS-99162 Technical Task Closed Brian Chan  
          6.
          Validate configuration fields of type color palette LPS-99163 Technical Task Closed Brian Chan  
          7.
          Validate configuration fields of type checkbox LPS-99164 Technical Task Closed Brian Chan  
          8.
          Validate configuration fields of type itemSelector LPS-99165 Technical Task Closed Brian Chan  
          9.
          Validate configuration fields of type select LPS-99177 Technical Task Closed Brian Chan  
          10.
          Display validation error messages in fragment toolkit when importing fragments with invalid configuration LPS-99953 Technical Task Closed Pablo Molina  
          11.
          Product QA Test Creation LPS-100227 Technical Testing Closed Manoel Cyreno  
          12.
          Documentation: Fragment validation when creating/importing LPS-100314 Technical Documentation Closed Cody Hoag  
          13.
          Improve error information so it's more relevant for the user LPS-100388 Technical Task Closed Brian Chan  
          14.
          Improve error information on Toolkit so it's more useful for the user LPS-100412 Technical Task Closed Pablo Molina  
          15.
          Display correct line number of template when an error references a line LPS-100414 Technical Task Closed Brian Chan  
          16.
          Fragments with configuration with fields of type select with no dataType should render correctly LPS-100470 Technical Task Closed Brian Chan  
          17.
          Manual Testing LPS-100734 Technical Testing Closed Kyle Miho  

            Activity

              People

              Assignee:
              cody.hoag Cody Hoag
              Reporter:
              ruben.pulido Ruben Pulido
              Engineering Assignee:
              Ruben Pulido
              Recent user:
              Kiyoshi Lee
              Participants of an Issue:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Packages

                  Version Package
                  7.2.X
                  Master