Skip to content

Conversation

@parth-sharma-10
Copy link

@parth-sharma-10 parth-sharma-10 commented Dec 30, 2025

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 previously
rendered directly in the UI. This caused confusing labels to appear
during Fixed Deposit configuration.

What was done

  • Mapped backend condition values to readable UI labels
  • Ensured no backend or API behavior was modified

Related issues

Fixes: WEB-359

after:
Screenshot 2025-12-30 at 10 36 54 AM

Summary by CodeRabbit

  • Style
    • Improved condition type display in the deposit product incentive form dialog by showing clear, human-readable labels instead of technical identifiers, making it easier to understand and select condition types.
  • Localization
    • Added localized condition labels ("Less than", "Equal", "Greater than", "Not equal") to support consistent UI text across locales.

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

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.
@coderabbitai
Copy link

coderabbitai bot commented Dec 30, 2025

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Adds a label-mapping method and uses it in the deposit product incentive form template; also adds corresponding English translation entries for the condition labels.

Changes

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

📥 Commits

Reviewing files that changed from the base of the PR and between 99ffd59 and ddf4708.

📒 Files selected for processing (2)
  • src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.ts
  • src/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 conditions block with localized labels integrates correctly within the labels section 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 in en-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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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 track expression tracks the entire conditionType object. For better performance and change detection, consider tracking by a unique property like conditionType.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 @for loops 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6bb37c5 and 99ffd59.

📒 Files selected for processing (2)
  • src/app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component.html
  • src/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.html
  • src/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 getConditionLabel method to display user-friendly labels for condition types.

@parth-sharma-10 parth-sharma-10 marked this pull request as draft December 30, 2025 05:13
@parth-sharma-10 parth-sharma-10 marked this pull request as ready for review December 30, 2025 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants