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

feat(j-s): Indictment decision tag on summary page #15378

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -38,4 +38,10 @@ export const strings = defineMessages({
defaultMessage: 'Gögn hafa verið send ákæranda og verjanda.',
description: 'Notaður sem texti í staðfestingarglugga um að mál sé lokið.',
},
indictmentRulingDecisionTagText: {
id: 'judicial.system.core:indictments.summary.indictment_ruling_decision_tag_text',
defaultMessage:
'{indictmentRulingDecision, select, RULING {Dómur} FINE {Viðurlagaákvörðun} DISMISSAL {Frávísun} CANCELLATION {Niðurfelling} other {Lokið}}',
description: 'Notaður sem texti í TagCaseState til að birta úrskurð ákæru.',
},
})
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { FC, useContext, useState } from 'react'
import { useIntl } from 'react-intl'
import router from 'next/router'

import { Box, Text } from '@island.is/island-ui/core'
import { Box, Tag, TagVariant, Text } from '@island.is/island-ui/core'
import * as constants from '@island.is/judicial-system/consts'
import { core } from '@island.is/judicial-system-web/messages'
import {
Expand Down Expand Up @@ -83,6 +83,22 @@ const Summary: FC = () => {
[[] as CaseFile[], [] as CaseFile[]],
)

const getRulingDecisionTagColor = (
unakb marked this conversation as resolved.
Show resolved Hide resolved
indictmentRulingDecision: CaseIndictmentRulingDecision,
): TagVariant => {
switch (indictmentRulingDecision) {
case CaseIndictmentRulingDecision.FINE:
return 'mint'
case CaseIndictmentRulingDecision.CANCELLATION:
return 'rose'
case CaseIndictmentRulingDecision.DISMISSAL:
return 'blue'
case CaseIndictmentRulingDecision.RULING:
default:
return 'darkerBlue'
}
}
unakb marked this conversation as resolved.
Show resolved Hide resolved

return (
<PageLayout
workingCase={workingCase}
Expand All @@ -91,8 +107,29 @@ const Summary: FC = () => {
onNavigationTo={handleNavigationTo}
>
<PageHeader title={formatMessage(strings.htmlTitle)} />

<FormContentContainer>
<PageTitle>{formatMessage(strings.title)}</PageTitle>
<Box display="flex" justifyContent="spaceBetween">
<PageTitle>{formatMessage(strings.title)}</PageTitle>

{workingCase.indictmentRulingDecision && (
<Box marginTop={2}>
<Tag
variant={getRulingDecisionTagColor(
workingCase.indictmentRulingDecision,
)}
outlined
disabled
truncate
>
{formatMessage(strings.indictmentRulingDecisionTagText, {
indictmentRulingDecision:
workingCase.indictmentRulingDecision,
})}
</Tag>
</Box>
)}
</Box>
<Box component="section" marginBottom={1}>
<Text variant="h2" as="h2">
{formatMessage(core.caseNumber, {
Expand Down
Loading