Skip to content

Commit

Permalink
fix(j-s): Render sent to prison admin files for FMST (#17264)
Browse files Browse the repository at this point in the history
* fix(j-s): Render sent to prison admin files for FMST

* Update limitedAccessViewCaseFileGuard.spec.ts

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
unakb and kodiakhq[bot] authored Dec 17, 2024
1 parent c3e8a9e commit b7c9767
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
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,
)

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

0 comments on commit b7c9767

Please sign in to comment.