Details
-
Story
-
Status: Closed
-
Minor
-
Resolution: Completed
-
None
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:
- 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
- causes
-
LPS-110220 Can not render fragment when click configuration button in page editor
- Closed
- is demanded by
-
LPS-107413 Include validation for the Fragment Configuration text field
-
- Reviewed
-
- Testing discovered
-
LPS-111412 The size of fragment entry card is fluid
- Closed
-
LPS-111413 Typing should't be interrupted by draft saved when type in configuration text field
- Closed