-
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): Conditional Section and other minor fixes #15044
Conversation
…is into fix/application-hid-qa
Important Review skippedReview was skipped as selected files did not have any reviewable changes. Files selected but had no reviewable changes (1)
You can disable this status message by setting the WalkthroughThe recent updates to the health insurance declaration module primarily focus on enhancing the handling of applicant data, including spouse and children information. New validation logic, error handling, and conditional checks based on family member data were added. Additionally, the schema and form structure were updated to better manage the presence of family members, ensuring a more robust and user-friendly experience. Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant Form
participant Service
participant NationalRegistry
participant ErrorHandling
User->>Form: Submit application
Form->>Service: getInsuranceStatementData(applicationWithProps)
Service->>NationalRegistry: Fetch spouse and children data
NationalRegistry-->>Service: Return spouse and children data
Service->>Service: Validate data (canApply, hasSpouse, hasChildren)
alt Data is invalid
Service->>ErrorHandling: Trigger TemplateApiError
ErrorHandling-->>User: Display error message
else Data is valid
Service-->>Form: Return insurance statement data
Form-->>User: Display insurance statement
end
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: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (11)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (4 hunks)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts (3 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (5 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/index.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (2 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/prerequsites.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/utils/data.ts (2 hunks)
- libs/application/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- libs/application/templates/health-insurance-declaration/src/index.ts
Additional context used
Path-based instructions (10)
libs/application/templates/health-insurance-declaration/src/lib/messages/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/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.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/lib/messages/errors.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/Submitted.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/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/health-insurance-declaration/src/lib/messages/prerequsites.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.utils.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."
Biome
libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts
[error] 9-10: Some named imports are only used as types.
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts
[error] 1-6: All these imports are only used as types.
[error] 6-11: All these imports are only used as types.
[error] 11-12: All these imports are only used as types.
[error] 12-17: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/utils/data.ts
[error] 40-40: Change to an optional chain.
[error] 105-105: Change to an optional chain.
[error] 125-125: Change to an optional chain.
[error] 172-172: This else clause can be omitted because previous branches break early.
[error] 1-8: All these imports are only used as types.
[error] 9-10: All these imports are only used as types.
[error] 11-16: All these imports are only used as types.
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
[error] 158-159: This variable implicitly has the any type.
[error] 1-5: Some named imports are only used as types.
[error] 5-9: All these imports are only used as types.
[error] 11-12: All these imports are only used as types.
[error] 12-13: Some named imports are only used as types.
[error] 13-14: All these imports are only used as types.
libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts
[error] 19-25: Some named imports are only used as types.
[error] 40-41: All these imports are only used as types.
[error] 42-43: All these imports are only used as types.
Additional comments not posted (11)
libs/application/types/src/lib/template-api/shared-api/shared-api-definitions/health-insurance-api.ts (1)
16-17
: Propertiesorder
andthrowOnError
added to enhance API error handling and prioritization.libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1)
20-25
: New error messagenoSelectedApplicant
correctly added to handle cases where no applicant is selected.libs/application/templates/health-insurance-declaration/src/forms/Submitted.ts (1)
Line range hint
9-10
: Imports used as types are appropriate here for type safety.libs/application/templates/health-insurance-declaration/src/lib/messages/prerequsites.ts (1)
22-39
: New error messages related to declaration availability added correctly.libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.utils.ts (3)
68-68
: LGTM! The use of optional chaining and conditional checks before adding spouse data enhances robustness.
82-82
: LGTM! The use of optional chaining and conditional checks before adding children data enhances robustness.
128-128
: LGTM! The conditional check before adding spouse data prevents potential runtime errors.libs/application/templates/health-insurance-declaration/src/utils/data.ts (2)
62-64
: LGTM! The functionhasFamilyAvailable
correctly checks for the presence of spouse or children, enhancing UI conditional rendering.
66-75
: LGTM! The functionhasFamilySelected
correctly checks for the selection of family members, which is crucial for dependent operations.libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1)
61-84
: LGTM! The enhancements ingetInsuranceStatementData
method improve error handling and data processing, aligning with best practices.libs/application/templates/health-insurance-declaration/src/forms/HealthInsuranceDeclarationForm.ts (1)
167-178
: LGTM! The addition of hidden inputs forhasSpouse
andhasChildren
correctly implements dynamic form behavior based on family data.
libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts
Outdated
Show resolved
Hide resolved
libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 68 Total Test Services: 0 Failed, 66 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (4) |
...c/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
Outdated
Show resolved
Hide resolved
libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts
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: 2
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (7)
- libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (4 hunks)
- libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/index.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts (2 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts (1 hunks)
- libs/application/templates/health-insurance-declaration/src/lib/messages/prerequisites.ts (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- libs/application/templates/health-insurance-declaration/src/index.ts
- libs/application/templates/health-insurance-declaration/src/lib/dataSchema.ts
- libs/application/templates/health-insurance-declaration/src/lib/messages/errors.ts
- libs/application/templates/health-insurance-declaration/src/lib/messages/index.ts
Additional context used
Path-based instructions (3)
libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.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/lib/messages/prerequisites.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."
Biome
libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts
[error] 8-17: Some named imports are only used as types.
libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
[error] 157-158: This variable implicitly has the any type.
[error] 1-5: Some named imports are only used as types.
[error] 5-9: All these imports are only used as types.
[error] 11-12: All these imports are only used as types.
[error] 12-13: Some named imports are only used as types.
[error] 13-14: All these imports are only used as types.
Additional comments not posted (3)
libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts (1)
20-20
: The addition of theprerequisites
import is correctly used to enhance the form's localization and error handling.libs/application/templates/health-insurance-declaration/src/lib/messages/prerequisites.ts (1)
22-39
: The addition of new error messages enhances user feedback and error handling in the application process.libs/application/template-api-modules/src/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts (1)
61-83
: The update to thegetInsuranceStatementData
method signature and the enhanced error handling align well with the PR objectives.
libs/application/templates/health-insurance-declaration/src/forms/Prerequisites.ts
Show resolved
Hide resolved
...c/lib/modules/templates/health-insurance-declaration/health-insurance-declaration.service.ts
Show resolved
Hide resolved
* 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>
* 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 <[email protected]> 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 <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
...
Attach a link to issue if relevant
What
Conditionally render sections.
Stop applicants with no possible declarations in prereqisites step.
Other minor fixes.
Why
Prevent empty screens and lists.
Going through the application with no possible applicants would result in an error from sjukra and no clear reson given.
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Documentation