Skip to content

Commit

Permalink
✨ [open-formulieren/open-forms#4420] Simplify sub component type defi…
Browse files Browse the repository at this point in the history
…nition

The validation structure/mechanism now makes use of the HasValidation
helper type, but disables the 'plugins' validators which are not used
or relevant in this context.
  • Loading branch information
sergei-maertens authored and stevenbal committed Aug 19, 2024
1 parent 44c42c7 commit 6357bd4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/formio/components/addressNL.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {InputComponentSchema} from '..';
import {HasValidation} from '../base';
import {ComponentTranslations, ErrorTranslations} from '../i18n';
import {HasValidation, InputComponentSchema} from '..';
import {ComponentTranslations} from '../i18n';

type Validator = 'required';
type TranslatableKeys = 'label' | 'description' | 'tooltip';
Expand All @@ -15,14 +14,9 @@ export interface AddressData {
secretStreetCity?: string;
}

export interface ComponentValidation {
validate: HasValidation<'pattern'>;
translatedErrors: ErrorTranslations;
}

export interface AddressComponents {
postcode?: ComponentValidation;
city?: ComponentValidation;
postcode?: HasValidation<'pattern', false>;
city?: HasValidation<'pattern', false>;
}

export type AddressNLInputSchema = InputComponentSchema<AddressData, Validator, TranslatableKeys>;
Expand Down

0 comments on commit 6357bd4

Please sign in to comment.