Skip to content

WEB-134: Fix floating rates creation bugs#3466

Merged
IOhacker merged 1 commit intoopenMF:devfrom
YousufFFFF:WEB-134-fix-floating-rates-bugs
Apr 7, 2026
Merged

WEB-134: Fix floating rates creation bugs#3466
IOhacker merged 1 commit intoopenMF:devfrom
YousufFFFF:WEB-134-fix-floating-rates-bugs

Conversation

@YousufFFFF
Copy link
Copy Markdown
Member

@YousufFFFF YousufFFFF commented Apr 5, 2026

Description

This PR fixes several usability issues in the Create Floating Rate form:

Removed unnecessary question mark icon from the "Floating Rate Periods" label - the icon served no functional purpose and was confusing in this context

Set minimum selectable date to tomorrow - Fineract requires floating rate
periods to be in the future (not today). Previously users could select today's date which would result in a backend validation error. Now the date picker prevents selecting dates earlier than tomorrow.

Disabled submit button until at least one rate period is configured - Fineract requires at least one floating rate period record. Previously users could submit without any periods and receive an unhelpful backend error.

Added null safety checks in the floating rate period dialog to prevent potential runtime errors when data is empty

No new dependencies required.

Related issues and discussion

#WEB-134

Screenshots

After: Date picker only allows tomorrow onwards, submit button disabled until rate period added
https://github.com/user-attachments/assets/15636f14-32b1-4768-8eaf-60fd496c4118

Checklist

  • 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

  • UI Changes

    • Removed the informational icon and tooltip from the Floating Rate Periods header on create and edit screens.
  • Form Validation

    • Submission is blocked until at least one floating rate period is added.
  • Date Selection

    • Floating rate period start dates must be tomorrow or later.
  • Dialog Stability

    • Adding/editing period dialogs handle missing or partial data more safely.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e792846-42bf-4eea-aaa6-77c2fa368653

📥 Commits

Reviewing files that changed from the base of the PR and between f8394fd and 62cb2bc.

📒 Files selected for processing (5)
  • src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.html
  • src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.html
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts
  • src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts
💤 Files with no reviewable changes (1)
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.html
✅ Files skipped from review due to trivial changes (1)
  • src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.html
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts
  • src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts

Walkthrough

Removed tooltip icons from the “Floating Rate Periods” headers, removed minDate fields from create/edit components, tightened submit validation to require at least one period, and refactored the floating-rate-period dialog to compute a normalized tomorrow-only minDate and handle missing dialog data safely.

Changes

Cohort / File(s) Summary
Header tooltip removal
src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.html, src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.html
Removed the question-mark help icon and its matTooltip from the "Floating Rate Periods" section headers.
Create/Edit components
src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts, src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts
Removed minDate class fields. Create component now prevents submit when floatingRatePeriodsData.length === 0. Add-period dialog call no longer passes fromDate by default; edit call adds isNew: true.
Floating Rate Period Dialog
src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts
Compute minDate as tomorrow at 00:00:00.000, hardened dialog-data access using optional chaining, and made form control defaults resilient to missing dialog data.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • IOhacker
  • gkbishnoi07
🚥 Pre-merge checks | ✅ 3
✅ 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 'WEB-134: Fix floating rates creation bugs' directly and clearly summarizes the main changes—fixing multiple usability bugs in the floating rates creation form.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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: 2

🤖 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/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts`:
- Around line 55-59: The component currently sets minDate from the client local
clock; replace that logic to derive tomorrow from the tenant business date
provided by SettingsService.businessDate: read SettingsService.businessDate
(e.g., inject SettingsService if not already), create a new Date from that
value, add one day (date.setDate(date.getDate() + 1)), zero the time with
setHours(0,0,0,0), and assign to this.minDate so the dialog uses the tenant
business date as the baseline; update the code block that currently computes
`tomorrow` and references `this.minDate` (in
floating-rate-period-dialog.component, where `minDate` is set).
- Around line 62-66: The editFloatingRatePeriod() caller opens the
FloatingRatePeriodDialogComponent without the isNew flag, causing the dialog's
row-disabled logic (this.data?.isNew in
floating-rate-period-dialog.component.ts) to behave inconsistently; update
editFloatingRatePeriod() to pass isNew: true in the dialog data payload (same
shape as createFloatingRatePeriod's call) so the component receives
this.data.isNew and overrides date-based disabling, or alternatively change the
dialog invocation to include an explicit flag (isNew) matching the create path.
🪄 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: 8f127727-007b-40fb-a554-2a8b92f4f58b

📥 Commits

Reviewing files that changed from the base of the PR and between aad6742 and f8394fd.

📒 Files selected for processing (5)
  • src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.html
  • src/app/products/floating-rates/create-floating-rate/create-floating-rate.component.ts
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.html
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts
  • src/app/products/floating-rates/floating-rate-period-dialog/floating-rate-period-dialog.component.ts
💤 Files with no reviewable changes (2)
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.html
  • src/app/products/floating-rates/edit-floating-rate/edit-floating-rate.component.ts

@YousufFFFF YousufFFFF force-pushed the WEB-134-fix-floating-rates-bugs branch from f8394fd to 62cb2bc Compare April 5, 2026 12:02
@YousufFFFF
Copy link
Copy Markdown
Member Author

Hi @IOhacker!
This PR is ready for your review!
Thank you for your time!

Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

Kindlyl see my comments

*/
addFloatingRatePeriod() {
const floatingRatePeriodDialogRef = this.dialog.open(FloatingRatePeriodDialogComponent, {
data: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

whyt it was removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The fromDate: this.settingsService.businessDate was removed from the dialog data because the minDate calculation is now handled inside the dialog component itself. The dialog now calculates minDate as businessDate + 1 day (tomorrow) since floating rates must always be in the future. This centralizes the date logic in one place rather than passing it from the parent component.

<div class="layout-row-wrap gap-70percent m-b-10 layout-lt-md-column">
<p class="mat-title flex-25">
{{ 'labels.inputs.Floating Rate Periods' | translate }}
<i
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why it was removed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The question mark icon was removed as per the Jira ticket WEB-134 requirements. The ticket states: "There is a label 'Floating Rate Periods ?' The question mark makes no sense in labels - remove it."

@YousufFFFF
Copy link
Copy Markdown
Member Author

Hey @IOhacker!
I have replied to your comments.
Waitinf for your further reply!

Copy link
Copy Markdown
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

LGTM

@IOhacker IOhacker merged commit b37fbbb into openMF:dev Apr 7, 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