Aman-Mittal commented on code in PR #768:
URL:
https://github.com/apache/fineract-backoffice-ui/pull/768#discussion_r4302019941
##########
src/app/features/products/loan-product-form.component.ts:
##########
@@ -1497,6 +1508,10 @@ export class LoanProductFormComponent implements OnInit {
this.product.update((product) => ({ ...product, [field]: value }));
}
+ protected enumLabel(option: { value?: string; description?: string; code?:
string }): string {
+ return option.value ?? option.description ?? option.code ?? '';
Review Comment:
Nit, non-blocking: nothing tests the `?? option.code` fallback. One option
with neither `value` nor `description` would lock in "never render a blank
option", which is the class of bug #759 was about.
Not for this PR: `loan-product-view.component.ts` has the same mismatch. It
reads `interestRateFrequencyType?.description` (~L87) and
`repaymentFrequencyType?.description` (~L98), and `GET /loanproducts/{id}`
returns those enums as `{ id, code, value }` too, so the product page shows
"Interest rate: 5" and "Repayment every: 1" with no unit. Could you open a
follow-up issue linked to #653, or I can file it? This helper could move to a
shared util at that point.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]