Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a base validation system for inputs with a validator manager and concrete validator implementations. The system provides a foundation for input validation with extensible validator classes.
Key changes:
- Introduces a BaseValidator abstract class as the foundation for all validators
- Implements ValidatorManager to handle collections of validators and coordinate validation
- Adds IsEmptyStringValidator as a concrete validator implementation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| BaseValidator.ts | Abstract base class defining the validator interface |
| ValidatorManager.ts | Manager class for handling collections of validators and orchestrating validation |
| IsEmptyStringValidator.ts | Concrete validator implementation for empty string validation |
tischsoic
requested changes
Aug 20, 2025
| @@ -0,0 +1,30 @@ | |||
| import BaseValidator from './BaseValidator'; | |||
|
|
|||
| export interface ValidateReturnType { | |||
There was a problem hiding this comment.
The same reasoning as in: ibexa/design-system#14 (comment)
Suggested change
| export interface ValidateReturnType { | |
| export interface ValidationResult { |
| } | ||
|
|
||
| validate(value: T): ValidateReturnType { | ||
| const errors = this._validators |
There was a problem hiding this comment.
same suggestion as in: https://github.com/ibexa/design-system/pull/14/files#r2287934977
tischsoic
reviewed
Aug 20, 2025
| export default abstract class BaseValidator<T> { | ||
| abstract getErrorMessage(): string; | ||
|
|
||
| abstract validate(_value: T): boolean; |
There was a problem hiding this comment.
Why underscore? 🤔
Suggested change
| abstract validate(_value: T): boolean; | |
| abstract validate(value: T): boolean; |
OstafinL
approved these changes
Aug 25, 2025
tischsoic
approved these changes
Aug 25, 2025
albozek
approved these changes
Aug 25, 2025
dew326
approved these changes
Aug 25, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
For QA:
Documentation: