-
Notifications
You must be signed in to change notification settings - Fork 817
WEB: 76 fix(incentives): correct display label for condition type #2948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
WEB: 76 fix(incentives): correct display label for condition type #2948
Conversation
Update the incentive condition dropdown to display user-friendly labels instead of raw backend enum values. The backend returns values like , which were previously rendered directly in the UI. This change maps those values to readable labels without modifying backend behavior or enums.
|
Note
|
| Cohort / File(s) | Summary |
|---|---|
Condition label mapping (component) src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts |
Added getConditionLabel(value: string): string method that maps internal condition keys (lessthan, equal, greterthan, notEqual) to human-readable labels; default returns the input. |
Template display update src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.html |
Replaced direct conditionType.value rendering with getConditionLabel(conditionType.value) for option labels. |
Translations (en-US) src/assets/translations/en-US.json |
Added conditions block with LessThan, Equal, GreaterThan, NotEqual keys mapping to the human-readable English strings. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
- AlejandroED21
- alberto-art3ch
Pre-merge checks and finishing touches
✅ 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 accurately describes the main change: correcting the display label for condition types in the incentives form, which is the core purpose of the PR. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
- 📝 Generate docstrings
📜 Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.tssrc/assets/translations/en-US.json
🧰 Additional context used
📓 Path-based instructions (1)
src/app/**
⚙️ CodeRabbit configuration file
src/app/**: For Angular code: verify component separation, trackBy on *ngFor,
strict type safety, and clean observable patterns.
Files:
src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts
🔇 Additional comments (2)
src/assets/translations/en-US.json (1)
772-777: LGTM! Translation keys for condition labels are well-structured.The new
conditionsblock with localized labels integrates correctly within thelabelssection and follows the existing naming conventions.src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts (1)
119-132: LGTM! Proper use of TranslateService for localized condition labels.The implementation correctly uses
translateService.instant()to fetch localized labels, addressing the previous review feedback. The switch cases appropriately match the backend enum values (including the intentional'greterthan'spelling), and the translation keys align with those added inen-US.json. The default fallback returning the original value is a sensible safety net.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.html (1)
22-22: Consider tracking by unique identifier for better performance.The
trackexpression tracks the entireconditionTypeobject. For better performance and change detection, consider tracking by a unique property likeconditionType.id.🔎 Proposed optimization
- @for (conditionType of conditionTypeData; track conditionType) { + @for (conditionType of conditionTypeData; track conditionType.id) {Note: This pattern could also be applied to other
@forloops in the template (lines 7, 39, 59) for consistency.As per coding guidelines, trackBy should be used on loops in Angular code for optimal change detection.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.htmlsrc/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts
🧰 Additional context used
📓 Path-based instructions (1)
src/app/**
⚙️ CodeRabbit configuration file
src/app/**: For Angular code: verify component separation, trackBy on *ngFor,
strict type safety, and clean observable patterns.
Files:
src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.htmlsrc/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts
🔇 Additional comments (1)
src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.html (1)
24-24: LGTM!The template correctly calls the
getConditionLabelmethod to display user-friendly labels for condition types.
What was changed
Updated the incentive condition dropdown to display user-friendly
labels instead of raw backend enum values.
Why this change was needed
The backend returns values such as
greterthan, which were previouslyrendered directly in the UI. This caused confusing labels to appear
during Fixed Deposit configuration.
What was done
Related issues
Fixes: WEB-359
after:

Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.