-
Notifications
You must be signed in to change notification settings - Fork 61
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
chore(inheritance-report): assets overview changes and minor spouse share fix #14652
Conversation
WalkthroughThe recent updates to the inheritance-report application streamline asset calculations, refine inheritance value computations, and enhance asset overview components. These changes centralize data handling and improve the application's functionality. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 4
Out of diff range and nitpick comments (1)
libs/application/templates/inheritance-report/src/fields/OverviewAssets/types.ts (1)
12-15
: Consider adding comments to describe optional properties inRowType
.Adding comments can improve the readability and maintainability of the type definitions, especially for new developers or external contributors.
libs/application/templates/inheritance-report/src/fields/OverviewAssets/types.ts
Show resolved
Hide resolved
...n/templates/inheritance-report/src/fields/CalculationsOfTotal/CalculateTotalAssets/index.tsx
Show resolved
Hide resolved
libs/application/templates/inheritance-report/src/lib/utils/calculateTotalAssets.ts
Show resolved
Hide resolved
Datadog ReportBranch report: ✅ 0 Failed, 4 Passed, 0 Skipped, 21.86ms Wall Time |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14652 +/- ##
==========================================
- Coverage 37.04% 37.03% -0.02%
==========================================
Files 6259 6210 -49
Lines 126918 127074 +156
Branches 36315 36611 +296
==========================================
+ Hits 47023 47063 +40
- Misses 79895 80011 +116
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 279 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
libs/application/templates/inheritance-report/src/fields/OverviewAssets/index.tsx
Outdated
Show resolved
Hide resolved
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: 4
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (8)
- libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/mappers.ts (1 hunks)
- libs/application/templates/inheritance-report/src/fields/AssetsRepeater/index.tsx (2 hunks)
- libs/application/templates/inheritance-report/src/fields/CalculateShare/index.tsx (3 hunks)
- libs/application/templates/inheritance-report/src/fields/OverviewAssets/index.tsx (1 hunks)
- libs/application/templates/inheritance-report/src/forms/sections/assets.ts (3 hunks)
- libs/application/templates/inheritance-report/src/forms/sections/heirs.ts (2 hunks)
- libs/application/templates/inheritance-report/src/lib/dataSchema.ts (1 hunks)
- libs/application/templates/inheritance-report/src/lib/messages.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- libs/application/templates/inheritance-report/src/lib/messages.ts
Files skipped from review as they are similar to previous changes (2)
- libs/application/templates/inheritance-report/src/fields/OverviewAssets/index.tsx
- libs/application/templates/inheritance-report/src/forms/sections/assets.ts
Additional Context Used
Path-based Instructions (5)
libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/mappers.ts (1)
Pattern
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/inheritance-report/src/forms/sections/heirs.ts (1)
Pattern
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/inheritance-report/src/fields/AssetsRepeater/index.tsx (1)
Pattern
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/inheritance-report/src/lib/dataSchema.ts (1)
Pattern
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/inheritance-report/src/fields/CalculateShare/index.tsx (1)
Pattern
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."
Additional comments not posted (5)
libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/mappers.ts (1)
283-288
: Ensure thecustomShare
object handles empty arrays correctly.Verification successful
The review comment was concerned with ensuring that the
customShare
object handles empty arrays correctly. From the script output, we can see several references tocustomShare
across different files in the inheritance report module. Notably, in themappers.ts
file, the handling ofhasCustomSpouseSharePercentage
uses the nullish coalescing operator (??
) to provide a default value of an empty array if the property is undefined. This is a correct way to handle potentialundefined
ornull
values, ensuring that the property defaults to an empty array when not specified.Given this, the
customShare
object does handle empty arrays correctly as it provides a default empty array when the value is not present, which aligns with the expectations set in the review comment.Conclusion:
- The
customShare
object in themappers.ts
file is implemented to handle empty arrays correctly by providing default values where necessary.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `customShare` object handles empty arrays correctly. # Test: Search for the function usage. Expect: Proper handling of empty arrays. rg --type typescript $'customShare'Length of output: 69
Script:
#!/bin/bash # Description: Verify that the `customShare` object handles empty arrays correctly. # Correcting the previous script error by specifying the correct file type for TypeScript files. rg --type ts 'customShare'Length of output: 1728
libs/application/templates/inheritance-report/src/forms/sections/heirs.ts (2)
65-69
: Ensure thecustomShare.customSpouseSharePercentage
field is properly integrated with the rest of the form logic.Verification successful
The
customShare.customSpouseSharePercentage
field is referenced in multiple parts of the codebase, indicating its integration within the form logic:
- It is defined as a field ID in
libs/application/templates/inheritance-report/src/forms/sections/heirs.ts
.- It is used in
libs/application/templates/inheritance-report/src/fields/CalculateShare/index.tsx
where its value is set and it is referenced by name in a component.This suggests that the field is actively used and likely integrated with the form's logic as expected.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `customShare.customSpouseSharePercentage` field is properly integrated with the rest of the form logic. # Test: Search for the field usage. Expect: Proper integration with form logic. rg --type typescript $'customShare.customSpouseSharePercentage'Length of output: 97
Script:
#!/bin/bash # Description: Re-verify the integration of `customShare.customSpouseSharePercentage` in the form logic. # Correcting the file type issue and re-running the search for the field usage. rg 'customShare.customSpouseSharePercentage' --type js,tsLength of output: 87
Script:
#!/bin/bash # Description: Attempting a different approach to verify the integration of `customShare.customSpouseSharePercentage` in the form logic. # Using a broader search without specifying file types to ensure the command executes correctly. rg 'customShare.customSpouseSharePercentage'Length of output: 468
127-134
: Check the currency formatting forinheritance
andtaxFreeInheritance
fields.Verification successful
The search results confirm that the
currency
property is indeed used in the context of theinheritance
andtaxFreeInheritance
fields within theheirs.ts
file, as well as in various other parts of the application. This indicates that the currency formatting is likely implemented and utilized across different modules and forms in the application.Given this information, the review comment concerning the verification of currency formatting for these fields is consistent with the findings in the codebase. The use of the
currency
property in the specified fields suggests that the application is handling currency formatting as expected.Final Conclusion:
- The currency formatting for the
inheritance
andtaxFreeInheritance
fields is implemented and utilized as indicated by the presence of thecurrency
property in the relevant sections of the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the currency formatting for `inheritance` and `taxFreeInheritance` fields. # Test: Search for the currency formatting logic. Expect: Proper formatting. rg --type typescript $'currency'Length of output: 66
Script:
#!/bin/bash # Description: Check the currency formatting for `inheritance` and `taxFreeInheritance` fields. # Test: Search for the currency formatting logic in TypeScript files. Expect: Proper formatting. rg 'currency' --glob '*.ts'Length of output: 16983
libs/application/templates/inheritance-report/src/fields/AssetsRepeater/index.tsx (1)
277-277
: Ensure the label for each field is correctly formatted and localized.libs/application/templates/inheritance-report/src/lib/dataSchema.ts (1)
580-601
: Validate the logic forcustomSpouseSharePercentage
to ensure it handles edge cases correctly.Verification successful
The verification of the logic for
customSpouseSharePercentage
has been successfully completed. The search results indicate that this variable is extensively used across various files in the inheritance report module, particularly within theCalculateShare
component and thedataSchema.ts
file where the validation logic is defined.The validation logic in
dataSchema.ts
ensures that ifhasCustomSpouseSharePercentage
is true and not empty, thecustomSpouseSharePercentage
must be a number between 50 and 100. This logic appears to handle the edge cases correctly by ensuring that the percentage is within a valid range when specified.Given the widespread usage and the specific validation checks in place, it seems that the logic for handling
customSpouseSharePercentage
is robust and correctly implemented across the relevant parts of the codebase.
- Files and locations using
customSpouseSharePercentage
:
libs/application/templates/inheritance-report/src/forms/sections/heirs.ts
libs/application/templates/inheritance-report/src/fields/CalculateShare/index.tsx
(multiple occurrences)libs/application/templates/inheritance-report/src/lib/dataSchema.ts
(validation logic)libs/application/template-api-modules/src/lib/modules/templates/inheritance-report/utils/mappers.ts
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Validate the logic for `customSpouseSharePercentage` to ensure it handles edge cases correctly. # Test: Search for the validation logic usage. Expect: Proper handling of edge cases. rg --type typescript $'customSpouseSharePercentage'Length of output: 85
Script:
#!/bin/bash # Description: Validate the logic for `customSpouseSharePercentage` to ensure it handles edge cases correctly. # Corrected Test: Search for the validation logic usage. Expect: Proper handling of edge cases. rg --type ts 'customSpouseSharePercentage'Length of output: 2827
Assets overview changes and minor spouse share fix
They liked the way the new design of the "assets to share" values screen looked and wanted the assets overview screen to have the same design.
Checklist:
Summary by CodeRabbit
Refactor
New Features
Documentation
Bug Fixes