Skip to content

WEB-657: Working Capital loan near breach config#3529

Merged
alberto-art3ch merged 1 commit intoopenMF:devfrom
alberto-art3ch:WEB-657/working-capital-loan-near-breach-config
Apr 24, 2026
Merged

WEB-657: Working Capital loan near breach config#3529
alberto-art3ch merged 1 commit intoopenMF:devfrom
alberto-art3ch:WEB-657/working-capital-loan-near-breach-config

Conversation

@alberto-art3ch
Copy link
Copy Markdown
Collaborator

@alberto-art3ch alberto-art3ch commented Apr 23, 2026

Description

There was an issue when the WC Loan creation and modification and the WC Product does not allow to override the Breach settings. the Near Breach in the WC Loan view was not being displayed

WEB-657

Related issues and discussion

Screenshots

Screenshot 2026-04-22 at 11 43 46 PM

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • If you have multiple commits please combine them into one commit by squashing them.

  • Read and understood the contribution guidelines at web-app/.github/CONTRIBUTING.md.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation logic for breach and near-breach clear buttons to require additional conditions before allowing overrides
    • Enhanced near-breach form visibility to align with selected breach state
    • Adjusted breach display layout spacing for better readability and consistency

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

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

The changes tighten conditional rendering and clear-button behavior for breach-related fields across the loans account terms step component and breach display component. A new component state flag (allowAttributeOverridesBreach) gates breach override actions, and near-breach visibility is realigned to depend on the selected breach state rather than form control values.

Changes

Cohort / File(s) Summary
Loans Account Terms Step Component
src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html, src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
Added allowAttributeOverridesBreach state flag to gate breach and near-breach clear buttons. Updated template conditions to require both form control existence and allowAttributeOverridesBreach flag. Changed "Near Breach" visibility to depend on selectedBreach instead of loansAccountTermsForm.value.breachId.
Breach Display Component
src/app/shared/loan/breach-display/breach-display.component.html
Updated flex sizing from flex-30 to flex-60 for breach and nearBreach value columns in non-singleRow layout across name, frequency, calculation/threshold fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • adamsaghy
  • oleksii-novikov-onix
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding Working Capital loan near breach configuration functionality to address a display issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts`:
- Line 182: The boolean allowAttributeOverridesBreach is only set false and
never reset, so when ngOnChanges receives a new Working Capital template that
permits overrides the Breach/Near Breach controls remain disabled; update
ngOnChanges (and the similar block around the logic at the region corresponding
to lines ~359-379) to check the incoming template's allow-overrides flag and set
allowAttributeOverridesBreach back to true when overrides are allowed, and also
re-enable the related form controls and show their clear buttons (the same
controls you disable elsewhere) so the UI reflects the new template permissions;
locate and modify the ngOnChanges method and the code paths that disable
controls to add this reset/enabling logic referencing
allowAttributeOverridesBreach and the specific form control names used for
Breach/Near Breach.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 735746a6-654e-416b-a759-4a10c605218c

📥 Commits

Reviewing files that changed from the base of the PR and between ed7ad25 and 1fa1109.

📒 Files selected for processing (3)
  • src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.html
  • src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
  • src/app/shared/loan/breach-display/breach-display.component.html

delinquencyStartTypeOptions: StringEnumOptionData[] = [];
breachOptions: Breach[] = [];
nearBreachOptions: NearBreach[] = [];
allowAttributeOverridesBreach: boolean = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reset breach override state when the next template allows overrides.

allowAttributeOverridesBreach is only ever set to false, and the controls are only disabled. If ngOnChanges() receives another Working Capital template where breach overrides are allowed, the Breach / Near Breach controls can remain disabled and their clear buttons stay hidden.

🐛 Proposed fix
-      if (!this.allowAttributeOverrides.breach || this.allowAttributeOverrides.breach === false) {
-        this.allowAttributeOverridesBreach = false;
-        this.loansAccountTermsForm.controls.breachId.disable();
-        this.loansAccountTermsForm.controls.nearBreachId.disable();
-      }
+      this.allowAttributeOverridesBreach = this.allowAttributeOverrides.breach === true;
+      if (this.allowAttributeOverridesBreach) {
+        this.loansAccountTermsForm.controls.breachId.enable({ emitEvent: false });
+        this.loansAccountTermsForm.controls.nearBreachId.enable({ emitEvent: false });
+      } else {
+        this.loansAccountTermsForm.controls.breachId.disable({ emitEvent: false });
+        this.loansAccountTermsForm.controls.nearBreachId.disable({ emitEvent: false });
+      }

Also applies to: 359-379

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts`
at line 182, The boolean allowAttributeOverridesBreach is only set false and
never reset, so when ngOnChanges receives a new Working Capital template that
permits overrides the Breach/Near Breach controls remain disabled; update
ngOnChanges (and the similar block around the logic at the region corresponding
to lines ~359-379) to check the incoming template's allow-overrides flag and set
allowAttributeOverridesBreach back to true when overrides are allowed, and also
re-enable the related form controls and show their clear buttons (the same
controls you disable elsewhere) so the UI reflects the new template permissions;
locate and modify the ngOnChanges method and the code paths that disable
controls to add this reset/enabling logic referencing
allowAttributeOverridesBreach and the specific form control names used for
Breach/Near Breach.

Copy link
Copy Markdown
Collaborator

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alberto-art3ch alberto-art3ch merged commit 2fe316a into openMF:dev Apr 24, 2026
6 checks passed
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