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 Technical Task Closed Brian Chan  
          2.
          When Freemarker code cannot be rendered, indicate line and column causing the error in the Fragment Editor Technical Task Closed Brian Chan  
          3.
          When fragment configuration is invalid, indicate line and column causing the error in the Error Message Technical Task Closed Brian Chan  
          4.
          Validate configuration for programatic fragments Technical Task Closed Brian Chan  
          5.
          Validate configuration fields of type text Technical Task Closed Brian Chan  
          6.
          Validate configuration fields of type color palette Technical Task Closed Brian Chan  
          7.
          Validate configuration fields of type checkbox Technical Task Closed Brian Chan  
          8.
          Validate configuration fields of type itemSelector Technical Task Closed Brian Chan  
          9.
          Validate configuration fields of type select Technical Task Closed Brian Chan  
          10.
          Display validation error messages in fragment toolkit when importing fragments with invalid configuration Technical Task Closed Pablo Molina  
          11.
          Product QA Test Creation Technical Testing Closed Manoel Cyreno  
          12.
          Documentation: Fragment validation when creating/importing Technical Documentation Closed Cody Hoag  
          13.
          Improve error information so it's more relevant for the user Technical Task Closed Brian Chan  
          14.
          Improve error information on Toolkit so it's more useful for the user Technical Task Closed Pablo Molina  
          15.
          Display correct line number of template when an error references a line Technical Task Closed Brian Chan  
          16.
          Fragments with configuration with fields of type select with no dataType should render correctly Technical Task Closed Brian Chan  
          17.
          Manual Testing Technical Testing Closed Kyle Miho  

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  7.2.X
                  Master