Skip to content
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

fix(j-s): Render sent to prison admin files for FMST #17264

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export const include: Includeable[] = [
CaseFileCategory.PROSECUTOR_CASE_FILE,
CaseFileCategory.DEFENDANT_CASE_FILE,
CaseFileCategory.CIVIL_CLAIM,
CaseFileCategory.SENT_TO_PRISON_ADMIN_FILE,
],
},
separate: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const defenderCaseFileCategoriesForIndictmentCases =
const prisonAdminCaseFileCategories = [
CaseFileCategory.APPEAL_RULING,
CaseFileCategory.RULING,
CaseFileCategory.SENT_TO_PRISON_ADMIN_FILE,
]

const prisonStaffCaseFileCategories = [CaseFileCategory.APPEAL_RULING]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ describe('Limited Access View Case File Guard', () => {
const allowedCaseFileCategories = [
CaseFileCategory.APPEAL_RULING,
CaseFileCategory.RULING,
CaseFileCategory.SENT_TO_PRISON_ADMIN_FILE,
]

describe.each(allowedCaseFileCategories)(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,9 @@ export const strings = defineMessages({
defaultMessage: 'Áritað sektarboð',
description: 'Notaður sem texti í sektarboð í Refsitegund',
},
sentToPrisonAdminFileTitle: {
id: 'judicial.system.core:indictment_overview.sent_to_prison_admin_file_title',
defaultMessage: 'Fullnusta',
description: 'Titill á til fullnustu skjali',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ const IndictmentOverview = () => {
limitedAccessUpdateDefendant(defendantUpdate)
}

const sentToPrisonAdminFiles = workingCase.caseFiles?.filter(
(file) => file.category === CaseFileCategory.SENT_TO_PRISON_ADMIN_FILE,
)
thorhildurt marked this conversation as resolved.
Show resolved Hide resolved

const hasPunishmentType = (punishmentType: PunishmentType) =>
defendant?.punishmentType === punishmentType

Expand Down Expand Up @@ -94,6 +98,18 @@ const IndictmentOverview = () => {
}
/>
</Box>

{sentToPrisonAdminFiles && sentToPrisonAdminFiles.length > 0 && (
<Box marginBottom={5}>
<Text variant="h4" as="h4" marginBottom={1}>
{formatMessage(strings.sentToPrisonAdminFileTitle)}
</Text>
<RenderFiles
onOpenFile={onOpen}
caseFiles={sentToPrisonAdminFiles}
/>
</Box>
)}
<Box marginBottom={10}>
<Text variant="h4" as="h4" marginBottom={2}>
{formatMessage(strings.punishmentTypeTitle)}
Expand Down
Loading