-
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
fix(application-hid): Display rejection reason from client #14947
Conversation
WalkthroughThe recent updates to the Health Insurance Declaration module involve renaming and modifying methods in the service class, enhancing form functionality by incorporating dynamic comments, and updating data types to include additional fields. Additionally, a new utility function was added to extract comments from external data, and API paths in the client configuration were restructured. Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant Form
participant Service
participant ExternalData
participant API
User->>Form: Fill out Health Insurance Declaration Form
Form->>Service: Call status method
Service->>API: Request insurance status
API-->>Service: Return insurance status with comment and isInsured
Service-->>Form: Return status object
Form->>ExternalData: Call getCommentFromExternalData
ExternalData-->>Form: Return comment
Form-->>User: Display form with dynamic comments and alert messages
Tip Early Access Features
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 (
|
Datadog ReportAll test runs ✅ 7 Total Test Services: 0 Failed, 6 Passed Test Services
🔻 Code Coverage Decreases vs Default Branch (3) |
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: 0
Outside diff range and nitpick comments (1)
libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (1)
Line range hint
248-271
: Update descriptions to align with API standards.Consider using more descriptive and standardized language for API response descriptions to enhance clarity and maintain consistency across the API documentation.
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (2 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3 hunks)
- libs/application/templates/health-insurance-declaration/src/types/index.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/utils/data.ts (1 hunks)
- libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (62 hunks)
Additional Context Used
Biome (17)
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (5)
132-133: This variable implicitly has the any type.
1-5: All these imports are only used as types.
7-8: All these imports are only used as types.
8-9: Some named imports are only used as types.
9-10: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3)
19-25: Some named imports are only used as types.
39-40: All these imports are only used as types.
41-42: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/types/index.ts (2)
1-6: All these imports are only used as types.
6-7: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/utils/data.ts (7)
40-40: Change to an optional chain.
90-90: Change to an optional chain.
110-110: Change to an optional chain.
155-155: This else clause can be omitted because previous branches break early.
1-8: All these imports are only used as types.
9-10: All these imports are only used as types.
11-16: All these imports are only used as types.
Path-based Instructions (5)
libs/application/templates/health-insurance-declaration/src/types/index.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/health-insurance-declaration/src/utils/data.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/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.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/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.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/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (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 (6)
libs/application/templates/health-insurance-declaration/src/types/index.ts (1)
72-73
: The addition ofcomment
andisInsured
fields toInsuranceStatementData
aligns well with the PR's objectives to enhance data handling regarding insurance status and rejection reasons.libs/application/templates/health-insurance-declaration/src/utils/data.ts (1)
82-86
: The implementation ofgetCommentFromExternalData
correctly handles potential undefined values using optional chaining and provides a sensible default. This function supports the PR's goal of displaying rejection reasons effectively.libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1)
34-40
: The refactoring of thecanApply
method tostatus
and its updated functionality to return the entire response object is a significant improvement. It aligns with the PR's objectives by enabling more detailed feedback to be provided to the user.libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (2)
160-165
: The addition of theisHealthInsuredComment
hidden input field is well-implemented. It uses thegetCommentFromExternalData
function to fetch and store the rejection reason, which is crucial for conditional rendering based on the insurance status.
184-193
: The implementation of thenotHealthInsuredAlertMessage
field is effective in displaying the rejection reason as a warning message, only when applicable. This enhances user experience by providing relevant feedback directly related to their insurance status.libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (1)
Line range hint
2419-2477
: Ensure schema definitions are comprehensive and accurate.Ensure that all properties marked as nullable are intentionally so, and that all required fields are correctly annotated. This is crucial for maintaining data integrity and ensuring that the API behaves as expected.
Also applies to: 2500-2546, 2586-2615, 2634-2666, 2689-2716, 4176-4311, 4342-4557, 4600-4634, 4716-4820
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14947 +/- ##
==========================================
- Coverage 37.13% 37.08% -0.06%
==========================================
Files 6373 6353 -20
Lines 129702 129430 -272
Branches 36999 36970 -29
==========================================
- Hits 48161 47994 -167
+ Misses 81541 81436 -105
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 63 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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: 0
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (5)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (3 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (5 hunks)
- libs/application/templates/health-insurance-declaration/src/types/index.ts (2 hunks)
- libs/application/templates/health-insurance-declaration/src/utils/data.ts (1 hunks)
- libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (94 hunks)
Additional Context Used
Biome (17)
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (5)
131-132: This variable implicitly has the any type.
1-5: All these imports are only used as types.
7-8: All these imports are only used as types.
8-9: Some named imports are only used as types.
9-10: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3)
19-25: Some named imports are only used as types.
39-40: All these imports are only used as types.
41-42: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/types/index.ts (2)
1-6: All these imports are only used as types.
6-7: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/utils/data.ts (7)
40-40: Change to an optional chain.
90-90: Change to an optional chain.
110-110: Change to an optional chain.
155-155: This else clause can be omitted because previous branches break early.
1-8: All these imports are only used as types.
9-10: All these imports are only used as types.
11-16: All these imports are only used as types.
Path-based Instructions (5)
libs/application/templates/health-insurance-declaration/src/types/index.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/health-insurance-declaration/src/utils/data.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/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.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/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.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/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (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 (8)
libs/application/templates/health-insurance-declaration/src/types/index.ts (2)
53-55
: The inclusion ofHealthInsuranceDeclarationExternalData
inHealthInsuranceDeclarationApplication
enhances structured data handling. Good integration!
71-72
: Addingcomment
andisInsured
toInsuranceStatementData
supports the PR's objective to provide more detailed feedback to users. Well done!libs/application/templates/health-insurance-declaration/src/utils/data.ts (1)
82-86
: The functiongetCommentFromExternalData
correctly uses optional chaining to safely access thecomment
. This is crucial for robustness.libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (2)
34-40
: Thestatus
method now returns the entire response object, enhancing data handling capabilities. This change aligns well with the PR's objectives.
56-61
: The methodgetInsuranceStatementData
now provides a more comprehensive data structure by includingstatus
,continents
, andcountries
. This is a significant improvement.libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (2)
160-165
: The addition of hidden inputs forisHealthInsured
andisHealthInsuredComment
is a smart way to handle state without exposing it directly in the UI. This aligns with the PR's goals.
184-193
: The dynamic alert messagenotHealthInsuredAlertMessage
effectively uses theisHealthInsuredComment
to provide contextual feedback to the user. This is a thoughtful integration.libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (1)
15-17
: The changes to the "tags" fields across various API endpoints are consistent with the intended restructuring to improve clarity and organization. This should facilitate better management and usage of the API.Also applies to: 64-66, 124-126, 184-186, 234-236, 288-290, 327-329, 376-378, 425-427, 464-466, 503-505, 589-591, 632-634, 694-696, 736-738, 789-791, 851-853, 929-931, 978-980, 1020-1022, 1059-1061, 1098-1100, 1150-1152, 1207-1209, 1264-1266, 1335-1337, 1387-1389, 1426-1428, 1476-1478, 1538-1540, 1551-1553, 1600-1602, 1642-1644, 1684-1686, 1733-1735, 1782-1784, 1832-1834, 1871-1873, 1910-1912, 1949-1951, 2011-2013, 2061-2063, 2103-2105, 2169-2171, 2219-2221, 2281-2283, 2331-2333, 2373-2375, 2422-2424, 2475-2477
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.
LGTM
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.
LGTM
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: 0
Outside diff range and nitpick comments (1)
libs/application/templates/health-insurance-declaration/src/types/index.ts (1)
72-73
: Add documentation for new fieldscomment
andisInsured
.It would be beneficial to include comments explaining the purpose and usage of these new fields to maintain code clarity and assist future developers.
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (4)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (2 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3 hunks)
- libs/application/templates/health-insurance-declaration/src/types/index.ts (1 hunks)
- libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json (62 hunks)
Files skipped from review as they are similar to previous changes (1)
- libs/clients/icelandic-health-insurance/rights-portal/src/clientConfig.json
Additional Context Used
Biome (10)
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (5)
132-133: This variable implicitly has the any type.
1-5: All these imports are only used as types.
7-8: All these imports are only used as types.
8-9: Some named imports are only used as types.
9-10: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (3)
19-25: Some named imports are only used as types.
39-40: All these imports are only used as types.
41-42: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/types/index.ts (2)
1-6: All these imports are only used as types.
6-7: All these imports are only used as types.
Path-based Instructions (3)
libs/application/templates/health-insurance-declaration/src/types/index.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/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.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/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.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."
Additional comments not posted (4)
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (2)
34-40
: The changes to thestatus
method align well with the PR's objectives to provide detailed feedback.
56-61
: EnhancedgetInsuranceStatementData
method to include more comprehensive data.libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (2)
160-165
: Proper implementation of hidden input to store rejection reasons.
184-193
: Effective use of alert messages to enhance user information transparency.
* Update rights-portal client * Add additional information to application * Rename function -> status * clean up * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <builders@andes.is> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* fix(application-hid): Display rejection reason from client (#14947) * Update rights-portal client * Add additional information to application * Rename function -> status * clean up * chore: nx format:write update dirty files --------- Co-authored-by: andes-it <builders@andes.is> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> * fix(application-hid): Conditional Section and other minor fixes (#15044) * Remove titles of empty checkbox fields * Validate number of applicants more than 0 * Remove titles of empty checkbox fields * Validate number of applicants more than 0 * Error message on both fields * Stop applicants with no declaration available * Formatting * clean up * More readable validation * typo fixes and file rename * Typo fix, * File rename --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --------- Co-authored-by: andes-it <builders@andes.is> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
...
Attach a link to issue if relevant
What
Update the rights-portal client from Sjúkratryggingar Íslands.
Display the rejection reason from the client in the application.
Why
Improve clarity for the applicant
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
comment
andisInsured
to Insurance Statement data.Improvements
Bug Fixes
Refactor
canApply
method tostatus
and modified its return value to include the entire response object.