Skip to content

Commit

Permalink
Transfer Owner Changes: Misc Bug Fixes (#2076)
Browse files Browse the repository at this point in the history
* Transfer Bugs due to Edit Functionality

* Transfer Edit Bug Fixes

* Remove unused import
  • Loading branch information
cameron-eyds authored Dec 2, 2024
1 parent ee610a7 commit 1c8aef2
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 25 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.7",
"version": "3.3.8",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<!-- Owner Roles Component-->
<HomeOwnerRoles
:partyType="owner.partyType"
:disableRoles="isCurrentOwner(owner)"
@update:partyType="owner.partyType = $event"
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
:id="role.id"
:value="role.model"
:class="role.class"
:disabled="isDisabledRadio(role.model) && selectedPartyType !== role.model"
:disabled="(isDisabledRadio(role.model) && selectedPartyType !== role.model) ||
(disableRoles && selectedPartyType !== role.model)"
>
<template #label>
<div
Expand Down Expand Up @@ -60,6 +61,10 @@ export default defineComponent({
partyType: {
type: String as PropType<HomeOwnerPartyTypes>,
default: null
},
disableRoles: {
type: Boolean,
default: false
}
},
emits: ['update:partyType'],
Expand Down
135 changes: 115 additions & 20 deletions ppr-ui/src/components/mhrRegistration/HomeOwners/HomeOwnersTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -429,26 +429,63 @@
/>
</v-btn>

<v-btn
v-if="isRemovedHomeOwner(item) || isChangedOwner(item)"
variant="plain"
color="primary"
class="mx-0 px-0"
:ripple="false"
:disabled="isAddingMode || isEditingMode || isGlobalEditingMode"
data-test-id="table-undo-btn"
@click="undo(item)"
>
<v-icon size="small">
mdi-undo
</v-icon>
<span>Undo</span>
<v-divider
v-if="enableTransferOwnerMenuActions(item) && !isRemovedHomeOwner(item)"
class="ma-0 pl-3"
vertical
/>
</v-btn>
<template v-if="isRemovedHomeOwner(item) || isChangedOwner(item)">
<v-btn
variant="plain"
color="primary"
class="mx-0 px-0"
:ripple="false"
:disabled="isAddingMode || isEditingMode || isGlobalEditingMode"
data-test-id="table-undo-btn"
@click="undo(item)"
>
<v-icon size="small">
mdi-undo
</v-icon>
<span>Undo</span>
<v-divider
v-if="enableTransferOwnerMenuActions(item) && !isRemovedHomeOwner(item)"
class="ma-0 pl-3"
vertical
/>
</v-btn>

<v-menu
v-if="isChangedOwner(item) && (isDisabledForSJTChanges(item) || isDisabledForWillChanges(item))"
location="bottom right"
>
<template #activator="{ props }">
<v-btn
variant="plain"
color="primary"
class="menu-drop-down-btn mr-n4"
:disabled="isAddingMode || isGlobalEditingMode || isDisabledForSJTChanges(item)"
v-bind="props"
>
<v-icon>mdi-menu-down</v-icon>
</v-btn>
</template>

<!-- More actions drop down list -->
<v-list class="actions-dropdown actions__more-actions">
<!-- Menu Edit Option -->
<v-list-item
class="my-n2"
@click="openForEditing(homeOwners.indexOf(item))"
>
<v-list-item-subtitle class="pa-0">
<v-icon
size="small"
class="mb-1"
>
mdi-pencil
</v-icon>
<span class="ml-1 remove-btn-text">Change Details</span>
</v-list-item-subtitle>
</v-list-item>
</v-list>
</v-menu>
</template>

<!-- Change Details when other actions are disabled -->
<v-btn
Expand Down Expand Up @@ -526,8 +563,66 @@
</template>
</template>
<template v-else-if="!!getMhrTransferType?.transferType">
<template v-if="isRemovedHomeOwner(item) || isChangedOwner(item)">
<v-btn
variant="plain"
color="primary"
class="mx-0 px-0"
:ripple="false"
:disabled="isAddingMode || isEditingMode || isGlobalEditingMode"
data-test-id="table-undo-btn"
@click="undo(item)"
>
<v-icon size="small">
mdi-undo
</v-icon>
<span>Undo</span>
<v-divider
v-if="enableTransferOwnerMenuActions(item) && !isRemovedHomeOwner(item)"
class="ma-0 pl-3"
vertical
/>
</v-btn>

<v-menu
v-if="isChangedOwner(item)"
location="bottom right"
>
<template #activator="{ props }">
<v-btn
variant="plain"
color="primary"
class="menu-drop-down-btn mr-n4"
:disabled="isAddingMode || isGlobalEditingMode"
v-bind="props"
>
<v-icon>mdi-menu-down</v-icon>
</v-btn>
</template>

<!-- More actions drop down list -->
<v-list class="actions-dropdown actions__more-actions">
<!-- Menu Edit Option -->
<v-list-item
class="my-n2"
@click="openForEditing(homeOwners.indexOf(item))"
>
<v-list-item-subtitle class="pa-0">
<v-icon
size="small"
class="mb-1"
>
mdi-pencil
</v-icon>
<span class="ml-1 remove-btn-text">Change Details</span>
</v-list-item-subtitle>
</v-list-item>
</v-list>
</v-menu>
</template>
<!-- Change Details when other actions are disabled -->
<v-btn
v-else
variant="plain"
color="primary"
class="mx-0 px-0"
Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/composables/mhrInformation/useMhrInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,8 @@ export const useMhrInformation = () => {
}),
// Determine group tenancy type
type: (ownerGroup.owners.filter(owner => owner.action === ActionTypes.REMOVED).length > 1 ||
getMhrTransferType.value?.transferType === ApiTransferTypes.SURVIVING_JOINT_TENANT)
(getMhrTransferType.value?.transferType === ApiTransferTypes.SURVIVING_JOINT_TENANT &&
!ownerGroup.owners.some(owner => owner.action === ActionTypes.CHANGED)))
? isTransferToExecOrAdmin.value
? ApiHomeTenancyTypes.NA
: ApiHomeTenancyTypes.JOINT
Expand Down

0 comments on commit 1c8aef2

Please sign in to comment.