Skip to content

WEB-362-correct-position-and-trailing-comma-in-provisioning-criteria-loan-product#2751

Merged
alberto-art3ch merged 1 commit intoopenMF:devfrom
JaySoni1:WEB-362-correct-position-and-trailing-comma-in-provisioning-criteria-loan-product
Nov 4, 2025
Merged

WEB-362-correct-position-and-trailing-comma-in-provisioning-criteria-loan-product#2751
alberto-art3ch merged 1 commit intoopenMF:devfrom
JaySoni1:WEB-362-correct-position-and-trailing-comma-in-provisioning-criteria-loan-product

Conversation

@JaySoni1
Copy link
Contributor

@JaySoni1 JaySoni1 commented Nov 3, 2025

Changes Made :-

-Fixed layout and removed trailing comma for Loan Product display in Provisioning Criteria view.
-Ensured Loan Product names appear inline with the criteria name as requested.

WEB-362

Summary by CodeRabbit

  • Bug Fixes

    • Fixed loan product listing to remove trailing commas and handle missing or undefined items gracefully.
  • Style

    • Simplified header into a single centered row, moved the divider below the header, and repositioned loan product info as a compact inline label beside the title for clearer layout.

@coderabbitai
Copy link

coderabbitai bot commented Nov 3, 2025

Walkthrough

Refactors the component header layout and CSS, moves the divider, and replaces manual loan-product name concatenation with a guarded filter/map/join in TypeScript; no data retrieval or public API changes.

Changes

Cohort / File(s) Summary
Template layout & classes
src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.html
Replaced multi-part inline header with a single centered row, moved mat-divider below the header, wrapped the title in an h2 with .criteria-title, and rendered loan product label/value inline using .loan-product-label.
TypeScript: loan products formatting
src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts
Added LoanProduct import/shape and replaced manual loop concatenation with a null-safe filter/map/join pipeline to produce the loanProducts string (explicit empty-string fallback).
Styles
src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria.component.scss
Added .criteria-title and .loan-product-label classes (spacing, font-size, vertical alignment); kept existing table width rule.

Sequence Diagram(s)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Pay attention to: the filter/map/join pipeline handling null/undefined entries and empty arrays, and the template bindings referencing the new CSS classes and moved mat-divider.

Suggested reviewers

  • IOhacker
  • alberto-art3ch

Pre-merge checks and finishing touches

✅ Passed checks (2 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 changes: correcting the position/layout of the loan product display and removing trailing commas in the provisioning criteria view.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.html (1)

15-23: Consider moving inline styles to the component's stylesheet.

The layout successfully achieves the PR objective of displaying the loan product names inline. However, the inline styles on lines 16 and 19 make the code harder to maintain and test for responsive behavior.

Consider extracting these styles to the component's SCSS file:

.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.criteria-title {
  margin-bottom: 0;
  display: inline;
  vertical-align: middle;
}

.loan-products-section {
  margin-left: 24px;
  font-size: 1.1em;
  vertical-align: middle;
}

Then update the template:

-      <div class="layout-row-wrap align-center">
-        <h2 class="mat-h2" style="margin-bottom: 0; display: inline; vertical-align: middle">
+      <div class="layout-row-wrap align-center header-row">
+        <h2 class="mat-h2 criteria-title">
           {{ provisioningData.criteriaName }}
         </h2>
-        <span style="margin-left: 24px; font-size: 1.1em; vertical-align: middle">
+        <span class="loan-products-section">
           <strong>{{ 'labels.inputs.Loan Product' | translate }}:</strong>
           <span>{{ loanProducts }}</span>
         </span>
       </div>
📜 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 80f3d01 and 1268df0.

📒 Files selected for processing (2)
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.html (1 hunks)
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts (1 hunks)
🧰 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/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.html
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run Lint, Build and Deploy

@JaySoni1 JaySoni1 force-pushed the WEB-362-correct-position-and-trailing-comma-in-provisioning-criteria-loan-product branch from 1268df0 to e8590c4 Compare November 3, 2025 23:19
Copy link
Collaborator

@alberto-art3ch alberto-art3ch left a comment

Choose a reason for hiding this comment

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

Please see my comments

@JaySoni1 JaySoni1 force-pushed the WEB-362-correct-position-and-trailing-comma-in-provisioning-criteria-loan-product branch from e8590c4 to dd8650a Compare November 4, 2025 19:13
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: 0

🧹 Nitpick comments (1)
src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts (1)

98-106: Functional approach successfully eliminates trailing comma.

The refactored implementation using filter, map, and join is cleaner and resolves the trailing comma issue mentioned in the PR objectives.

However, to fully align with the strict type safety guideline for Angular code, consider these improvements:

  1. Type the provisioningData property (line 55) instead of using any. Define an interface that includes loanProducts?: LoanProduct[] and other properties used in this component.

  2. Strengthen the filter logic to handle edge cases:

    .filter((p) => p?.name && p.name.trim() !== '')

    This ensures empty or whitespace-only names don't contribute to the joined string.

  3. Avoid type assertion by properly typing the data at its source (in the route resolver or service). Type assertions with as bypass compile-time checks and can mask runtime type mismatches.

As per coding guidelines.

📜 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 e8590c4 and dd8650a.

📒 Files selected for processing (3)
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.html (1 hunks)
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.scss (1 hunks)
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.html
  • src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.scss
🧰 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/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts
🧬 Code graph analysis (1)
src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts (1)
src/app/products/loan-products/models/loan-product.model.ts (1)
  • LoanProduct (17-162)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run Lint, Build and Deploy
🔇 Additional comments (1)
src/app/organization/loan-provisioning-criteria/view-loan-provisioning-criteria/view-loan-provisioning-criteria.component.ts (1)

28-29: Good addition of the LoanProduct type.

The import correctly leverages the existing model to improve type safety in the loan products handling.

@JaySoni1
Copy link
Contributor Author

JaySoni1 commented Nov 4, 2025

@alberto-art3ch I have updated this PR please review

Copy link
Collaborator

@alberto-art3ch alberto-art3ch 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 de480e0 into openMF:dev Nov 4, 2025
3 checks passed
@JaySoni1
Copy link
Contributor Author

JaySoni1 commented Nov 4, 2025

@alberto-art3ch Thank You for the review

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