Skip to content

Commit

Permalink
Change Details on Death Transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds committed Nov 22, 2024
1 parent 1fe76ab commit 6e9ba57
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 22 deletions.
4 changes: 2 additions & 2 deletions ppr-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ppr-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ppr-ui",
"version": "3.3.5",
"version": "3.3.6",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,22 +395,24 @@

<!-- Existing Owner Actions -->
<template v-else-if="enableTransferOwnerActions(item)">
{{ isDisabledForSJTChanges(item) }}
{{ isDisabledForWillChanges(item) }}
<v-btn
v-if="!isRemovedHomeOwner(item) &&
!isChangedOwner(item) &&
!isDisabledForSoGChanges(item) &&
!(!isPartyTypeNotEAT(item) && isTransferToSurvivingJointTenant)"
!(!isPartyTypeNotEAT(item) &&
isTransferToSurvivingJointTenant) &&
!isDisabledForSJTChanges(item) &&
!isDisabledForWillChanges(item)"
variant="plain"
color="primary"
class="mr-n4"
:ripple="false"
:disabled="
isAddingMode ||
isEditingMode ||
isGlobalEditingMode ||
isDisabledForSJTChanges(item) ||
isDisabledForWillChanges(item)
"
isGlobalEditingMode"
data-test-id="table-delete-btn"
@click="markForRemoval(item)"
>
Expand All @@ -431,9 +433,7 @@
color="primary"
class="mx-0 px-0"
:ripple="false"
:disabled="
isAddingMode || isEditingMode || isGlobalEditingMode || isDisabledForSJTChanges(item)
"
:disabled="isAddingMode || isEditingMode || isGlobalEditingMode"
data-test-id="table-undo-btn"
@click="undo(item)"
>
Expand All @@ -448,11 +448,29 @@
/>
</v-btn>

<!-- Change Details when other actions are disabled -->
<v-btn
v-else-if="isDisabledForSJTChanges(item) || isDisabledForWillChanges(item)"
variant="plain"
color="primary"
class="mx-0 px-0"
:ripple="false"
data-test-id="owner-change-details-btn"
@click="openForEditing(homeOwners.indexOf(item))"
>
<v-icon size="small">
mdi-pencil
</v-icon>
<span>Change Details</span>
</v-btn>

<!-- Menu actions drop down menu -->
<template
v-if="enableTransferOwnerMenuActions(item) &&
!isRemovedHomeOwner(item) &&
!(!isPartyTypeNotEAT(item) && isTransferToSurvivingJointTenant)"
!(!isPartyTypeNotEAT(item) && isTransferToSurvivingJointTenant) &&
!isDisabledForSJTChanges(item) &&
!isDisabledForWillChanges(item)"
>
<v-menu
location="bottom right"
Expand Down Expand Up @@ -507,6 +525,22 @@
</v-menu>
</template>
</template>
<template v-else-if="!!getMhrTransferType?.transferType">
<!-- Change Details when other actions are disabled -->
<v-btn
variant="plain"
color="primary"
class="mx-0 px-0"
:ripple="false"
data-test-id="owner-change-details-btn"
@click="openForEditing(homeOwners.indexOf(item))"
>
<v-icon size="small">
mdi-pencil
</v-icon>
<span>Change Details</span>
</v-btn>
</template>
</td>
</div>

Expand Down Expand Up @@ -792,6 +826,7 @@ export default defineComponent({
const addressSchema = PartyAddressSchema
const { setUnsavedChanges } = useStore()
const {
getMhrTransferType,
getMhrRegistrationValidationModel,
getMhrInfoValidation,
hasUnsavedChanges,
Expand Down Expand Up @@ -1248,6 +1283,7 @@ export default defineComponent({
showCorrectUndoOptions,
isMhrCorrection,
correctAmendLabel,
getMhrTransferType,
...toRefs(localState)
}
}
Expand Down
9 changes: 6 additions & 3 deletions ppr-ui/src/composables/mhrInformation/useMhrInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions ppr-ui/src/composables/mhrInformation/useTransferOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/src/resources/dialogOptions/confirmationDialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. `
}

Expand Down

0 comments on commit 6e9ba57

Please sign in to comment.