-
Notifications
You must be signed in to change notification settings - Fork 92
Labels
IET requestissues that came up from IET triageissues that came up from IET triage
Milestone
Description
Describe the bug
We have an optional middle name field. If this field has no value, the review page displays an error.
Which feature of OpenCRVS your bug concern?
Declaration form configuration
To Reproduce
Steps to reproduce the behaviour:
- Create a name field similar to the code below
{
id: 'child.name',
type: FieldType.NAME,
required: true,
configuration: {
maxLength: MAX_NAME_LENGTH,
name: {
firstname: {
required: true
},
middlename: {
required: false
},
surname: {
required: true
}
}
},
hideLabel: true,
label: {
defaultMessage: "Child's name",
description: 'This is the label for the field',
id: 'event.birth.action.declare.form.section.child.field.name.label'
},
validation: [ invalidNameValidator('child.name')]
},
- Update the
invalidNameValidatorvalidator and add this line inside the validator property
middlename: field('middlename').isValidEnglishName(), - Create a declaration and check the review page
Expected behaviour
The validator should not be triggered if the middle name field is empty.
Country Configuration Version:
v1.9.0-beta-3
Screencast.from.2025-10-22.15-47-54.mp4
Metadata
Metadata
Assignees
Labels
IET requestissues that came up from IET triageissues that came up from IET triage
Type
Projects
Status
Completed