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

As a fragment developer I want to be able to specify validation rules for the configuration text field

    Details

      Description

      Currently, the text field in the fragment configuration allows the developer to select the type of the value (numeric, string..) But there is no option to validate the content in some way, like min-max value, regex, etc.

      As a developer I would to validate the content value type of a fragment configuration text field with the following rules:

      • email
      • number
      • url
      • pattern (with regex)

      the validation should happen in the front end and in the back end.

      More technically this story include additional properties available in the configuration definition.
      Specifically when defining a configuration field of type text, you can include inside the typeOptions property, a new property, validation, with the following structure:

      It has a mandatory key type which indicates the html validation to be used and also enables other properties to constraint the validation more. For all of them you can include an errorMessage that will be displayed when

      • When type is number,  you can also constrain the min and the max value
      • When type is text, you can also constrain the minLength and the maxLength
      • When type is url, you can also constrain the minLength and the maxLength
      • When type is email, you can also constrain the minLength and the maxLength
      • When type is pattern, you should select the regexp  a regex expression that will be used to validate the field

       

      Test Scenarios

      Test Scenarios Test Strategy Kind of test Is it covered by FrontEnd ? (JS-Unit) Is it covered by BackEnd ? (unit or integration)
      When type in the configuration text field, the field can constraint min and max length Smoke Manual No Yes
      When type in the configuration text field, the field can validate if it is integer Smoke Manual No Yes
      When type in the configuration text field, the field can validate if it is email address Smoke Manual No Yes
      When type in the configuration text field, the field can validate if it is URL Smoke Manual No Yes
      When type in the configuration text field, the field can validate if it is a specific pattern Smoke Manual No Yes
      When type integer in the configuration text field, the field can constraint min and max value Sanity Manual No No
      When type email address in the configuration text field, the field can constraint min and max length Sanity Manual No No
      When type URL in the configuration text field, the field can constraint min and max length Sanity Manual No No

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  Master