Skip to content

Commit

Permalink
fix(inheritance-report): overview confirmations (#15855)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
albinagu and kodiakhq[bot] authored Sep 2, 2024
1 parent 9babb09 commit bfbf4f2
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ export const expandAnswers = (
},
caseNumber: answers.estateInfoSelection,
confirmAction: answers.confirmAction,
assetsConfirmation: answers.assetsConfirmation,
debtsConfirmation: answers.debtsConfirmation,
heirsConfirmation: answers.heirsConfirmation,
debts: {
debtsTotal: answers?.debts?.debtsTotal ?? 0,
domesticAndForeignDebts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ export const OverviewAssets: FC<React.PropsWithChildren<FieldBaseProps>> = ({

return (
<Box>
<Box marginTop={2} as="p">
<Text>{formatMessage(m.assetOverviewDescription)}</Text>
</Box>
<Box marginTop={6} />
{sections.map(
({ data, title, total, totalTitle, showTotalFirst }, index) => {
const totalRow = totalTitle && total && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
buildCheckboxField,
buildCustomField,
buildDescriptionField,
buildMultiField,
Expand Down Expand Up @@ -679,12 +680,30 @@ export const assets = buildSection({
id: 'assetOverview',
title: m.assetOverview,
children: [
buildCustomField({
buildMultiField({
id: 'assetOverview',
title: m.assetOverview,
description: m.assetOverviewDescription,
id: 'overviewAssets',
doesNotRequireAnswer: true,
component: 'OverviewAssets',
children: [
buildCustomField({
title: '',
id: 'overviewAssets',
doesNotRequireAnswer: true,
component: 'OverviewAssets',
}),
buildDescriptionField({
id: 'space',
title: '',
marginBottom: 'containerGutter',
}),
buildCheckboxField({
id: 'assetsConfirmation',
title: '',
large: false,
backgroundColor: 'white',
options: [{ value: YES, label: m.assetsOverviewConfirmation }],
}),
],
}),
],
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {
buildCheckboxField,
buildCustomField,
buildDescriptionField,
buildMultiField,
buildSection,
buildSubSection,
YES,
} from '@island.is/application/core'
import { m } from '../../lib/messages'
import { DebtTypes } from '../../types'
Expand Down Expand Up @@ -182,6 +184,18 @@ export const debtsAndFuneralCost = buildSection({
doesNotRequireAnswer: true,
component: 'CalculateTotalDebts',
}),
buildDescriptionField({
id: 'space',
title: '',
marginBottom: 'containerGutter',
}),
buildCheckboxField({
id: 'debtsConfirmation',
title: '',
large: false,
backgroundColor: 'white',
options: [{ value: YES, label: m.debtsOverviewConfirmation }],
}),
],
}),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
buildCheckboxField,
buildCustomField,
buildDescriptionField,
buildDividerField,
Expand All @@ -9,6 +10,7 @@ import {
buildSubSection,
buildTextField,
getValueViaPath,
YES,
} from '@island.is/application/core'
import { formatCurrency } from '@island.is/application/ui-components'
import { InheritanceReport } from '../../lib/dataSchema'
Expand Down Expand Up @@ -394,6 +396,18 @@ export const heirs = buildSection({
return files.map((file: any) => file.name).join(', ')
},
}),
buildDescriptionField({
id: 'heirs_space7',
title: '',
marginBottom: 'containerGutter',
}),
buildCheckboxField({
id: 'heirsConfirmation',
title: '',
large: false,
backgroundColor: 'white',
options: [{ value: YES, label: m.heirsOverviewConfirmation }],
}),
buildCustomField({
title: '',
id: 'overviewPrint',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,9 @@ export const inheritanceReportSchema = z.object({
},
),
confirmAction: z.array(z.enum([YES])).length(1),
assetsConfirmation: z.array(z.enum([YES])).length(1),
debtsConfirmation: z.array(z.enum([YES])).length(1),
heirsConfirmation: z.array(z.enum([YES])).length(1),
})

export type InheritanceReport = z.TypeOf<typeof inheritanceReportSchema>
18 changes: 18 additions & 0 deletions libs/application/templates/inheritance-report/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,24 @@ export const m = defineMessages({
'Vinsamlegast farðu yfir upplýsingarnar og gakktu úr skugga um að þær séu réttar.',
description: '',
},
assetsOverviewConfirmation: {
id: 'ir.application:assetsOverviewConfirmation',
defaultMessage:
'Ég staðfesti að hafa fært inn upplýsingar um eignir eftir minni bestu vitund.',
description: '',
},
debtsOverviewConfirmation: {
id: 'ir.application:debtsOverviewConfirmation',
defaultMessage:
'Ég staðfesti að hafa fært inn upplýsingar um skuldir eftir minni bestu vitund.',
description: '',
},
heirsOverviewConfirmation: {
id: 'ir.application:heirsOverviewConfirmation',
defaultMessage:
'Ég staðfesti að hafa fært inn upplýsingar um eign til skipta og erfingja eftir minni bestu vitund.',
description: '',
},
realEstateEstimation: {
id: 'ir.application:realEstateEstimation',
defaultMessage: 'Fasteignamat samtals á dánardegi',
Expand Down

0 comments on commit bfbf4f2

Please sign in to comment.