Skip to content

Commit

Permalink
Merge branch 'main' into regulations-admin/actor-to-draft
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Oct 10, 2024
2 parents 3f81f13 + dddbfb4 commit 9febe76
Show file tree
Hide file tree
Showing 27 changed files with 6,095 additions and 4,552 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class InternalCaseService {
}
}

private async upploadRequestPdfToCourt(
private async uploadRequestPdfToCourt(
theCase: Case,
user: TUser,
): Promise<boolean> {
Expand Down Expand Up @@ -758,7 +758,7 @@ export class InternalCaseService {
): Promise<DeliverResponse> {
await this.refreshFormatMessage()

return this.upploadRequestPdfToCourt(theCase, user).then((delivered) => ({
return this.uploadRequestPdfToCourt(theCase, user).then((delivered) => ({
delivered,
}))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ export class CourtService {
subtypes,
defendants,
prosecutor,
courtName,
})

return this.sendToRobot(
Expand Down Expand Up @@ -624,7 +625,7 @@ export class CourtService {
}))

const subject = `${courtName} - ${courtCaseNumber} - verjanda upplýsingar`
const content = JSON.stringify(defendantInfo)
const content = JSON.stringify({ defendants: defendantInfo, courtName })

return this.sendToRobot(
subject,
Expand Down Expand Up @@ -657,7 +658,7 @@ export class CourtService {
): Promise<unknown> {
try {
const subject = `${courtName} - ${courtCaseNumber} - úthlutun`
const content = JSON.stringify(assignedRole)
const content = JSON.stringify({ ...assignedRole, courtName })

return this.sendToRobot(
subject,
Expand Down Expand Up @@ -689,7 +690,11 @@ export class CourtService {
noticeText?: string,
): Promise<unknown> {
const subject = `${courtName} - ${courtCaseNumber} - afturköllun`
const content = JSON.stringify({ subject: noticeSubject, text: noticeText })
const content = JSON.stringify({
subject: noticeSubject,
text: noticeText,
courtName,
})

return this.sendToRobot(
subject,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ query LimitedAccessCase($input: CaseQueryInput!) {
defenderPhoneNumber
defenderChoice
verdictViewDate
verdictAppealDeadline
subpoenas {
id
created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,6 @@ const IndictmentCaseFilesList: FC<Props> = ({
<RenderFiles caseFiles={civilClaims} onOpenFile={onOpen} />
</Box>
)}
{uploadedCaseFiles && uploadedCaseFiles.length > 0 && (
<Box marginBottom={5}>
<Text variant="h4" as="h4" marginBottom={3}>
{formatMessage(strings.uploadedCaseFiles)}
</Text>
<CaseFileTable caseFiles={uploadedCaseFiles} onOpenFile={onOpen} />
</Box>
)}
{showSubpoenaPdf && (
<Box marginBottom={5}>
<Text variant="h4" as="h4" marginBottom={1}>
Expand All @@ -253,6 +245,14 @@ const IndictmentCaseFilesList: FC<Props> = ({
)}
</Box>
)}
{uploadedCaseFiles && uploadedCaseFiles.length > 0 && (
<Box marginBottom={5}>
<Text variant="h4" as="h4" marginBottom={3}>
{formatMessage(strings.uploadedCaseFiles)}
</Text>
<CaseFileTable caseFiles={uploadedCaseFiles} onOpenFile={onOpen} />
</Box>
)}
<AnimatePresence>
{fileNotFound && <FileNotFoundModal dismiss={dismissFileNotFound} />}
</AnimatePresence>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const Conclusion: FC = () => {
courtDate: null,
postponedIndefinitelyExplanation: null,
indictmentRulingDecision: null,
mergeCaseId: null,
force: true,
}

Expand All @@ -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
Expand Down Expand Up @@ -400,101 +399,108 @@ const Conclusion: FC = () => {
</Box>
)}
{selectedAction === IndictmentDecision.COMPLETING && (
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.completingTitle)}
required
/>
<BlueBox>
<Box marginBottom={2}>
<RadioButton
id="decision-ruling"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.RULING
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.RULING)
}}
large
backgroundColor="white"
label={formatMessage(strings.ruling)}
/>
</Box>
<Box marginBottom={2}>
<>
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.completingTitle)}
required
/>
<BlueBox>
<Box marginBottom={2}>
<RadioButton
id="decision-ruling"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.RULING
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.RULING)
}}
large
backgroundColor="white"
label={formatMessage(strings.ruling)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-fine"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.FINE
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.FINE)
}}
large
backgroundColor="white"
label={formatMessage(strings.fine)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-dismissal"
name="decision"
checked={
selectedDecision ===
CaseIndictmentRulingDecision.DISMISSAL
}
onChange={() => {
setSelectedDecision(
CaseIndictmentRulingDecision.DISMISSAL,
)
}}
large
backgroundColor="white"
label={formatMessage(strings.dismissal)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-merge"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.MERGE
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.MERGE)
}}
large
backgroundColor="white"
label={formatMessage(strings.merge)}
/>
</Box>
<RadioButton
id="decision-fine"
id="decision-cancellation"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.FINE
selectedDecision ===
CaseIndictmentRulingDecision.CANCELLATION
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.FINE)
setSelectedDecision(
CaseIndictmentRulingDecision.CANCELLATION,
)
}}
large
backgroundColor="white"
label={formatMessage(strings.fine)}
label={formatMessage(strings.cancellation)}
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-dismissal"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.DISMISSAL
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.DISMISSAL)
}}
large
backgroundColor="white"
label={formatMessage(strings.dismissal)}
</BlueBox>
</Box>
{selectedDecision === CaseIndictmentRulingDecision.MERGE && (
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.connectedCaseNumbersTitle)}
required
/>
</Box>
<Box marginBottom={2}>
<RadioButton
id="decision-merge"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.MERGE
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.MERGE)
}}
large
backgroundColor="white"
label={formatMessage(strings.merge)}
<SelectConnectedCase
workingCase={workingCase}
setWorkingCase={setWorkingCase}
/>
</Box>
<RadioButton
id="decision-cancellation"
name="decision"
checked={
selectedDecision === CaseIndictmentRulingDecision.CANCELLATION
}
onChange={() => {
setSelectedDecision(CaseIndictmentRulingDecision.CANCELLATION)
}}
large
backgroundColor="white"
label={formatMessage(strings.cancellation)}
/>
</BlueBox>
</Box>
)}
</>
)}
{selectedDecision &&
selectedDecision === CaseIndictmentRulingDecision.MERGE && (
<Box marginBottom={5}>
<SectionHeading
title={formatMessage(strings.connectedCaseNumbersTitle)}
required
/>
<SelectConnectedCase
workingCase={workingCase}
setWorkingCase={setWorkingCase}
/>
</Box>
)}
{selectedAction && (
<Box
component="section"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions apps/web/utils/richText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { IntlConfig, IntlProvider } from 'react-intl'
import {
FaqList,
type FaqListProps,
Image,
type ImageProps,
renderConnectedComponent,
richText,
SectionWithImage,
Expand Down Expand Up @@ -279,6 +281,11 @@ const defaultRenderComponent = {
variant={slice.variant as 'accordion' | 'card'}
/>
),
Image: (slice: ImageProps) => {
const thumbnailUrl = slice?.url ? slice.url + '?w=50' : ''
const url = slice?.url ? slice.url + '?w=800' : ''
return <Image {...slice} thumbnail={thumbnailUrl} url={url} />
},
}

export const webRichText = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IsString, IsOptional, IsNumber } from 'class-validator'
import { IsString, IsOptional } from 'class-validator'
import { Field, InputType } from '@nestjs/graphql'

@InputType()
Expand Down
Loading

0 comments on commit 9febe76

Please sign in to comment.