diff --git a/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.strings.ts b/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.strings.ts index ff77738b7d64..848a5cceb716 100644 --- a/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.strings.ts +++ b/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.strings.ts @@ -40,7 +40,8 @@ export const strings = defineMessages({ }, changeReviewedDecisionButtonText: { id: 'judicial.system.core:public_prosecutor.indictments.overview.change_reviewed_decision_button_text', - defaultMessage:'Breyta ákvörðun?', - description: 'Notaður sem texti fyrir staðfestingartakka þegar ákvörðun ríkissaksóknara er breytt.', + defaultMessage: 'Breyta ákvörðun?', + description: + 'Notaður sem texti fyrir staðfestingartakka þegar ákvörðun ríkissaksóknara er breytt.', }, }) diff --git a/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.tsx b/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.tsx index 198f1804db3a..aa39aee2979b 100644 --- a/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.tsx +++ b/apps/judicial-system/web/src/routes/PublicProsecutor/Indictments/Overview/Overview.tsx @@ -26,11 +26,15 @@ import { import { useCase } from '@island.is/judicial-system-web/src/utils/hooks' import { ReviewDecision } from '../../components/ReviewDecision/ReviewDecision' -import { CONFIRM_PROSECUTOR_DECISION, ConfirmationModal, isReviewerAssignedModal, REVIEWER_ASSIGNED } from '../../components/utils' +import { + CONFIRM_PROSECUTOR_DECISION, + ConfirmationModal, + isReviewerAssignedModal, + REVIEWER_ASSIGNED, +} from '../../components/utils' import { IndictmentReviewerSelector } from './IndictmentReviewerSelector' import { strings } from './Overview.strings' - export const Overview = () => { const router = useRouter() const { formatMessage: fm } = useIntl() @@ -42,7 +46,9 @@ export const Overview = () => { const [isReviewedDecisionChanged, setIsReviewedDecisionChanged] = useState(false) - const [confirmationModal, setConfirmationModal] = useState(); + const [confirmationModal, setConfirmationModal] = useState< + ConfirmationModal | undefined + >() // const lawsBroken = useIndictmentsLawsBroken(workingCase) NOTE: Temporarily hidden while list of laws broken is not complete diff --git a/apps/judicial-system/web/src/routes/PublicProsecutor/components/ReviewDecision/ReviewDecision.tsx b/apps/judicial-system/web/src/routes/PublicProsecutor/components/ReviewDecision/ReviewDecision.tsx index 3e38f3590c25..390b0fcfe03a 100644 --- a/apps/judicial-system/web/src/routes/PublicProsecutor/components/ReviewDecision/ReviewDecision.tsx +++ b/apps/judicial-system/web/src/routes/PublicProsecutor/components/ReviewDecision/ReviewDecision.tsx @@ -22,7 +22,6 @@ import { ConfirmationModal, isConfirmProsecutorDecisionModal } from '../utils' import { strings } from './ReviewDecision.strings' import * as styles from './ReviewDecision.css' - interface Props { caseId: string currentDecision?: IndictmentCaseReviewDecision @@ -35,14 +34,13 @@ interface Props { onChange?: (decision: IndictmentCaseReviewDecision) => void } - export const ReviewDecision: FC = (props) => { const { caseId, currentDecision, indictmentAppealDeadline, indictmentAppealDeadlineIsInThePast, - modalVisible, + modalVisible, setModalVisible, isFine, onSelect, diff --git a/apps/judicial-system/web/src/routes/PublicProsecutor/components/utils.ts b/apps/judicial-system/web/src/routes/PublicProsecutor/components/utils.ts index ce9b64a7cf00..356f57240084 100644 --- a/apps/judicial-system/web/src/routes/PublicProsecutor/components/utils.ts +++ b/apps/judicial-system/web/src/routes/PublicProsecutor/components/utils.ts @@ -1,8 +1,11 @@ export const CONFIRM_PROSECUTOR_DECISION = 'CONFIRM_PROSECUTOR_DECISION' export const REVIEWER_ASSIGNED = 'REVIEWER_ASSIGNED' -export type ConfirmationModal = typeof REVIEWER_ASSIGNED | typeof CONFIRM_PROSECUTOR_DECISION - -export const isReviewerAssignedModal = (modal?: ConfirmationModal) => modal === REVIEWER_ASSIGNED -export const isConfirmProsecutorDecisionModal = (modal?: ConfirmationModal) => modal === CONFIRM_PROSECUTOR_DECISION +export type ConfirmationModal = + | typeof REVIEWER_ASSIGNED + | typeof CONFIRM_PROSECUTOR_DECISION +export const isReviewerAssignedModal = (modal?: ConfirmationModal) => + modal === REVIEWER_ASSIGNED +export const isConfirmProsecutorDecisionModal = (modal?: ConfirmationModal) => + modal === CONFIRM_PROSECUTOR_DECISION diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index 41f424eb8e8f..e1ab4792bcd0 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -44,7 +44,10 @@ import { } from '@island.is/judicial-system-web/src/graphql/schema' import { ReviewDecision } from '../../PublicProsecutor/components/ReviewDecision/ReviewDecision' -import { CONFIRM_PROSECUTOR_DECISION, ConfirmationModal } from '../../PublicProsecutor/components/utils' +import { + CONFIRM_PROSECUTOR_DECISION, + ConfirmationModal, +} from '../../PublicProsecutor/components/utils' import { strings } from './IndictmentOverview.strings' interface ServiceAnnouncementProps { @@ -106,7 +109,9 @@ const IndictmentOverview: FC = () => { const latestDate = workingCase.courtDate ?? workingCase.arraignmentDate const caseIsClosed = isCompletedCase(workingCase.state) - const [modalVisible, setModalVisible] = useState() + const [modalVisible, setModalVisible] = useState< + ConfirmationModal | undefined + >() const [isReviewDecisionSelected, setIsReviewDecisionSelected] = useState(false)