-
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
feat(j-s): Indictment overview for prison users #15357
Conversation
WalkthroughThe updates focus on integrating new functionalities and enhancing existing features across various modules in the judicial system web and backend applications. This includes adding role-based routing, enhancing the Changes
Sequence DiagramssequenceDiagram
participant AuthController
participant User
participant RouteHandler
User->>AuthController: Access App
AuthController->>RouteHandler: Check User Role
RouteHandler->>User: Route Based on Role (i.e., PRISON_CASES_ROUTE)
sequenceDiagram
participant CaseService
participant Database
participant EventLogService
CaseService->>Database: Update Indictment Review Decision
Database->>CaseService: Indictment Review Decision Updated
CaseService->>EventLogService: Create INDICTMENT_REVIEWED Event
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 (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #15357 +/- ##
==========================================
+ Coverage 37.01% 37.03% +0.01%
==========================================
Files 6554 6543 -11
Lines 133952 133215 -737
Branches 38339 38211 -128
==========================================
- Hits 49585 49332 -253
+ Misses 84367 83883 -484
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 204 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ❌ 8 Total Test Services: 1 Failed, 7 Passed Test Services
❌ Failed Tests (1)
🔻 Code Coverage Decreases vs Default Branch (1)
|
…d-is/island.is into j-s/prison-indictments
…og' into j-s/prison-indictments-list
…n-indictments # Conflicts: # apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx # # It looks like you may be committing a merge. # If this is not correct, please run # git update-ref -d MERGE_HEAD # and try again. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # On branch j-s/prison-indictments # All conflicts fixed but you are still merging. # # Changes to be committed: # modified: apps/judicial-system/web/src/components/AccordionItems/CaseFilesAccordionItem/CaseFilesAccordionItem.tsx # modified: apps/judicial-system/web/src/components/AccordionItems/CommentsAccordionItem/CommentsAccordionItem.tsx
…nd-is/island.is into j-s/prison-indictments-list
…land.is into j-s/prison-indictments
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 (20)
- apps/judicial-system/api/src/app/modules/auth/auth.controller.ts (2 hunks)
- apps/judicial-system/backend/src/app/modules/case/case.service.ts (1 hunks)
- apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts (2 hunks)
- apps/judicial-system/web/pages/fangelsi/akaera/yfirlit/[id].ts (1 hunks)
- apps/judicial-system/web/pages/fangelsi/krafa/yfirlit/[id].ts (1 hunks)
- apps/judicial-system/web/pages/fangelsi/krofur.ts (1 hunks)
- apps/judicial-system/web/src/components/FormFooter/FormFooter.tsx (1 hunks)
- apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql (1 hunks)
- apps/judicial-system/web/src/components/Header/Header.tsx (2 hunks)
- apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.strings.ts (1 hunks)
- apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (3 hunks)
- apps/judicial-system/web/src/components/InfoCard/InfoCard.tsx (2 hunks)
- apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment/InfoCardClosedIndictment.tsx (5 hunks)
- apps/judicial-system/web/src/components/InfoCard/InfoCardIndictment.strings.ts (1 hunks)
- apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.strings.ts (1 hunks)
- apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.tsx (1 hunks)
- apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/SignedVerdictOverview.tsx (1 hunks)
- apps/judicial-system/web/src/utils/hooks/useCaseList/index.tsx (4 hunks)
- libs/judicial-system/consts/src/lib/consts.ts (1 hunks)
- libs/judicial-system/types/src/lib/eventLog.ts (1 hunks)
Files skipped from review due to trivial changes (5)
- apps/judicial-system/web/pages/fangelsi/akaera/yfirlit/[id].ts
- apps/judicial-system/web/pages/fangelsi/krafa/yfirlit/[id].ts
- apps/judicial-system/web/pages/fangelsi/krofur.ts
- apps/judicial-system/web/src/components/FormFooter/FormFooter.tsx
- apps/judicial-system/web/src/components/InfoCard/InfoCardIndictment.strings.ts
Additional context used
Path-based instructions (15)
libs/judicial-system/types/src/lib/eventLog.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/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.strings.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."
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.strings.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."
apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql (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."
apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.tsx (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."
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (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."
apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment/InfoCardClosedIndictment.tsx (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."
apps/judicial-system/web/src/components/InfoCard/InfoCard.tsx (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."
apps/judicial-system/web/src/components/Header/Header.tsx (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."
apps/judicial-system/web/src/utils/hooks/useCaseList/index.tsx (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."
apps/judicial-system/api/src/app/modules/auth/auth.controller.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."
libs/judicial-system/consts/src/lib/consts.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/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.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."
apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/SignedVerdictOverview.tsx (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."
apps/judicial-system/backend/src/app/modules/case/case.service.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."
Learnings (7)
Common learnings
Learnt from: unakb PR: island-is/island.is#15378 File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100 Timestamp: 2024-06-27T14:37:07.823Z Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.strings.ts (1)
Learnt from: gudjong PR: island-is/island.is#15241 File: apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts:87-90 Timestamp: 2024-06-14T15:09:02.068Z Learning: In some parts of the codebase, `verdictViewDate` is treated as a string, not a Date object, specifically in `updateDefendant.input.ts`, `defendant.model.ts`, and `case.transformer.ts`.
apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.tsx (3)
Learnt from: unakb PR: island-is/island.is#15378 File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100 Timestamp: 2024-06-27T14:37:07.823Z Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
Learnt from: unakb PR: island-is/island.is#14712 File: apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/IndictmentOverview.tsx:0-0 Timestamp: 2024-05-06T18:09:27.876Z Learning: The judicial system application uses a toaster notification system to handle errors globally.
Learnt from: gudjong PR: island-is/island.is#15421 File: apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx:55-61 Timestamp: 2024-07-03T15:43:13.884Z Learning: The `updateCase` method in the `apps/judicial-system/web/src/routes/Prosecutor/Indictments/Processing/Processing.tsx` file has its own error handling, and additional error handling in the `initialize` function is not necessary.
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (2)
Learnt from: gudjong PR: island-is/island.is#15241 File: apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts:87-90 Timestamp: 2024-06-14T15:09:02.068Z Learning: In some parts of the codebase, `verdictViewDate` is treated as a string, not a Date object, specifically in `updateDefendant.input.ts`, `defendant.model.ts`, and `case.transformer.ts`.
Learnt from: unakb PR: island-is/island.is#14922 File: apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx:43-49 Timestamp: 2024-05-27T10:53:40.687Z Learning: The `getAppealExpirationInfo` function in `DefendantInfo.tsx` correctly uses `today < expiryDate` to determine if the current date is before the appeal expiration date.
apps/judicial-system/web/src/components/InfoCard/InfoCard.tsx (1)
Learnt from: gudjong PR: island-is/island.is#15241 File: apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts:87-90 Timestamp: 2024-06-14T15:09:02.068Z Learning: In some parts of the codebase, `verdictViewDate` is treated as a string, not a Date object, specifically in `updateDefendant.input.ts`, `defendant.model.ts`, and `case.transformer.ts`.
apps/judicial-system/web/src/utils/hooks/useCaseList/index.tsx (1)
Learnt from: unakb PR: island-is/island.is#15378 File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100 Timestamp: 2024-06-27T14:37:07.823Z Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/SignedVerdictOverview.tsx (1)
Learnt from: unakb PR: island-is/island.is#15378 File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100 Timestamp: 2024-06-27T14:37:07.823Z Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
Additional comments not posted (24)
libs/judicial-system/types/src/lib/eventLog.ts (1)
9-9
: LGTM! Verify the usage of the new event type.The addition of the new event type
INDICTMENT_REVIEWED
looks good.However, ensure that this event type is used consistently across the codebase.
Verification successful
Usage of
INDICTMENT_REVIEWED
VerifiedThe new event type
INDICTMENT_REVIEWED
is defined and used in the codebase as expected.
- Defined in:
libs/judicial-system/types/src/lib/eventLog.ts
- Used in:
apps/judicial-system/backend/src/app/modules/case/case.service.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new event type `INDICTMENT_REVIEWED`. # Test: Search for the usage of the new event type. Expect: Occurrences of `INDICTMENT_REVIEWED`. rg --type-add 'ts' --type ts 'INDICTMENT_REVIEWED'Length of output: 108
Script:
#!/bin/bash # Description: Verify the usage of the new event type `INDICTMENT_REVIEWED`. # Test: Search for the usage of the new event type. Expect: Occurrences of `INDICTMENT_REVIEWED`. rg 'INDICTMENT_REVIEWED' --glob '*.ts'Length of output: 239
apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.strings.ts (1)
1-1
: LGTM! Verify consistency of message IDs and default messages.The new message definitions for the indictment overview screen look good.
However, ensure that the message IDs and default messages are consistent with the rest of the application.
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.strings.ts (1)
26-30
: LGTM! Verify consistency of message ID and default message.The new message definition for the verdict displayed date looks good.
However, ensure that the message ID and default message are consistent with the rest of the application.
Verification successful
No inconsistencies found for message ID and default message.
The message ID
judicial.system.core:info_card.defendant_info.verdict_displayed_date
and the default messageDómur birtur {date}
are only defined in theDefendantInfo.strings.ts
file and are not used elsewhere in the codebase.
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.strings.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the message ID and default message. # Test: Search for the message ID and default message. Expect: Consistent usage across the application. rg --type-add 'ts' --type ts 'judicial.system.core:info_card.defendant_info.verdict_displayed_date'Length of output: 157
Script:
#!/bin/bash # Description: Verify the consistency of the message ID and default message. # Test: Search for the message ID and default message. Expect: Consistent usage across the application. rg --type-add 'ts:*.ts' 'judicial.system.core:info_card.defendant_info.verdict_displayed_date'Length of output: 262
Script:
#!/bin/bash # Description: Verify the consistency of the default message. # Test: Search for the default message. Expect: Consistent usage across the application. rg --type-add 'ts:*.ts' 'Dómur birtur {date}'Length of output: 163
Script:
#!/bin/bash # Description: Verify the consistency of the default message. # Test: Search for the default message. Expect: Consistent usage across the application. rg --type-add 'ts:*.ts' 'Dómur birtur \{date\}'Length of output: 180
apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql (1)
149-159
: LGTM! Verify the usage of the new fields.The addition of the new fields for indictment review decision, indictment reviewer, and event logs looks good.
However, ensure that these fields are used correctly in the application.
Verification successful
The new fields are correctly used in the application.
The fields
indictmentReviewDecision
,indictmentReviewer
, andeventLogs
are integrated and utilized in various parts of the application, indicating proper usage.
apps/judicial-system/web/src/components/TagCaseState/TagCaseState.tsx
apps/judicial-system/web/src/utils/hooks/useCase/index.ts
apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.tsx
apps/judicial-system/web/src/routes/PublicProsecutor/components/ReviewDecision/ReviewDecision.tsx
apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx
apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesAwaitingReview.tsx
apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.tsx
apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesForReview.tsx
apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx
apps/judicial-system/web/src/components/InfoCard/InfoCardIndictment.strings.ts
apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment/InfoCardClosedIndictment.tsx
apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx
apps/judicial-system/web/src/routes/CourtOfAppeal/components/CaseOverviewHeader/CaseOverviewHeader.tsx
apps/judicial-system/web/src/routes/Court/Indictments/Completed/Completed.tsx
apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx
apps/judicial-system/api/src/app/modules/case/interceptors/case.transformer.ts
apps/judicial-system/api/src/app/modules/case-list/interceptors/caseList.interceptor.ts
apps/judicial-system/api/src/app/modules/case/models/case.model.ts
apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts
apps/judicial-system/api/src/app/modules/case/dto/updateCase.input.ts
apps/judicial-system/backend/src/app/modules/file/file.service.ts
apps/judicial-system/backend/src/app/modules/case/pdf.service.ts
apps/judicial-system/backend/src/app/modules/case/internalCase.service.ts
apps/judicial-system/backend/src/app/modules/case/interceptors/caseList.interceptor.ts
apps/judicial-system/backend/src/app/modules/case/case.service.ts
apps/judicial-system/backend/src/app/modules/case/models/case.model.ts
apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts
apps/judicial-system/backend/src/app/modules/case/test/internalCaseController/deliverIndictmentInfoToCourt.spec.ts
apps/judicial-system/backend/src/app/modules/case/guards/rolesRules.ts
apps/judicial-system/backend/src/app/modules/case/filters/cases.filter.ts
apps/judicial-system/backend/src/app/modules/case/filters/test/cases.filter.spec.ts
apps/judicial-system/backend/src/app/modules/case/dto/updateCase.dto.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new fields in the GraphQL query. # Test: Search for the usage of the new fields. Expect: Correct usage in the application. rg --type-add 'graphql' --type graphql 'indictmentReviewDecision|indictmentReviewer|eventLogs'Length of output: 154
Script:
#!/bin/bash # Description: Verify the usage of the new fields in the GraphQL query. # Correctly define the 'graphql' type as '*.graphql' files and search for the usage of the new fields. rg --type-add 'graphql:*.graphql' --type graphql 'indictmentReviewDecision|indictmentReviewer|eventLogs'Length of output: 861
Script:
#!/bin/bash # Description: Verify the usage of the new fields in the TypeScript/JavaScript files. # Search for the usage of the new fields in TypeScript/JavaScript files. rg 'indictmentReviewDecision|indictmentReviewer|eventLogs' --type js --type tsLength of output: 10410
apps/judicial-system/web/src/routes/Prison/IndictmentOverview/IndictmentOverview.tsx (2)
1-24
: Imports look good.The added imports are appropriate and necessary for the functionality of the component.
26-103
: Component logic looks good.The usage of hooks and context is appropriate and aligns with the PR objectives.
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (2)
30-30
: Prop addition looks good.The addition of the
displayVerdictViewDate
prop is clear and follows TypeScript best practices.
33-40
: Prop usage looks good.The usage of the
displayVerdictViewDate
prop is correct and aligns with the component's functionality.Also applies to: 110-116
apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment/InfoCardClosedIndictment.tsx (3)
21-22
: Prop additions look good.The addition of the
displayVerdictViewDate
andindictmentReviewedDate
props is clear and follows TypeScript best practices.
68-73
: Prop usage looks good.The usage of the
displayVerdictViewDate
andindictmentReviewedDate
props is correct and aligns with the component's functionality.
Line range hint
29-57
:
Function update looks good.The update to the
getAdditionalDataSections
function is correct and ensures that the indictment review details are included in the data sections.apps/judicial-system/web/src/components/InfoCard/InfoCard.tsx (2)
42-42
: Prop addition looks good.The addition of the
displayVerdictViewDate
prop to thedefendants
object is clear and follows TypeScript best practices.
134-134
: Prop usage looks good.The usage of the
displayVerdictViewDate
prop in theDefendantInfo
component is correct and aligns with the component's functionality.apps/judicial-system/web/src/components/Header/Header.tsx (2)
34-34
: Import looks good!The import of
isPrisonSystemUser
from@island.is/judicial-system/types
is necessary for the new functionality.
100-101
: Correct implementation for prison system user routing.The addition of the condition
isPrisonSystemUser(user)
to thelogoHref
assignment ensures that prison system users are correctly routed toconstants.PRISON_CASES_ROUTE
.apps/judicial-system/web/src/utils/hooks/useCaseList/index.tsx (2)
18-18
: Import looks good!The import of
isPrisonSystemUser
from@island.is/judicial-system/types
is necessary for the new functionality.
Line range hint
100-124
:
Correct implementation for prison system user routing.The addition of conditions for
isPrisonSystemUser(user)
within theopenCase
function ensures that prison system users are correctly routed to their respective routes for completed cases.apps/judicial-system/api/src/app/modules/auth/auth.controller.ts (2)
31-31
: Import looks good!The import of
isPrisonSystemUser
from@island.is/judicial-system/types
is necessary for the new functionality.
246-247
: Correct implementation for prison system user routing.The addition of the condition
isPrisonSystemUser(user)
to theauthorizeUser
method ensures that prison system users are correctly routed toPRISON_CASES_ROUTE
.libs/judicial-system/consts/src/lib/consts.ts (1)
105-108
: New routes for prison system users are correctly defined.The addition of
PRISON_CASES_ROUTE
,PRISON_SIGNED_VERDICT_OVERVIEW_ROUTE
, andPRISON_CLOSED_INDICTMENT_OVERVIEW_ROUTE
aligns with the PR objectives and ensures proper routing for prison system users.apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts (2)
108-108
: Approved: Addition ofindictmentReviewerId
attribute.The addition of the
indictmentReviewerId
attribute to theattributes
array is correct.
168-172
: Approved: Addition ofindictmentReviewer
model to include array.The addition of the
indictmentReviewer
model and its associated institution to theinclude
array is correct.apps/judicial-system/web/src/routes/Shared/SignedVerdictOverview/SignedVerdictOverview.tsx (1)
447-453
: Approved: Addition of routing logic for prison users.The addition of routing logic for prison users within the
onClick
handler of the back button is correct.apps/judicial-system/backend/src/app/modules/case/case.service.ts (1)
1489-1497
: Ensure completeness of event logging for indictment review decision.The added logic to handle
update.indictmentReviewDecision
appears correct and follows the pattern used for other event types. However, ensure that all necessary information is included in the event log.Ensure that the event log creation for
INDICTMENT_REVIEWED
is comprehensive and includes all required information.
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.
Just one small comment to consider
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 (3)
- apps/judicial-system/web/pages/fangelsi/krofur.ts (1 hunks)
- apps/judicial-system/web/src/components/InfoCard/InfoCardIndictment.strings.ts (1 hunks)
- apps/judicial-system/web/src/routes/Shared/Cases/AllCases.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/judicial-system/web/src/routes/Shared/Cases/AllCases.tsx
Files skipped from review as they are similar to previous changes (2)
- apps/judicial-system/web/pages/fangelsi/krofur.ts
- apps/judicial-system/web/src/components/InfoCard/InfoCardIndictment.strings.ts
Datadog ReportAll test runs ❌ 8 Total Test Services: 1 Failed, 7 Passed Test Services
❌ Failed Tests (1)
🔻 Code Coverage Decreases vs Default Branch (1)
|
…is into j-s/prison-indictments
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 (1)
- apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql
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 (1)
- apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment/InfoCardClosedIndictment.spec.ts (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment/InfoCardClosedIndictment.spec.ts
* Started working on indictment overview for prisons * Add indictment completed event type to event log * feat(j-s): FMST sees relevant indictment cases * Use event logs for completed indictments * Allow verdictDisplayedDate in info card * Add verdictViewDate to ClosedIndictmentInfoCard * Show indictmentReviewedDate on closedIndictmentInfoCard * feat(j-s): Prison cases * fix(j-s): cases filter test * Update indictmentCase.spec.ts * feat(j-s): return indictment completed date * Spesific prison routes * Add indictmentReviewer to limited access case * Add footer * Checkpoint * Change copy * Fix build * Fix tests --------- Co-authored-by: unakb <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Indictment overview for prison users
Asana
What
This PR implements an indictment overview screen for prison users. It also changes the routing for prison users. Now their pages are prefixed with
/fangelsi/
, i.e./fangelsi/krofur
and/fangelsi/akaera/yfirlit/[id]
Why
When S-cases go live, the prisons need to be able to see the cases.
Screenshots / Gifs
Checklist:
Summary by CodeRabbit
New Features
limitedAccessCase
GraphQL query to capture indictment and event log details.Bug Fixes
InfoCardClosedIndictment
to correctly display indictment review information.Improvements