From a08b0bd1952833d0e10192d1fe9b47d129f58fb7 Mon Sep 17 00:00:00 2001 From: Thorhildur Thorleiksdottir Date: Mon, 30 Dec 2024 10:30:05 +0000 Subject: [PATCH 1/4] fix(j-s): spelling error --- .../components/InfoCard/InfoCardActiveIndictment.tsx | 10 ++++++---- .../web/src/components/InfoCard/useInfoCardItems.tsx | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx b/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx index 7fea5b42fbda..f8ff5b86e3fb 100644 --- a/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx +++ b/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx @@ -17,7 +17,7 @@ const InfoCardActiveIndictment: React.FC = (props) => { prosecutor, policeCaseNumbers, court, - offences, + offenses, mergedCasePoliceCaseNumbers, mergedCaseCourtCaseNumber, mergedCaseProsecutor, @@ -45,12 +45,14 @@ const InfoCardActiveIndictment: React.FC = (props) => { prosecutor(workingCase.type), policeCaseNumbers, court, - offences, + offenses, ], columns: 2, }, ...(workingCase.mergedCases && workingCase.mergedCases.length > 0 - ? workingCase.mergedCases.map((mergedCase) => ({ + ? workingCase.mergedCases.map((mergedCase) => { + console.log({mergedCase}) + return ({ id: mergedCase.id, items: [ mergedCasePoliceCaseNumbers(mergedCase), @@ -60,7 +62,7 @@ const InfoCardActiveIndictment: React.FC = (props) => { mergedCaseCourt(mergedCase), ], columns: 2, - })) + })}) : []), ]} /> diff --git a/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx b/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx index a2112beb8c66..055cd2e6ca1e 100644 --- a/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx +++ b/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx @@ -132,8 +132,8 @@ const useInfoCardItems = () => { values: [workingCase.courtCaseNumber], } - const offences: Item = { - id: 'offences-item', + const offenses: Item = { + id: 'offenses-item', title: formatMessage(strings.offence), values: [ <> @@ -366,7 +366,7 @@ const useInfoCardItems = () => { policeCaseNumbers, court, courtCaseNumber, - offences, + offenses, judge, caseType, registrar, From d07203aa59c3d347367b0e41e878880dbac1d660 Mon Sep 17 00:00:00 2001 From: Thorhildur Thorleiksdottir Date: Mon, 30 Dec 2024 10:41:03 +0000 Subject: [PATCH 2/4] fix(j-s): remove unused controller variable --- .../backend/src/app/modules/case/limitedAccessCase.controller.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.controller.ts b/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.controller.ts index be63d588328f..22e6be63d5e0 100644 --- a/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.controller.ts +++ b/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.controller.ts @@ -77,7 +77,6 @@ export class LimitedAccessCaseController { private readonly limitedAccessCaseService: LimitedAccessCaseService, private readonly eventService: EventService, private readonly pdfService: PdfService, - private readonly defendantService: DefendantService, @Inject(LOGGER_PROVIDER) private readonly logger: Logger, ) {} From 5a3838ad0a19cc171af3a59af31e3089e6c1e619 Mon Sep 17 00:00:00 2001 From: Thorhildur Thorleiksdottir Date: Mon, 30 Dec 2024 11:56:09 +0000 Subject: [PATCH 3/4] fix(j-s): add missing props to limited access case for merged cases --- .../app/modules/case/limitedAccessCase.service.ts | 3 +++ .../FormProvider/limitedAccessCase.graphql | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts b/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts index a837de8c2089..53eb58b5ed7f 100644 --- a/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts +++ b/apps/judicial-system/backend/src/app/modules/case/limitedAccessCase.service.ts @@ -290,6 +290,9 @@ export const include: Includeable[] = [ }, separate: true, }, + { model: Institution, as: 'court' }, + { model: User, as: 'judge' }, + { model: Institution, as: 'prosecutorsOffice' }, ], separate: true, }, diff --git a/apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql b/apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql index 8d31030894bc..01e86026518e 100644 --- a/apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql +++ b/apps/judicial-system/web/src/components/FormProvider/limitedAccessCase.graphql @@ -229,6 +229,18 @@ query LimitedAccessCase($input: CaseQueryInput!) { } policeCaseNumbers indictmentSubtypes + court { + id + name + } + judge { + id + name + } + prosecutorsOffice { + id + name + } } hasCivilClaims civilClaimants { From 6791ef26d3c830767acf98bffefb65631395ba9a Mon Sep 17 00:00:00 2001 From: Thorhildur Thorleiksdottir Date: Mon, 30 Dec 2024 12:05:28 +0000 Subject: [PATCH 4/4] fix(j-s): adjustments + fixing leftover renaming --- .../components/InfoCard/InfoCardActiveIndictment.tsx | 6 ++---- .../components/InfoCard/InfoCardClosedIndictment.tsx | 4 ++-- .../components/InfoCard/useInfoCardItems.strings.ts | 4 ++-- .../web/src/components/InfoCard/useInfoCardItems.tsx | 10 +++++----- .../Prosecutor/Indictments/Indictment/Indictment.tsx | 2 +- .../Indictments/Indictment/IndictmentCount.spec.tsx | 2 +- .../Indictments/Indictment/IndictmentCount.tsx | 6 +++--- 7 files changed, 16 insertions(+), 18 deletions(-) diff --git a/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx b/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx index f8ff5b86e3fb..263218e21f34 100644 --- a/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx +++ b/apps/judicial-system/web/src/components/InfoCard/InfoCardActiveIndictment.tsx @@ -50,9 +50,7 @@ const InfoCardActiveIndictment: React.FC = (props) => { columns: 2, }, ...(workingCase.mergedCases && workingCase.mergedCases.length > 0 - ? workingCase.mergedCases.map((mergedCase) => { - console.log({mergedCase}) - return ({ + ? workingCase.mergedCases.map((mergedCase) => ({ id: mergedCase.id, items: [ mergedCasePoliceCaseNumbers(mergedCase), @@ -62,7 +60,7 @@ const InfoCardActiveIndictment: React.FC = (props) => { mergedCaseCourt(mergedCase), ], columns: 2, - })}) + })) : []), ]} /> diff --git a/apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment.tsx b/apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment.tsx index 88391ea722d7..c48323d3795d 100644 --- a/apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment.tsx +++ b/apps/judicial-system/web/src/components/InfoCard/InfoCardClosedIndictment.tsx @@ -23,7 +23,7 @@ const InfoCardClosedIndictment: FC = (props) => { court, prosecutor, judge, - offence, + offense, indictmentReviewer, indictmentReviewDecision, indictmentReviewedDate, @@ -67,7 +67,7 @@ const InfoCardClosedIndictment: FC = (props) => { court, prosecutor(workingCase.type), judge, - offence, + offense, ], columns: 2, }, diff --git a/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.strings.ts b/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.strings.ts index 1cff30e2a52b..07a612bf60a6 100644 --- a/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.strings.ts +++ b/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.strings.ts @@ -12,8 +12,8 @@ export const strings = defineMessages({ defaultMessage: 'Ákærandi', description: 'Notaður sem titill á "ákærandi" hluta af yfirliti ákæru.', }, - offence: { - id: 'judicial.system.core:info_card_indictment.offence', + offense: { + id: 'judicial.system.core:info_card_indictment.offense', defaultMessage: 'Brot', description: 'Notaður sem titill á "brot" hluta af yfirliti ákæru.', }, diff --git a/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx b/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx index 055cd2e6ca1e..d3fedef39f98 100644 --- a/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx +++ b/apps/judicial-system/web/src/components/InfoCard/useInfoCardItems.tsx @@ -134,7 +134,7 @@ const useInfoCardItems = () => { const offenses: Item = { id: 'offenses-item', - title: formatMessage(strings.offence), + title: formatMessage(strings.offense), values: [ <> {readableIndictmentSubtypes( @@ -172,9 +172,9 @@ const useInfoCardItems = () => { ], } - const offence: Item = { - id: 'offence-item', - title: formatMessage(strings.offence), + const offense: Item = { + id: 'offense-item', + title: formatMessage(strings.offense), values: [ <> {readableIndictmentSubtypes( @@ -370,7 +370,7 @@ const useInfoCardItems = () => { judge, caseType, registrar, - offence, + offense, requestedCourtDate, mergeCase, mergedCasePoliceCaseNumbers, diff --git a/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Indictment.tsx b/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Indictment.tsx index e30f6bd64f9a..a49b674b112d 100644 --- a/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Indictment.tsx +++ b/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/Indictment.tsx @@ -127,7 +127,7 @@ const Indictment = () => { const setDriversLicenseSuspensionRequest = useCallback( (indictmentCounts?: TIndictmentCount[]) => { // If the case has: - // at least one count with the offence driving under the influence of alcohol, illegal drugs or prescription drugs + // at least one count with the offense driving under the influence of alcohol, illegal drugs or prescription drugs // then by default the prosecutor requests a suspension of the driver's licence. const requestDriversLicenseSuspension = indictmentCounts?.some((count) => count.offenses?.some((offense) => diff --git a/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.spec.tsx b/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.spec.tsx index 8aa5d8e14030..73ad273f1eb1 100644 --- a/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.spec.tsx +++ b/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.spec.tsx @@ -151,7 +151,7 @@ describe('getIncidentDescriptionReason', () => { ) }) - test('should return a description with illegal drugs as third offence', () => { + test('should return a description with illegal drugs as third offense', () => { const offenses = [ offense.DRIVING_WITHOUT_LICENCE, offense.DRUNK_DRIVING, diff --git a/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.tsx b/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.tsx index d1c964386e88..4be8ae4dca49 100644 --- a/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.tsx +++ b/apps/judicial-system/web/src/routes/Prosecutor/Indictments/Indictment/IndictmentCount.tsx @@ -131,10 +131,10 @@ const getLawsBroken = ( let lawsBroken: [number, number][] = [] - offenses.forEach((offence) => { - lawsBroken = lawsBroken.concat(offenseLawsMap[offence]) + offenses.forEach((offense) => { + lawsBroken = lawsBroken.concat(offenseLawsMap[offense]) - if (offence === IndictmentCountOffense.DRUNK_DRIVING) { + if (offense === IndictmentCountOffense.DRUNK_DRIVING) { lawsBroken = lawsBroken.concat( ((substances && substances.ALCOHOL) || '') >= '1,20' ? offenseLawsMap.DRUNK_DRIVING_MAJOR