Skip to content

Commit

Permalink
fix(inheritance-report): inheritance report updates (#16672)
Browse files Browse the repository at this point in the history
* fix(admin): already signed message & create collection available (#16537)

* fix(admin): already signed message & create collection available

* tweak allowedToProcess

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix(admin): compare lists always visible (#16528)

* fix(admin): Signatures - display address (#16641)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix(inheritance-report): text adjustments (#16649)

* fix(inheritance-report): text adjustments

* chore: nx format:write update dirty files

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix(inheritance-report): done screen and minor cleanup (#16667)

* fix(inheritance-report): done screen and minor cleanup

* unused

* provider

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: andes-it <[email protected]>
  • Loading branch information
3 people authored Oct 31, 2024
1 parent 71a9919 commit b27dc47
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 30 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { defineTemplateApi } from '@island.is/application/types'
export { MaritalStatusApi } from './MaritalStatusProvider'

export const EstateOnEntryApi = defineTemplateApi({
action: 'syslumennOnEntry',
shouldPersistToExternalData: true,
})

export const MaritalStatusApi = defineTemplateApi({
action: 'maritalStatus',
shouldPersistToExternalData: true,
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useState, useEffect, useCallback } from 'react'
import { useFieldArray, useFormContext } from 'react-hook-form'
import { FieldBaseProps } from '@island.is/application/types'
import { Box, GridRow, Button, Input, Text } from '@island.is/island-ui/core'
import { Box, GridRow, Button, Input } from '@island.is/island-ui/core'
import { Answers } from '../../types'
import { getErrorViaPath, getValueViaPath } from '@island.is/application/core'
import { formatCurrency } from '@island.is/application/ui-components'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const AdditionalHeir = ({
fieldName,
relationOptions,
error,
isPrepaid,
}: {
customFields: HeirsRepeaterProps['field']['props']['customFields']
field: GenericFormField<EstateMember>
Expand All @@ -49,6 +50,7 @@ export const AdditionalHeir = ({
fieldName: string
relationOptions: { value: string; label: string }[]
error: Record<string, string>
isPrepaid: boolean
}) => {
const { formatMessage } = useLocale()
const fieldIndex = `${fieldName}[${index}]`
Expand Down Expand Up @@ -340,7 +342,11 @@ export const AdditionalHeir = ({
<GridRow>
<GridColumn span={['1/1']} paddingBottom={2}>
<Text variant="h4">
{formatMessage(m.inheritanceAdvocateLabel)}
{formatMessage(
isPrepaid
? m.inheritanceAdvocateLabelPrePaid
: m.inheritanceAdvocateLabel,
)}
</Text>
</GridColumn>
<GridColumn span={['1/1']} paddingBottom={2}>
Expand Down Expand Up @@ -391,7 +397,11 @@ export const AdditionalHeir = ({
<GridRow>
<GridColumn span={['1/1']} paddingBottom={2}>
<Text variant="h4">
{formatMessage(m.inheritanceAdvocateLabel)}
{formatMessage(
isPrepaid
? m.inheritanceAdvocateLabelPrePaid
: m.inheritanceAdvocateLabel,
)}
</Text>
</GridColumn>
<GridColumn span={['1/1']} paddingBottom={2}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,11 @@ export const HeirsRepeater: FC<
variant="h4"
color={member.enabled ? 'dark400' : 'dark300'}
>
{formatMessage(m.inheritanceAdvocateLabel)}
{formatMessage(
isPrePaidApplication
? m.inheritanceAdvocateLabelPrePaid
: m.inheritanceAdvocateLabel,
)}
</Text>
</GridColumn>
<GridColumn span={['1/1', '1/2']} paddingBottom={2}>
Expand Down Expand Up @@ -585,6 +589,7 @@ export const HeirsRepeater: FC<
updateValues={updateValues}
remove={remove}
error={error[index] ?? null}
isPrepaid={isPrePaidApplication}
/>
</Box>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export const done: Form = buildForm({
answers.applicationFor === PREPAID_INHERITANCE
? m.doneDescriptionPrepaidEFS
: m.doneDescriptionEFS,
bottomButtonMessage: ({ answers }) =>
answers.applicationFor === PREPAID_INHERITANCE
? m.bottomButtonMessagePrepaidEFS
: m.bottomButtonMessageEFS,
}),
],
})
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ export const prePaidHeirs = buildSection({
title: m.heirAdditionalInfo,
description: m.heirAdditionalInfoDescription,
children: [
buildDescriptionField({
id: 'heirsAdditionalInfoFiles',
title: m.info,
titleVariant: 'h5',
marginBottom: 'smallGutter',
}),
buildTextField({
id: 'heirsAdditionalInfo',
title: '',
Expand All @@ -103,10 +97,14 @@ export const prePaidHeirs = buildSection({
buildDescriptionField({
id: 'heirsAdditionalInfoFilesOtherDocumentsTitle',
title: m.fileUploadOtherDocumentsPrePaid,
description: m.fileUploadOtherDocumentsPrePaidUserGuidelines,
titleVariant: 'h5',
titleVariant: 'h4',
space: 'containerGutter',
marginBottom: 'smallGutter',
marginBottom: 2,
}),
buildDescriptionField({
id: 'heirsAdditionalInfoFilesOtherDocumentsDescription',
title: '',
description: m.fileUploadOtherDocumentsPrePaidUserGuidelines,
}),
buildFileUploadField({
id: 'heirsAdditionalInfoFilesOtherDocuments',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
YES,
buildCheckboxField,
buildMultiField,
buildSection,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ const validateAssetNumber = (assetNumber: string) => {
return assetNumberPattern.test(assetNumber)
}

const validateDebtBankAccount = (assetNumber: string) => {
const assetNumberPattern = /^\d{4}-\d{2}-\d{6}|\d{12}$/
return assetNumberPattern.test(assetNumber)
}

const assetSchema = ({ withShare }: { withShare?: boolean } = {}) =>
z
.object({
Expand Down
22 changes: 20 additions & 2 deletions libs/application/templates/inheritance-report/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,9 @@ export const m = defineMessages({
description: '',
},
heirsDescriptionPrePaid: {
id: 'ir.application:heirsDescriptionPrePaid',
defaultMessage: 'Lorem ipsum lorem ipsum',
id: 'ir.application:heirsDescriptionPrePaid#markdown',
defaultMessage:
'Vinsamlegast skráðu upplýsingar um þá erfingja sem eiga að taka við fyrirframgreiddum arfi.',
description: '',
},
heirsAndPartition: {
Expand Down Expand Up @@ -1474,6 +1475,11 @@ export const m = defineMessages({
defaultMessage: 'Forsjáraðili/málsvari/sérstakur lögráðamaður',
description: 'Custody label',
},
inheritanceAdvocateLabelPrePaid: {
id: 'ir.application:inheritanceAdvocateLabelPrePaid',
defaultMessage: 'Forsjáraðili/málsvari/sérstakur lögráðamaður',
description: 'Custody label',
},
errorSpouseCount: {
id: 'ir.application:errorSpouseCount',
defaultMessage: 'Aðeins er hægt að hafa einn erfingja sem maka',
Expand Down Expand Up @@ -1736,6 +1742,18 @@ export const m = defineMessages({
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet urna nec nunc ultricies ultricies.',
description: '',
},
bottomButtonMessagePrepaidEFS: {
id: 'ir.application:bottomButtonMessagePrepaidEFS',
defaultMessage:
'Inni á Mínum síðum og í Ísland.is appinu hefur þú aðgang að þínum upplýsingum og Stafrænu pósthólfi.',
description: '',
},
bottomButtonMessageEFS: {
id: 'ir.application:bottomButtonMessageEFS',
defaultMessage:
'Inni á Mínum síðum og í Ísland.is appinu hefur þú aðgang að þínum upplýsingum og Stafrænu pósthólfi.',
description: '',
},
errorRelation: {
id: 'ir.application:error.errorRelation',
defaultMessage: 'Tengsl virðast ekki vera rétt',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { parsePhoneNumberFromString } from 'libphonenumber-js'
import { MessageDescriptor } from 'react-intl'
import { ZodTypeAny } from 'zod'
import { Answers } from '../../types'
import { ESTATE_INHERITANCE, PrePaidInheritanceOptions } from '../constants'
import { PrePaidInheritanceOptions } from '../constants'
import { InheritanceReport } from '../dataSchema'

export const currencyStringToNumber = (str: string) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
buildSection,
coreMessages,
} from '@island.is/application/core'
import { Application, FormText, StaticText } from '@island.is/application/types'
import { FormText, StaticText } from '@island.is/application/types'
import { conclusion } from './messages'

type Props = Partial<{
Expand All @@ -27,7 +27,7 @@ type Props = Partial<{
sectionTitle: StaticText
bottomButtonLink: string
bottomButtonLabel: StaticText
bottomButtonMessage: StaticText
bottomButtonMessage: FormText
}>

/**
Expand Down

0 comments on commit b27dc47

Please sign in to comment.