Skip to content

Commit

Permalink
fix(ocrvs-5086): update primary address preview copy for informant an…
Browse files Browse the repository at this point in the history
…d spouse
  • Loading branch information
makelicious committed Jul 3, 2024
1 parent 13b9bee commit b55d3fb
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions src/form/addresses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,28 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [
{
config: AddressCopyConfigCases.PRIMARY_ADDRESS_SAME_AS_OTHER_PRIMARY,
label: formMessageDescriptors.primaryAddressSameAsDeceasedsPrimary,
conditionalCase: `${isInformantSpouse}`,
conditionalCase: [
expressionToConditional(isInformantSpouse),
expressionToConditional(
`${isInformantSpouse} || !${primaryAddressSameAsOtherPrimaryAddress}`,
'hideInPreview'
)
],
xComparisonSection: 'informant',
yComparisonSection: 'deceased'
},
{
config: AddressSubsections.PRIMARY_ADDRESS_SUBSECTION,
label: formMessageDescriptors.informantPrimaryAddress,
conditionalCase: `${primaryAddressSameAsOtherPrimaryAddress} || ${hideIfInformantSpouse[0].expression}`
conditionalCase: [
expressionToConditional(
`${primaryAddressSameAsOtherPrimaryAddress} || ${hideIfInformantSpouse[0].expression}`
),
expressionToConditional(
`${primaryAddressSameAsOtherPrimaryAddress} || ${hideIfInformantSpouse[0].expression} || ${primaryAddressSameAsOtherPrimaryAddress}`,
'hideInPreview'
)
]
},
{
config: AddressCases.PRIMARY_ADDRESS,
Expand Down Expand Up @@ -257,14 +271,26 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [
{
config: AddressSubsections.PRIMARY_ADDRESS_SUBSECTION,
label: formMessageDescriptors.primaryAddress,
conditionalCase: `${SPOUSE_DETAILS_DONT_EXIST}`
conditionalCase: [
expressionToConditional(SPOUSE_DETAILS_DONT_EXIST),
expressionToConditional(
`${SPOUSE_DETAILS_DONT_EXIST} || ${primaryAddressSameAsOtherPrimaryAddress}`,
'hideInPreview'
)
]
},
{
config: AddressCopyConfigCases.PRIMARY_ADDRESS_SAME_AS_OTHER_PRIMARY,
label: formMessageDescriptors.primaryAddressSameAsDeceasedsPrimary,
xComparisonSection: 'spouse',
yComparisonSection: 'deceased',
conditionalCase: `${detailsDontExist}`
conditionalCase: [
expressionToConditional(detailsDontExist),
expressionToConditional(
`${detailsDontExist} || !${primaryAddressSameAsOtherPrimaryAddress}`,
'hideInPreview'
)
]
},
{
config: AddressCases.PRIMARY_ADDRESS,
Expand Down

0 comments on commit b55d3fb

Please sign in to comment.