From e3cd3f76fd28af768728bf7f9979eca6bd3184b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0j=C3=B3n=20Gu=C3=B0j=C3=B3nsson?= Date: Mon, 7 Oct 2024 11:41:14 +0200 Subject: [PATCH 1/3] Clears merge case id when the court conclusion does not involve merging the case --- .../routes/Court/Indictments/Conclusion/Conclusion.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx b/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx index b33c38ded1c6..81dd38d31d63 100644 --- a/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx +++ b/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx @@ -119,6 +119,7 @@ const Conclusion: FC = () => { courtDate: null, postponedIndefinitelyExplanation: null, indictmentRulingDecision: null, + mergeCaseId: null, force: true, } @@ -137,11 +138,9 @@ const Conclusion: FC = () => { break case IndictmentDecision.COMPLETING: update.indictmentRulingDecision = selectedDecision - update.mergeCaseId = - selectedDecision === CaseIndictmentRulingDecision.MERGE - ? workingCase.mergeCase?.id - : null - + if (selectedDecision === CaseIndictmentRulingDecision.MERGE) { + update.mergeCaseId = workingCase.mergeCase?.id + } break case IndictmentDecision.REDISTRIBUTING: update.judgeId = null From ed4568efb0ea4546c7e787ff8e83c74ffe59ec96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0j=C3=B3n=20Gu=C3=B0j=C3=B3nsson?= Date: Mon, 7 Oct 2024 12:04:12 +0200 Subject: [PATCH 2/3] Only shows merge id when completing a case --- .../Indictments/Conclusion/Conclusion.tsx | 171 +++++++++--------- 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx b/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx index 81dd38d31d63..1d38486bc52c 100644 --- a/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx +++ b/apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx @@ -399,101 +399,108 @@ const Conclusion: FC = () => { )} {selectedAction === IndictmentDecision.COMPLETING && ( - - - - - { - setSelectedDecision(CaseIndictmentRulingDecision.RULING) - }} - large - backgroundColor="white" - label={formatMessage(strings.ruling)} - /> - - + <> + + + + + { + setSelectedDecision(CaseIndictmentRulingDecision.RULING) + }} + large + backgroundColor="white" + label={formatMessage(strings.ruling)} + /> + + + { + setSelectedDecision(CaseIndictmentRulingDecision.FINE) + }} + large + backgroundColor="white" + label={formatMessage(strings.fine)} + /> + + + { + setSelectedDecision( + CaseIndictmentRulingDecision.DISMISSAL, + ) + }} + large + backgroundColor="white" + label={formatMessage(strings.dismissal)} + /> + + + { + setSelectedDecision(CaseIndictmentRulingDecision.MERGE) + }} + large + backgroundColor="white" + label={formatMessage(strings.merge)} + /> + { - setSelectedDecision(CaseIndictmentRulingDecision.FINE) + setSelectedDecision( + CaseIndictmentRulingDecision.CANCELLATION, + ) }} large backgroundColor="white" - label={formatMessage(strings.fine)} + label={formatMessage(strings.cancellation)} /> - - - { - setSelectedDecision(CaseIndictmentRulingDecision.DISMISSAL) - }} - large - backgroundColor="white" - label={formatMessage(strings.dismissal)} + + + {selectedDecision === CaseIndictmentRulingDecision.MERGE && ( + + - - - { - setSelectedDecision(CaseIndictmentRulingDecision.MERGE) - }} - large - backgroundColor="white" - label={formatMessage(strings.merge)} + - { - setSelectedDecision(CaseIndictmentRulingDecision.CANCELLATION) - }} - large - backgroundColor="white" - label={formatMessage(strings.cancellation)} - /> - - + )} + )} - {selectedDecision && - selectedDecision === CaseIndictmentRulingDecision.MERGE && ( - - - - - )} {selectedAction && ( Date: Mon, 7 Oct 2024 12:04:58 +0200 Subject: [PATCH 3/3] Clears court conclusion when scheduling a issuing a new subpoena --- .../Court/Indictments/Subpoena/Subpoena.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx b/apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx index 0eab4a0af95b..bc07f49331d6 100644 --- a/apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx +++ b/apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx @@ -77,7 +77,23 @@ const Subpoena: FC = () => { return } - const courtDateUpdated = await sendCourtDateToServer() + // If rescheduling after the court has met, then clear the current conclusion + const clearedConclusion = + isArraignmentScheduled && workingCase.indictmentDecision + ? [ + { + indictmentDecision: null, + courtSessionType: null, + courtDate: null, + postponedIndefinitelyExplanation: null, + indictmentRulingDecision: null, + mergeCaseId: null, + force: true, + }, + ] + : undefined + + const courtDateUpdated = await sendCourtDateToServer(clearedConclusion) if (!courtDateUpdated) { return