-
Notifications
You must be signed in to change notification settings - Fork 70
fix(rental-agreement): Conditionally rendered input connected to wrong field #18973
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
Conversation
… options for index type.
WalkthroughThe changes update utility functions and enums related to rental payment methods and index types in the rental agreement module. Function names and logic are corrected for clarity, a new utility for payment date options is added, and two rental amount index types are removed from both the enum and related utility function. Changes
Sequence Diagram(s)sequenceDiagram
participant Form as RentalPeriodAmount Form
participant Utils as rentalPeriodUtils
participant Enums as enums/utils
Form->>Utils: rentalPaymentMethodIsBankTransfer(answers)
Form->>Utils: rentalPaymentMethodIsOther(answers)
Form->>Utils: rentalPaymentDateIsOther(answers)
Form->>Enums: getRentalAmountIndexTypes()
Utils->>Enums: Use RentalAmountIndexTypes (CONSUMER_PRICE_INDEX only)
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. ✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
View your CI Pipeline Execution ↗ for commit f505380.
☁️ Nx Cloud last updated this comment at |
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: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
libs/application/templates/rental-agreement/src/forms/draft/rentalPeriodSubsections/rentalPeriodAmount.ts
(3 hunks)libs/application/templates/rental-agreement/src/utils/enums.ts
(0 hunks)libs/application/templates/rental-agreement/src/utils/rentalPeriodUtils.ts
(2 hunks)libs/application/templates/rental-agreement/src/utils/utils.ts
(0 hunks)
💤 Files with no reviewable changes (2)
- libs/application/templates/rental-agreement/src/utils/enums.ts
- libs/application/templates/rental-agreement/src/utils/utils.ts
🧰 Additional context used
📓 Path-based instructions (1)
`libs/**/*`: "Confirm that the code adheres to the following: - Reusability of components and hooks across different NextJS apps. - TypeScript usage for defining props and exportin...
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/templates/rental-agreement/src/forms/draft/rentalPeriodSubsections/rentalPeriodAmount.ts
libs/application/templates/rental-agreement/src/utils/rentalPeriodUtils.ts
🧬 Code Graph Analysis (1)
libs/application/templates/rental-agreement/src/forms/draft/rentalPeriodSubsections/rentalPeriodAmount.ts (2)
libs/application/templates/rental-agreement/src/utils/rentalPeriodUtils.ts (3)
rentalPaymentDateIsOther
(20-26)rentalPaymentMethodIsBankTransfer
(28-34)rentalPaymentMethodIsOther
(36-42)libs/application/core/src/lib/fieldBuilders.ts (1)
buildTextField
(294-335)
🔇 Additional comments (6)
libs/application/templates/rental-agreement/src/forms/draft/rentalPeriodSubsections/rentalPeriodAmount.ts (4)
25-27
: Nice improvement to the import statements.The renamed utility functions now clearly indicate their purpose - separating payment method checks from payment date checks. This aligns with the corrections made in the utils file.
115-116
: Correct condition for bank transfer national ID field.The field is now properly displayed only when bank transfer is selected as the payment method, using the renamed and fixed utility function.
122-123
: Correct condition for bank account number field.Similar to the national ID field, this now correctly shows only when bank transfer is selected as the payment method.
128-129
: Fixed condition for "other" payment method text field.This field now correctly appears only when "Other" is selected as the payment method, using the appropriately named utility function.
libs/application/templates/rental-agreement/src/utils/rentalPeriodUtils.ts (2)
5-5
: Added required import for payment date options.The import for
RentalAmountPaymentDateOptions
was added to support the new utility function.
20-26
: Added new utility function for payment date option check.This new function correctly checks if the payment date option is set to "OTHER", following the same pattern as other utility functions. This addition is essential for properly controlling the display of the payment date "other" input field.
...ion/templates/rental-agreement/src/forms/draft/rentalPeriodSubsections/rentalPeriodAmount.ts
Show resolved
Hide resolved
libs/application/templates/rental-agreement/src/utils/rentalPeriodUtils.ts
Show resolved
Hide resolved
libs/application/templates/rental-agreement/src/utils/rentalPeriodUtils.ts
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 3 Total Test Services: 0 Failed, 3 Passed Test Services
|
…g field (#18973) Fix conditionally rendered input connected to wrong field. Remove two options for index type.
Conditionally rendered input connected to wrong field
What
Checklist:
Summary by CodeRabbit