Skip to content

Commit

Permalink
Fixes generated pdf view for prosecutors
Browse files Browse the repository at this point in the history
  • Loading branch information
gudjong committed Oct 29, 2024
1 parent b86cd04 commit c6ab3ee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ const IndictmentOverview = () => {
))}
</Accordion>
)}
{workingCase.caseFiles && (
<Box component="section" marginBottom={10}>
<IndictmentCaseFilesList workingCase={workingCase} />
</Box>
)}
<Box component="section" marginBottom={10}>
<IndictmentCaseFilesList workingCase={workingCase} />
</Box>
{workingCase.defendants && (
<Box component="section" marginBottom={5}>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,9 @@ export const Overview = () => {
<IndictmentsLawsBrokenAccordionItem workingCase={workingCase} />
</Box>
)} */}
{workingCase.caseFiles && (
<Box component="section" marginBottom={5}>
<IndictmentCaseFilesList workingCase={workingCase} />
</Box>
)}
<Box component="section" marginBottom={5}>
<IndictmentCaseFilesList workingCase={workingCase} />
</Box>
<Box marginBottom={5}>
<SectionHeading
title={fm(strings.reviewerTitle)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { normalizeAndFormatNationalId } from '@island.is/judicial-system/formatt
import {
isCompletedCase,
isDefenceUser,
isProsecutionUser,
} from '@island.is/judicial-system/types'
import { titles } from '@island.is/judicial-system-web/messages'
import {
Expand Down Expand Up @@ -68,7 +69,8 @@ const IndictmentOverview: FC = () => {
) &&
workingCase.indictmentDecision !==
IndictmentDecision.POSTPONING_UNTIL_VERDICT
const shouldDisplayGeneratedPDFs =
const shouldDisplayGeneratedPdfFiles =
isProsecutionUser(user) ||
workingCase.defendants?.some(
(defendant) =>
defendant.isDefenderChoiceConfirmed &&
Expand Down Expand Up @@ -171,25 +173,23 @@ const IndictmentOverview: FC = () => {
<ConnectedCaseFilesAccordionItem
connectedCaseParentId={workingCase.id}
connectedCase={mergedCase}
displayGeneratedPDFs={shouldDisplayGeneratedPDFs}
displayGeneratedPDFs={shouldDisplayGeneratedPdfFiles}
/>
</Box>
))}
</Accordion>
)}
</Box>
)}
{workingCase.caseFiles && ( // TODO: Find a more accurate condition, there may be generated PDFs to display even if there are no uploaded files to display
<Box
component="section"
marginBottom={shouldDisplayReviewDecision || canAddFiles ? 5 : 10}
>
<IndictmentCaseFilesList
workingCase={workingCase}
displayGeneratedPDFs={shouldDisplayGeneratedPDFs}
/>
</Box>
)}
<Box
component="section"
marginBottom={shouldDisplayReviewDecision || canAddFiles ? 5 : 10}
>
<IndictmentCaseFilesList
workingCase={workingCase}
displayGeneratedPDFs={shouldDisplayGeneratedPdfFiles}
/>
</Box>
{canAddFiles && (
<Box display="flex" justifyContent="flexEnd" marginBottom={10}>
<Button
Expand Down

0 comments on commit c6ab3ee

Please sign in to comment.