-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(j-s): Complete Cancellation (#15154)
* Add POSTPONED_TO_VERDICT radio button * Change Radio to Checkbox * Add column to Case table -- IndictmentDecision * Update IndictmentDecision * Postponed until verdict tag in cases * Disable subpoena screen if a case is postponed until verdict * Add a postpone until verdict tag for defenders * Checkpoint * Checkpoint * Merge * Determining when step is valid when postponing until verdict * Checkpoint * Change all instances of Array<something> to something[] * Only show InfoCard on summary page if indictment decison is POSTPONING_UNTIL_VERDICT * Wipe courtDate out when postponing until verdict * Move scheduled info card to overview page * Save court date when postponing until verdict * Checkpoint * Fixing update functionality * Fix case state on cases page * Fix migration * Add location to verdict date * Cleanup * Allow judges to remove set court date * Added test * Allows prosecutors to cancel submitted indictments * Hides buttons when prosecutor has asked for cancellation * Adds unit tests * Updates unit tests * Fixes unit tests * Rewrite open case * Adds modal for cancelling case * Fixes back navigation * Update apps/judicial-system/web/src/routes/Prosecutor/Indictments/Overview/Overview.tsx Co-authored-by: Ívar Oddsson <ivaroddsson@gmail.com> * Refactors code * Rewrites condition * Completes cancellation * Removes obsolete unit tests * Fixes test helpers * Simplifies code * Simplifies code * Improves imports * Improves imports * Improves imports * Simplifies type * Simplifies expressions * Correct function declaration --------- Co-authored-by: Ívar Oddsson <ivaroddsson@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
Showing
20 changed files
with
729 additions
and
465 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
apps/judicial-system/web/src/components/Table/CourtDate/CourtDate.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { FC } from 'react' | ||
import { useIntl } from 'react-intl' | ||
import format from 'date-fns/format' | ||
import localeIS from 'date-fns/locale/is' | ||
import parseISO from 'date-fns/parseISO' | ||
|
||
import { Box, Text } from '@island.is/island-ui/core' | ||
import { capitalize } from '@island.is/judicial-system/formatters' | ||
import { tables } from '@island.is/judicial-system-web/messages' | ||
|
||
interface Props { | ||
courtDate?: string | null | ||
postponedIndefinitelyExplanation?: string | null | ||
} | ||
|
||
const CourtDate: FC<Props> = (props) => { | ||
const { courtDate, postponedIndefinitelyExplanation } = props | ||
const { formatMessage } = useIntl() | ||
|
||
if (!courtDate && !postponedIndefinitelyExplanation) { | ||
return null | ||
} | ||
|
||
return postponedIndefinitelyExplanation ? ( | ||
<Text>{formatMessage(tables.postponed)}</Text> | ||
) : ( | ||
courtDate && ( | ||
<> | ||
<Text> | ||
<Box component="span"> | ||
{capitalize( | ||
format(parseISO(courtDate), 'EEEE d. LLLL y', { | ||
locale: localeIS, | ||
}), | ||
).replace('dagur', 'd.')} | ||
</Box> | ||
</Text> | ||
<Text as="span" variant="small"> | ||
kl. {format(parseISO(courtDate), 'kk:mm')} | ||
</Text> | ||
</> | ||
) | ||
) | ||
} | ||
export default CourtDate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...stem/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.strings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { defineMessages } from 'react-intl' | ||
|
||
export const strings = defineMessages({ | ||
title: { | ||
id: 'judicial.system.core:court.cases_in_progress.title', | ||
defaultMessage: 'Mál í vinnslu', | ||
description: 'Notaður sem titill í málalista', | ||
}, | ||
noCasesTitle: { | ||
id: 'judicial.system.core:court.cases_in_progress.no_cases_title', | ||
defaultMessage: 'Engin mál í vinnslu.', | ||
description: 'Notaður sem titill þegar engin mál eru til vinnslu', | ||
}, | ||
noCasesMessage: { | ||
id: 'judicial.system.core:court.cases_in_progress.no_cases_message', | ||
defaultMessage: 'Öll mál hafa verið afgreidd.', | ||
description: 'Notað sem skilaboð þegar engin mál eru til vinnslu', | ||
}, | ||
cancelCaseModalTitle: { | ||
id: 'judicial.system.core:cases.active_requests.cancel_case_modal_title', | ||
defaultMessage: 'Mál afturkallað', | ||
description: 'Notaður sem titill í Afturkalla mál dómstóla modal.', | ||
}, | ||
cancelCaseModalText: { | ||
id: 'judicial.system.core:cases.active_requests.cancel_case_modal_text', | ||
defaultMessage: | ||
'Ákæruvaldið hefur afturkallað ákæruna. Hægt er að skrá málsnúmer og ljúka málinu hér.', | ||
description: 'Notaður sem texti í Afturkalla mál dómstóla modal.', | ||
}, | ||
cancelCaseModalPrimaryButtonText: { | ||
id: 'judicial.system.core:cases.active_requests.cancel_case_modal_primary_button_text', | ||
defaultMessage: 'Ljúka máli', | ||
description: | ||
'Notaður sem texti á Ljúka máli takka í Afturkalla mál dómstóla modal.', | ||
}, | ||
cancelCaseModalSecondaryButtonText: { | ||
id: 'judicial.system.core:cases.active_requests.delete_case_modal_secondary_button_text', | ||
defaultMessage: 'Hætta við', | ||
description: | ||
'Notaður sem texti á Hætta við takka í Afturkalla mál dómstóla modal.', | ||
}, | ||
}) |
Oops, something went wrong.