-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat(service-portal): Health - Organ donation #15227
Conversation
WalkthroughThe recent changes significantly enhance the health service portal's functionalities concerning organ donation. Key updates include the addition of a new API scope for organ donation, localized messages to support user interactions, and the creation of components and navigation items for managing organ donation information and registrations. These enhancements collectively improve the user experience by providing a comprehensive and user-friendly interface for organ donation processes. 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 Configuration File (
|
Affected services are: air-discount-scheme-api,air-discount-scheme-backend,api,application-system-api,download-service,financial-aid-api,financial-aid-backend,financial-aid-open-api,icelandic-names-registry-backend,license-api,regulations-admin-backend,services-auth-admin-api,services-auth-ids-api,services-auth-delegation-api,services-auth-personal-representative,services-auth-personal-representative-public,services-auth-public-api,services-documents,services-endorsements-api,services-sessions,services-university-gateway,services-user-notification,services-user-profile,air-discount-scheme-web,financial-aid-web-osk,financial-aid-web-veita,skilavottord-web,web,application-system-form,island-ui-storybook,portals-admin,service-portal,system-e2e, |
Datadog ReportAll test runs ✅ 101 Total Test Services: 0 Failed, 99 Passed Test ServicesThis report shows up to 10 services
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #15227 +/- ##
==========================================
- Coverage 36.91% 36.91% -0.01%
==========================================
Files 6608 6608
Lines 135495 135496 +1
Branches 38603 38603
==========================================
Hits 50014 50014
- Misses 85481 85482 +1 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 175 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 52 Total Test Services: 0 Failed, 50 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (1)
|
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
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (9)
- apps/api/src/app/app.module.ts (2 hunks)
- libs/api/domains/health-directorate/src/index.ts (1 hunks)
- libs/api/domains/health-directorate/src/lib/health-directorate.module.ts (1 hunks)
- libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts (1 hunks)
- libs/api/domains/health-directorate/src/lib/health-directorate.service.ts (2 hunks)
- libs/api/domains/health-directorate/src/lib/models/organ-donation.model.ts (2 hunks)
- libs/api/domains/health-directorate/src/lib/models/vaccinations.model.ts (1 hunks)
- libs/api/domains/health-directorate/tsconfig.json (1 hunks)
- libs/api/domains/health-directorate/tsconfig.lib.json (1 hunks)
Additional context used
Path-based instructions (9)
libs/api/domains/health-directorate/src/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/api/domains/health-directorate/src/lib/health-directorate.module.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/api/domains/health-directorate/tsconfig.lib.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."
libs/api/domains/health-directorate/tsconfig.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."
libs/api/domains/health-directorate/src/lib/models/organ-donation.model.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/api/domains/health-directorate/src/lib/models/vaccinations.model.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/api/domains/health-directorate/src/lib/health-directorate.resolver.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/api/domains/health-directorate/src/lib/health-directorate.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."
apps/api/src/app/app.module.ts (1)
Pattern
apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
Additional comments not posted (10)
libs/api/domains/health-directorate/src/index.ts (1)
2-2
: Export addition approved.The addition of
HealthDirectorateModule
to the exports improves modularity and reusability.libs/api/domains/health-directorate/src/lib/health-directorate.module.ts (1)
1-10
: Module implementation approved.The
HealthDirectorateModule
is well-structured, enhancing modularity and maintainability within the NestJS framework.libs/api/domains/health-directorate/tsconfig.lib.json (1)
6-12
: TypeScript configuration enhancements approved.The stricter type-checking options enhance code quality. Verify the impact of removing the
module
option to ensure compatibility.libs/api/domains/health-directorate/tsconfig.json (1)
5-10
: TypeScript strictness options approved.The added options enhance type safety and code consistency, contributing to better maintainability.
libs/api/domains/health-directorate/src/lib/models/organ-donation.model.ts (1)
18-18
: GraphQL input type change approved.Changing
DonorStatusInput
to use@InputType
correctly aligns it with its intended use in GraphQL operations.libs/api/domains/health-directorate/src/lib/models/vaccinations.model.ts (1)
29-30
: Change approved: Ensure consistent usage ofgeneralComment
.Changing the type of
generalComment
fromobject
tostring
enhances type safety. Verify that this change is consistent with its usage throughout the application.Verification successful
Consistent Usage of
generalComment
VerifiedThe search results indicate that
generalComment
is being used consistently as a string across the codebase. Notably, inhealth-directorate.service.ts
,generalComment
is explicitly converted to a string using.toString()
, which aligns with its new type.
- Location:
libs/api/domains/health-directorate/src/lib/health-directorate.service.ts
This confirms that the change is consistent with its usage. No further action is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `generalComment` is used consistently as a string across the codebase. # Test: Search for `generalComment` usage. Expect: All occurrences should align with the new string type. rg --type typescript -A 3 $'generalComment'Length of output: 77
Script:
#!/bin/bash # Description: Verify that `generalComment` is used consistently as a string across the codebase. # Test: Search for `generalComment` usage in TypeScript files. Expect: All occurrences should align with the new string type. rg --type ts -A 3 $'generalComment'Length of output: 874
libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts (1)
47-47
: Change approved: Verify client-side handling of nullable Boolean.Explicitly setting the return type of
updateDonorStatus
toBoolean
(nullable) improves clarity. Ensure that client-side code handles potentialnull
values appropriately.libs/api/domains/health-directorate/src/lib/health-directorate.service.ts (2)
99-99
: Change approved: Consistent string conversion forgeneralComment
.Converting
generalComment
to a string ensures data consistency. Verify that this change aligns with the expected data format elsewhere in the application.
59-71
: Change approved: Verify handling of updated return type.The
updateDonorStatus
method now returnstrue
orfalse
, enhancing error handling. Ensure that this change is handled correctly in the resolver and any other dependent code.apps/api/src/app/app.module.ts (1)
172-172
: Change approved: Integration ofHealthDirectorateModule
.Adding
HealthDirectorateModule
enhances the application's modular structure. Ensure that it is correctly configured and utilized within the application.Also applies to: 329-329
This PR currently has a merge conflict. Please resolve this and then re-add the |
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, codebase verification and nitpick comments (1)
libs/service-portal/health/src/screens/Vaccinations/Vaccinations.graphql (1)
2-2
: Inconsistent Usage of Query Name DetectedThe query name update to
HealthDirectorateVaccinationsGetVaccinations
has not been consistently applied across the codebase. The old query namegetVaccinations
is still present in several files. Please update the following instances to ensure consistency:
libs/service-portal/health/src/screens/Vaccinations/Vaccinations.graphql
libs/clients/health-directorate/src/lib/clients/vaccinations/vaccinations.service.ts
libs/api/domains/health-directorate/src/lib/health-directorate.service.ts
libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts
Analysis chain
LGTM! Verify consistent usage of the new query name.
The change to a more descriptive query name enhances clarity. Ensure that all instances of the query name have been updated across the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of the new query name across the codebase. # Test: Search for the old and new query names. Expect: Only occurrences of the new query name. rg --type graphql 'getVaccinations|HealthDirectorateVaccinationsGetVaccinations'Length of output: 114
Script:
#!/bin/bash # Description: Verify consistent usage of the new query name across the codebase. # Test: Search for the old and new query names in all files. Expect: Only occurrences of the new query name. rg 'getVaccinations|HealthDirectorateVaccinationsGetVaccinations'Length of output: 1453
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (14)
- apps/service-portal/src/auth.ts (1 hunks)
- libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts (3 hunks)
- libs/auth/scopes/src/lib/api.scope.ts (1 hunks)
- libs/service-portal/health/src/lib/messages.ts (1 hunks)
- libs/service-portal/health/src/lib/navigation.ts (1 hunks)
- libs/service-portal/health/src/lib/paths.ts (1 hunks)
- libs/service-portal/health/src/module.tsx (2 hunks)
- libs/service-portal/health/src/screens/OrganDonation/OrganDonation.graphql (1 hunks)
- libs/service-portal/health/src/screens/OrganDonation/OrganDonation.tsx (1 hunks)
- libs/service-portal/health/src/screens/OrganDonationRegistration/RegistrationForm.tsx (1 hunks)
- libs/service-portal/health/src/screens/Vaccinations/Vaccinations.graphql (1 hunks)
- libs/service-portal/health/src/screens/Vaccinations/VaccinationsGeneral.tsx (1 hunks)
- libs/service-portal/health/src/screens/Vaccinations/VaccinationsOther.tsx (1 hunks)
- libs/service-portal/health/src/utils/types.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- libs/service-portal/health/src/lib/paths.ts
Files skipped from review as they are similar to previous changes (7)
- apps/service-portal/src/auth.ts
- libs/api/domains/health-directorate/src/lib/health-directorate.resolver.ts
- libs/auth/scopes/src/lib/api.scope.ts
- libs/service-portal/health/src/lib/navigation.ts
- libs/service-portal/health/src/screens/OrganDonation/OrganDonation.tsx
- libs/service-portal/health/src/screens/OrganDonationRegistration/RegistrationForm.tsx
- libs/service-portal/health/src/utils/types.ts
Additional context used
Path-based instructions (6)
libs/service-portal/health/src/screens/Vaccinations/Vaccinations.graphql (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/service-portal/health/src/screens/OrganDonation/OrganDonation.graphql (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/service-portal/health/src/screens/Vaccinations/VaccinationsOther.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/service-portal/health/src/screens/Vaccinations/VaccinationsGeneral.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/service-portal/health/src/module.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/service-portal/health/src/lib/messages.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 (22)
libs/service-portal/health/src/screens/OrganDonation/OrganDonation.graphql (1)
1-23
: New GraphQL queries and mutation look good!The queries and mutation for organ donation are well-structured. Ensure that the
locale
parameter ingetOrganDonationExceptions
is handled correctly in the backend.libs/service-portal/health/src/screens/Vaccinations/VaccinationsOther.tsx (1)
14-14
: LGTM! Verify component logic with updated data structure.The change aligns with the updated GraphQL query response. Ensure that the component logic correctly handles the new data structure.
libs/service-portal/health/src/screens/Vaccinations/VaccinationsGeneral.tsx (1)
16-16
: LGTM! Verify component logic with updated data structure.The change aligns with the updated GraphQL query response. Ensure that the component logic correctly handles the new data structure.
libs/service-portal/health/src/module.tsx (2)
57-63
: New components for organ donation are well-integrated!The addition of
OrganDonation
andOrganDonationRegistration
components is seamless. Ensure that these components are properly tested.
208-221
: New routes for organ donation are correctly defined!The routes for organ donation and registration are well-defined and follow the existing pattern. Ensure that the API scope is correctly configured.
libs/service-portal/health/src/lib/messages.ts (17)
947-950
: LGTM: Message entryorganDonation
.The message entry is correctly defined and ready for localization.
951-955
: LGTM: Message entryorganDonationDescription
.The message entry is well-defined and provides clear information about organ donation registration.
956-959
: LGTM: Message entryreadAboutOrganDonation
.The message entry is well-defined and encourages users to learn more about organ donation.
960-963
: LGTM: Message entrytakeOnOrganDonation
.The message entry is well-defined and clearly communicates its purpose.
964-967
: LGTM: Message entrychangeTake
.The message entry is well-defined and provides clear instructions for changing one's stance on organ donation.
968-971
: LGTM: Message entryorganDonationLink
.The message entry is well-defined and includes a valid URL for more information on organ donation.
972-975
: LGTM: Message entryorganRegistrationOtherLabel
.The message entry is well-defined and provides a clear label for additional input.
976-979
: LGTM: Message entryorganRegistrationOtherText
.The message entry is well-defined and provides a clear prompt for users to specify which organs are to be registered.
980-984
: LGTM: Message entryorganLimitationsError
.The message entry is well-defined and provides a clear error message for empty text areas.
985-988
: LGTM: Message entryother
.The message entry is well-defined and provides a clear label for 'other' options.
989-992
: LGTM: Message entryregistrationComplete
.The message entry is well-defined and provides a clear confirmation message for successful registration.
993-996
: LGTM: Message entryregistrationFailed
.The message entry is well-defined and provides a clear error message for failed registration attempts.
997-1000
: LGTM: Message entryiAmOrganDonor
.The message entry is well-defined and clearly communicates the user's status as an organ donor.
1001-1004
: LGTM: Message entryiAmNotOrganDonor
.The message entry is well-defined and clearly communicates the user's status as not being an organ donor.
1005-1008
: LGTM: Message entryorganDonationRegistrationOptIn
.The message entry is well-defined and provides a clear message for opting into organ donation.
1009-1013
: LGTM: Message entryorganDonationRegistrationException
.The message entry is well-defined and provides a clear message for specifying exceptions to organ donation.
1014-1017
: LGTM: Message entryorganDonationRegistrationOptOut
.The message entry is well-defined and provides a clear message for opting out of organ donation.
* feat: add organ donation overview * feat: add organ donation registration * fix: form logic * fix: form logic * fix: text * fix: wrong naming * feat: add checkboxes * feat: simplify form * feat: add organ donation to submenu * feat: update list * fix: mobile input * fix: rewrite to fix order of checkboxes * feat: add feature flag for routes * feat: remove input & fix texts * feat: add scopes * fix: scope * fix: domain build issues * fix: nullable error * feat: connect to graphql * fix: naming --------- Co-authored-by: lommi <jonorn@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* feat: add organ donation overview * feat: add organ donation registration * fix: form logic * fix: form logic * fix: text * fix: wrong naming * feat: add checkboxes * feat: simplify form * feat: add organ donation to submenu * feat: update list * fix: mobile input * fix: rewrite to fix order of checkboxes * feat: add feature flag for routes * feat: remove input & fix texts * feat: add scopes * fix: scope * fix: domain build issues * fix: nullable error * feat: connect to graphql * fix: naming --------- Co-authored-by: lommi <jonorn@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Health - Organ donation UI 🫁
What
UI for organ donation
Why
First phase of moving all "Heilsuvera" related data to "Mínar síður"
Screenshots / Gifs
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation