From 6e9ba57b68262f5b7ecc3107919855c62564b6c6 Mon Sep 17 00:00:00 2001 From: Cameron Bowler Date: Fri, 22 Nov 2024 09:00:30 -0800 Subject: [PATCH] Change Details on Death Transfers --- ppr-ui/package-lock.json | 4 +- ppr-ui/package.json | 2 +- .../HomeOwners/HomeOwnersTable.vue | 54 +++++++++++++++---- .../mhrInformation/useMhrInformation.ts | 9 ++-- .../mhrInformation/useTransferOwners.ts | 10 ++-- .../dialogOptions/confirmationDialogs.ts | 4 +- 6 files changed, 61 insertions(+), 22 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 0ffa11e94..fa6878d6d 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.3.5", + "version": "3.3.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.3.5", + "version": "3.3.6", "dependencies": { "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 0d3234c8b..dcf0b4fba 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.3.5", + "version": "3.3.6", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/components/mhrRegistration/HomeOwners/HomeOwnersTable.vue b/ppr-ui/src/components/mhrRegistration/HomeOwners/HomeOwnersTable.vue index a3d4d926c..414e1a937 100644 --- a/ppr-ui/src/components/mhrRegistration/HomeOwners/HomeOwnersTable.vue +++ b/ppr-ui/src/components/mhrRegistration/HomeOwners/HomeOwnersTable.vue @@ -395,11 +395,16 @@ + @@ -792,6 +826,7 @@ export default defineComponent({ const addressSchema = PartyAddressSchema const { setUnsavedChanges } = useStore() const { + getMhrTransferType, getMhrRegistrationValidationModel, getMhrInfoValidation, hasUnsavedChanges, @@ -1248,6 +1283,7 @@ export default defineComponent({ showCorrectUndoOptions, isMhrCorrection, correctAmendLabel, + getMhrTransferType, ...toRefs(localState) } } diff --git a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts index 46061e113..0c7b09d7b 100644 --- a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts +++ b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts @@ -467,7 +467,8 @@ export const useMhrInformation = () => { const parseDueToDeathOwnerGroups = (isDraft: boolean = false): MhrRegistrationHomeOwnerGroupIF[] => { const ownerGroups = [] getMhrTransferHomeOwnerGroups.value.forEach(ownerGroup => { - if (ownerGroup.owners.some(owner => owner.action === ActionTypes.REMOVED)) { + if (ownerGroup.owners.some(owner => + owner.action === ActionTypes.REMOVED || owner.action === ActionTypes.CHANGED)) { ownerGroups.push({ ...ownerGroup, owners: ownerGroup.owners @@ -489,11 +490,13 @@ export const useMhrInformation = () => { const parseDeletedDueToDeathOwnerGroups = (): MhrRegistrationHomeOwnerGroupIF[] => { const ownerGroups = [] getMhrTransferHomeOwnerGroups.value.forEach(ownerGroup => { - if (ownerGroup.owners.some(owner => owner.action === ActionTypes.REMOVED)) { + if (ownerGroup.owners.some(owner => + owner.action === ActionTypes.REMOVED || owner.action === ActionTypes.CHANGED)) { ownerGroups.push({ ...ownerGroup, groupId: getCurrentOwnerGroupIdByOwnerId(ownerGroup.owners[0].ownerId), - owners: ownerGroup.owners.filter(owner => owner.action === ActionTypes.REMOVED).map(owner => { + owners: ownerGroup.owners.filter(owner => + owner.action === ActionTypes.REMOVED || owner.action === ActionTypes.CHANGED).map(owner => { return owner.individualName ? { ...owner, individualName: normalizeObject(owner.individualName) } : owner }), // Determine group tenancy type diff --git a/ppr-ui/src/composables/mhrInformation/useTransferOwners.ts b/ppr-ui/src/composables/mhrInformation/useTransferOwners.ts index 77753638d..8e1eccb2e 100644 --- a/ppr-ui/src/composables/mhrInformation/useTransferOwners.ts +++ b/ppr-ui/src/composables/mhrInformation/useTransferOwners.ts @@ -438,15 +438,15 @@ export const useTransferOwners = (enableAllActions: boolean = false) => { **/ const isDisabledForSJTChanges = (owner: MhrRegistrationHomeOwnerIF): boolean => { if (getMhrTransferType.value?.transferType === ApiTransferTypes.SURVIVING_JOINT_TENANT) { - const hasDeceasedOrChangedOwners = getMhrTransferHomeOwnerGroups.value.some(group => - group.owners.some(owner => owner.action === ActionTypes.REMOVED || owner.action === ActionTypes.CHANGED)) + const hasDeceasedOwners = getMhrTransferHomeOwnerGroups.value.some(group => + group.owners.some(owner => owner.action === ActionTypes.REMOVED)) - const isDeceasedOrChangedOwnerGroup = getMhrTransferHomeOwnerGroups.value.find(group => + const isDeceasedOwnerGroup = getMhrTransferHomeOwnerGroups.value.find(group => group.groupId === owner.groupId).owners.some(owner => - owner.action === ActionTypes.REMOVED || owner.action === ActionTypes.CHANGED + owner.action === ActionTypes.REMOVED ) - return hasDeceasedOrChangedOwners && !isDeceasedOrChangedOwnerGroup + return hasDeceasedOwners && !isDeceasedOwnerGroup } return false } diff --git a/ppr-ui/src/resources/dialogOptions/confirmationDialogs.ts b/ppr-ui/src/resources/dialogOptions/confirmationDialogs.ts index ff0053ff5..d1b6e3771 100644 --- a/ppr-ui/src/resources/dialogOptions/confirmationDialogs.ts +++ b/ppr-ui/src/resources/dialogOptions/confirmationDialogs.ts @@ -74,8 +74,8 @@ export const mhrTableRemoveDialog: DialogOptionsIF = { export const mhrDeceasedOwnerChanges: DialogOptionsIF = { acceptText: 'Undo Changes and Delete Owner', cancelText: 'Cancel', - title: 'Deceased owner\'s information cannot be changed', - text: `The phone number and mailing address of a deceased owner cannot be changed prior to deletion. + title: 'Deleted owner\'s information cannot be changed', + text: `The phone number and mailing address of an owner cannot be changed prior to deletion. Deleting this owner will undo any changes you have made to their phone number or mailing address. ` }