Create a generic Helper at ebt_core side to validate common fields from other ebt_* projects E.g. customClassValidator

Created on 17 February 2023, over 1 year ago
Updated 18 February 2023, over 1 year ago

Problem/Motivation

Currently we have commom fields that are used in more than one ebt_* project. My suggestion is to create a element validator in the ebt_core side as a "central". With that we can have only one validation and use that in all places that have the same field.

For example, the field custom class, is used in more than one ebt_project, and they don't have a validator, so the user can put invalid classes there, only spaces for example. It'll save. So we can define an element validator in ebt_core side and after that reuse the same validator in places that are currently using the same custom css class

Proposed resolution

Create a Helper class for the custom css class validator. It'll validate if the class return the standard class

  1. /^ - matches the beginning of the string
  2. [a-zA-Z] - matches a letter (a-z or A-Z)
  3. [a-zA-Z0-9_-]* - match

If not it'll display an message to insert a valid class.

On this point we can just create the method, and after that the other projects can use that

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Fixed

Version

1.4

Component

Code

Created by

πŸ‡§πŸ‡·Brazil RenatoG Campinas

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024