Skip to content

Commit

Permalink
feat(j-s): Add new case decision for closing without ruling
Browse files Browse the repository at this point in the history
  • Loading branch information
unakb committed Jan 21, 2025
1 parent 2b2a7e3 commit c103885
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
'use strict'

const replaceEnum = require('sequelize-replace-enum-postgres').default

module.exports = {
up: async (queryInterface) => {
// Safely add the new enum value to the type without replacing the entire enum
await queryInterface.sequelize.query(`
ALTER TYPE enum_case_decision
ADD VALUE IF NOT EXISTS 'COMPLETED_WITHOUT_RULING';
`)
},

down: (queryInterface) => {
return replaceEnum({
queryInterface,
tableName: 'case',
columnName: 'decision',
newValues: [
'ACCEPTING',
'REJECTING',
'ACCEPTING_ALTERNATIVE_TRAVEL_BAN',
'ACCEPTING_PARTIALLY',
'DISMISSING',
],
enumName: 'enum_case_decision',
})
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ export const icRuling = {
'Notaður sem skýritexti fyrir "greinargerð um málsatvik" innsláttarsvæðið á úrskurðar skrefi í rannsóknarheimildum.',
},
}),
completedWithoutRuling: defineMessages({
label: {
id: 'judicial.system.core:investigation_cases.ruling.completed_without_ruling.label',
defaultMessage: 'Ljúka máli án úrskurðar',
description:
'Notaður sem titill fyrir "Ljúka máli án úrskurðar" checkbox á úrskurðar skrefi í rannsóknarheimildum.',
},
tooltip: {
id: 'judicial.system.core:investigation_cases.ruling.completed_without_ruling.tooltip',
defaultMessage: 'Ljúka máli án úrskurðar.',
description:
'Notaður sem upplýsingatexti við "Ljúka mál án úrskurðar" titlinn á úrskurðar skrefi í rannsóknarheimildum.',
},
}),
courtLegalArguments: defineMessages({
title: {
id: 'judicial.system.core:investigation_cases.ruling.court_legal_arguments.title',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Accordion,
AccordionItem,
Box,
Checkbox,
Input,
Text,
Tooltip,
Expand Down Expand Up @@ -138,6 +139,32 @@ const Ruling = () => {
</AccordionItem>
</Accordion>
</Box>
<Box component="section" marginBottom={5}>
<Checkbox
name={formatMessage(m.sections.completedWithoutRuling.label)}
label={formatMessage(m.sections.completedWithoutRuling.label)}
checked={Boolean(
workingCase.decision === CaseDecision.COMPLETED_WITHOUT_RULING,
)}
onChange={({ target }) => {
setAndSendCaseToServer(
[
{
decision: target.checked
? CaseDecision.COMPLETED_WITHOUT_RULING
: null,
force: true,
},
],
workingCase,
setWorkingCase,
)
}}
tooltip={formatMessage(m.sections.completedWithoutRuling.tooltip)}
backgroundColor="blue"
large
/>
</Box>
<Box component="section" marginBottom={5}>
<Box marginBottom={3}>
<Text as="h3" variant="h3">
Expand Down
1 change: 1 addition & 0 deletions libs/judicial-system/types/src/lib/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export enum CaseDecision {
ACCEPTING_ALTERNATIVE_TRAVEL_BAN = 'ACCEPTING_ALTERNATIVE_TRAVEL_BAN',
ACCEPTING_PARTIALLY = 'ACCEPTING_PARTIALLY',
DISMISSING = 'DISMISSING',
COMPLETED_WITHOUT_RULING = 'COMPLETED_WITHOUT_RULING',
}

export enum IndictmentDecision {
Expand Down

0 comments on commit c103885

Please sign in to comment.