fix(registrar): enforce mandatory fields on registration + readable search errors & inline paginator - #82
Conversation
[25] The smart paginator composed z-pagination inside a justify-end row, but z-pagination's default host classes (mx-auto w-full justify-center) stretched it full-width and wrapped it below the rows-per-page selector. Override with mx-0 w-auto justify-end so it stays inline and aligned; standalone z-pagination is unaffected. [9] Registrar search error handlers passed the raw HttpErrorResponse object to confirmationService.alert(), which rendered as "[object Object]". Extract error.error.errorMessage || error.message before alerting (all search paths).
The no-results info alerts read currentLanguageSet.alerts.info.beneficiarynotfound (and .phoneDetails) with no fallback; in the registrar context that key can be unresolved, showing an empty "Info" dialog. Add optional-chaining + a literal fallback so a real message always shows.
The non-ES advanced-search no-results alert read alerts.info.beneficiaryNotFound (camelCase) but the language key is beneficiarynotfound (lowercase) -> undefined -> blank "Info" dialog. Use the correct key with optional chaining + literal fallback.
… submitted The migration to reactive forms + Zard kept the red-asterisk label ([zRequired]="item.isRequired") but stopped attaching a validator to the control, so mainForm stayed valid while empty: Next advanced and Submit (gated on !mainForm.valid) stayed enabled, generating a blank beneficiary ID. - personal/location/other-information: attach Validators.required in the addControl loop for every field flagged isRequired in the master config, alongside the existing pattern/min/max validators. Merge onto pre-seeded controls (age/ageAtMarriage) since FormGroup.addControl no-ops when the control already exists. - registration: block nextStep() while the active step group is invalid (markAllAsTouched to surface the required messages) and add a defensive invalid-guard in submitBeneficiaryDetails().
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



What
Two related registrar QA fixes from the Zard/Tailwind migration pass:
1. Registration can't be submitted empty (QA: Registration form submitted without any entry, Ben ID generated)
The migration to reactive forms + Zard kept the red-asterisk label (
[zRequired]="item.isRequired") but stopped attaching a validator to the control — somainFormstayed valid while empty:Nextadvanced andSubmit(gated on!mainForm.valid) stayed enabled, generating a blank beneficiary.personal/location/other-information: attachValidators.requiredin theaddControlloop for every field flaggedisRequiredin the master config, alongside the existing pattern/min/max validators. Pre-seeded controls (age/ageAtMarriage) get the validator merged on, sinceFormGroup.addControlno-ops when the control already exists.registration: blocknextStep()while the active step group is invalid (markAllAsTouchedto surface the required messages) + a defensive invalid-guard insubmitBeneficiaryDetails().2. Search error/empty states (QA: advanced search shows "[object Object]"; rows/pagination misaligned)
search: showerror.error.errorMessage(and correctbeneficiarynotfoundkey casing) instead of rendering the raw object / a blank dialog.paginator: keep the paginator inline/right-aligned instead of stretched full-width below the rows-per-page selector.Testing
Next/Submitis blocked with a mandatory-fields alert and red required messages; a complete form registers normally; non-required fields (Last Name, Contact No, Spouse, Occupation) may stay empty.Notes