Skip to content

Build configurable Input field Validation Framework #13

Description

@AyabongaQwabi

Here's the updated GitHub project task without the milestone timeline:


Task: Build a Configurable Input Field Validation Framework

Description

Our page-building and website-building configurable components now support data capture. This breakthrough enables components originally in HTML (converted to React) with input fields to:

  • Accept JSON configurations to render components dynamically.
  • Manage changes in input field data seamlessly.
  • Handle click events on CTAs effectively.

This advancement is powered by the EventHandlerContext, which translates a component's input handlers config into executable functions. This is a significant milestone, and congratulations are in order for everyone involved. 👏

Next Challenge

We now need to take this to the next level: input data validation.
The goal is to build a Validation Framework that:

  1. Validates Data: Captures and validates user input in real-time or on form submission.
  2. Configurable Validation: Provides a configuration API that allows users (those creating JSON configs) to select and define validation types for each input field.

Acceptance Criteria

  1. Core Validation Features

    • Implement standard validations, such as:
      • Required field.
      • Email format.
      • Number range.
      • String length (min/max).
      • Regex pattern matching.
    • Ensure validations are extensible for future requirements.
  2. Configurable API

    • Create an intuitive API for developers to define validation rules in JSON format, e.g.:
      {
        "field": "email",
        "type": "text",
        "validations": [
          { "rule": "required", "message": "Email is required" },
          { "rule": "email", "message": "Enter a valid email address" }
        ]
      }
    • Support chaining multiple validation rules per field.
  3. Real-Time Feedback

    • Provide instant feedback to users on invalid input (e.g., inline error messages or field highlights).
  4. Integration with Existing System

    • Ensure the framework integrates smoothly with the EventHandlerContext.
    • Validate input fields without disrupting current data capture and change handling.
  5. Testing & Documentation

    • Unit tests for each validation type.
    • Comprehensive examples and documentation for using the validation framework in component configs.

Deliverables

  1. A fully functional, configurable validation framework for input fields.
  2. Integration with the current EventHandlerContext and component builder system.
  3. Documentation and sample configurations to showcase how the framework works.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions