WEB-708 Required Field Validation Messages Not Displayed in Loan Product#3136
Conversation
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Form Validation Messages src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.html |
Added three client-side validation error messages for required fields: principal, overAppliedCalculationType, and overAppliedNumber. Each displays a required-field error when the control is required and has been touched or marked dirty. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
- WEB-465 Principal field allows zero and negative values in loan product creation form #2890: Modifies validation-related markup for the principal field in the same component, including min/max validation handling.
- WEB-404 Required Field Validation Error Message Missing for Account Type Field in Create GL Account Form #2766: Adds required-field error message validation logic in Angular templates with touched/dirty state checks, establishing a pattern similar to these changes.
Suggested reviewers
- IOhacker
- alberto-art3ch
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title 'WEB-708 Required Field Validation Messages Not Displayed in Loan Product' directly and clearly summarizes the main change: adding required field validation messages to the loan product form. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
No actionable comments were generated in the recent review. 🎉
🧹 Recent nitpick comments
src/app/products/loan-products/loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component.html (1)
31-39: Redundanttouched || dirtyguard inside<mat-error>— inconsistent with existing patterns.Angular Material's
<mat-error>is already gated by the defaultErrorStateMatcher, which shows errors only when the control is invalid and (touched or form submitted). The extratouched || dirtycheck in the*ngIfis redundant. It also diverges from how existing required errors are handled in this same file (e.g., line 216 checks onlyhasError('required'), lines 140-143 use no*ngIfat all).Consider simplifying to match the existing convention:
Suggested diff
- <mat-error - *ngIf=" - loanProductTermsForm.get('principal')?.hasError('required') && - (loanProductTermsForm.get('principal')?.touched || loanProductTermsForm.get('principal')?.dirty) - " - > + <mat-error *ngIf="loanProductTermsForm.get('principal')?.hasError('required')">The same applies to the other two new
<mat-error>blocks (lines 71-80 and 88-96).
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 @coderabbitai help to get the list of available commands and usage tips.
|
@IOhacker Thank You for the review |
Chnages Made :-
-Added error messages for required fields on the Create Loan Product .
WEB-708
Before :-
After :-
Summary by CodeRabbit