Skip to content

Commit

Permalink
Transfer Owner Contact Editing
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds committed Nov 19, 2024
1 parent a9f86a3 commit 87a7ec7
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 69 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.4",
"version": "3.3.5",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<v-card
flat
class="py-6 px-8 mb-5 rounded"
class="py-6 pl-6 pr-8 mb-5 rounded"
:class="{ 'border-error-left': showTableError || showReviewedError}"
>
<v-row id="mhr-home-add-person">
Expand Down Expand Up @@ -38,7 +38,7 @@
Person's Name
</label>
<v-tooltip
v-if="disableNameFields"
v-if="disableNameFields && isCurrentOwner(owner)"
location="top"
contentClass="top-tooltip pa-5"
transition="fade-transition"
Expand All @@ -55,7 +55,7 @@
</template>
{{ disabledNameEditTooltip }}
</v-tooltip>
<v-row>
<v-row class="mt-2">
<v-col cols="4">
<v-text-field
id="first-name"
Expand All @@ -65,8 +65,8 @@
label="First Name"
data-test-id="first-name"
:rules="firsNameRules"
:disabled="disableNameFields"
:readonly="disableNameFields"
:disabled="disableNameFields && isCurrentOwner(owner)"
:readonly="disableNameFields && isCurrentOwner(owner)"
/>
</v-col>
<v-col cols="4">
Expand All @@ -78,8 +78,8 @@
label="Middle Name (Optional)"
data-test-id="middle-name"
:rules="maxLength(50)"
:disabled="disableNameFields"
:readonly="disableNameFields"
:disabled="disableNameFields && isCurrentOwner(owner)"
:readonly="disableNameFields && isCurrentOwner(owner)"
/>
</v-col>
<v-col cols="4">
Expand All @@ -91,8 +91,8 @@
label="Last Name"
data-test-id="last-name"
:rules="lastNameRules"
:disabled="disableNameFields"
:readonly="disableNameFields"
:disabled="disableNameFields && isCurrentOwner(owner)"
:readonly="disableNameFields && isCurrentOwner(owner)"
/>
</v-col>
</v-row>
Expand All @@ -105,7 +105,7 @@
Business or Organization Name
</label>
<v-tooltip
v-if="disableNameFields"
v-if="disableNameFields && isCurrentOwner(owner)"
location="top"
content-class="top-tooltip pa-5"
transition="fade-transition"
Expand All @@ -121,7 +121,10 @@
</template>
{{ disabledNameEditTooltip }}
</v-tooltip>
<v-row v-if="!isCurrentOwner(owner)">
<v-row
v-if="!isCurrentOwner(owner)"
class="mt-2"
>
<v-col>
<p>
You can find the full legal name of an active B.C. business by entering the name
Expand Down Expand Up @@ -218,7 +221,7 @@
</SimpleHelpToggle>
</v-col>
</v-row>
<v-row>
<v-row class="my-2">
<v-col>
<v-text-field
id="org-name"
Expand All @@ -234,8 +237,8 @@
:rules="orgNameRules"
:clearable="showClear"
:clearIcon="'mdi-close'"
:disabled="disableNameFields"
:readonly="disableNameFields"
:disabled="disableNameFields && isCurrentOwner(owner)"
:readonly="disableNameFields && isCurrentOwner(owner)"
@click:clear="showClear = false"
>
<template #append-inner>
Expand Down Expand Up @@ -266,7 +269,7 @@
Additional Name Information
</label>
<v-tooltip
v-if="disableNameFields"
v-if="disableNameFields && isCurrentOwner(owner)"
location="top"
contentClass="top-tooltip pa-5"
transition="fade-transition"
Expand All @@ -283,7 +286,7 @@
</template>
{{ disabledNameEditTooltip }}
</v-tooltip>
<v-row class="py-2">
<v-row class="my-2">
<v-col class="col">
<v-tooltip
location="right"
Expand All @@ -299,11 +302,11 @@
color="primary"
:label="nameConfig.label"
data-test-id="suffix"
:hint="nameConfig.hint"
:hint="(disableNameFields && isCurrentOwner(owner)) ? '' : nameConfig.hint"
persistentHint
:rules="additionalNameRules"
:disabled="disableNameFields"
:readonly="disableNameFields"
:disabled="disableNameFields && isCurrentOwner(owner)"
:readonly="disableNameFields && isCurrentOwner(owner)"
v-bind="props"
/>
</template>
Expand All @@ -315,7 +318,7 @@
<label class="generic-label">
Phone Number
</label>
<v-row class="py-2">
<v-row class="my-2">
<v-col cols="6">
<v-text-field
id="phone-number"
Expand Down Expand Up @@ -351,14 +354,17 @@
:editing="true"
:schema="{ ...addressSchema }"
:triggerErrors="triggerAddressErrors"
class="mt-2"
class="mt-6"
hideAddressHint
@valid="isAddressFormValid = $event"
@update-address="owner.address = $event"
/>

<!-- Group Add / Edit -->
<template v-if="!isTransferDueToDeath && !isFrozenMhrDueToAffidavit && !(isMhrCorrection && editHomeOwner)">
<template
v-if="!isTransferDueToDeath && !isFrozenMhrDueToAffidavit &&
!(isMhrCorrection && editHomeOwner) && !(disableNameFields && isCurrentOwner(owner))"
>
<hr class="mt-3 mb-10">
<HomeOwnerGroups
:groupId="isDefinedGroup ? ownersGroupId : null"
Expand Down Expand Up @@ -678,9 +684,9 @@ export default defineComponent({
return localState.nameConfig?.tooltipContent[getMhrTransferType.value?.transferType]
}),
disabledNameEditTooltip: `Owner name’s cannot be changed here. Name change requests should be
submitted separately to BC Registries staff prior to completing this transfer.
Contact BC Registries for more information.`
disabledNameEditTooltip: `Owner name’s cannot be changed here. Name change requests should be submitted
separately, with the appropriate supporting documents, prior to completing this transfer. See Help with
Ownership Transfer or Change for more information.`
})
const done = async (): Promise<void> => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
v-else-if="item.ownerId"
:key="`owner-row-key-${homeOwners.indexOf(item)}`"
class="owner-info"
:class="{ 'border-error-left': isInvalidOwnerGroup(item.groupId) }"
:data-test-id="`owner-info-${item.ownerId}`"
>
<!-- Start of Name -->
Expand All @@ -151,7 +152,6 @@
:class="[
{
'no-bottom-border': hideRowBottomBorder(item),
'border-error-left': isInvalidOwnerGroup(item.groupId)
},
homeOwnersTableHeaders[0].class
]"
Expand Down
34 changes: 25 additions & 9 deletions ppr-ui/src/composables/mhrInformation/useMhrInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ import {
RouteNames,
UITransferTypes
} from '@/enums'
import { fetchMhRegistration, normalizeObject, parseAccountToSubmittingParty } from '@/utils'
import {
fetchMhRegistration,
normalizeObject,
parseAccountToSubmittingParty
} from '@/utils'
import { cloneDeep } from 'lodash'
import { useHomeOwners, useTransferOwners } from '@/composables'
import { computed, reactive, toRefs } from 'vue'
Expand Down Expand Up @@ -425,17 +429,26 @@ export const useMhrInformation = () => {

/** Filing Submission Helpers **/

/**
* Parses and returns the owner groups for a manufactured home transfer.
*
* @param {boolean} [isDraft=false] - Indicates whether the parsing is for a draft.
* @returns {MhrRegistrationHomeOwnerGroupIF[]} The parsed owner groups.
*/
const parseOwnerGroups = (isDraft: boolean = false): MhrRegistrationHomeOwnerGroupIF[] => {
const ownerGroups = []

getMhrTransferHomeOwnerGroups.value.forEach(ownerGroup => {
if (ownerGroup.action !== ActionTypes.REMOVED || isDraft) {
ownerGroup.interestDenominator = ownerGroup.interestDenominator || 0
ownerGroup.interestNumerator = ownerGroup.interestNumerator || 0
const addedEditedOwners = ownerGroup.owners.filter(owner => owner.action !== ActionTypes.REMOVED)
.map(owner => {
return owner.individualName ? { ...owner, individualName: normalizeObject(owner.individualName) } : owner
})
const addedEditedOwners = ownerGroup.owners
.filter(owner => owner.action !== ActionTypes.REMOVED)
.map(owner => ({
...owner,
...(owner.individualName && { individualName: normalizeObject(owner.individualName) }),
...(owner.action == ActionTypes.CHANGED && { previousOwnerId: owner.ownerId })
}))

ownerGroups.push({
...ownerGroup,
Expand All @@ -457,10 +470,13 @@ export const useMhrInformation = () => {
if (ownerGroup.owners.some(owner => owner.action === ActionTypes.REMOVED)) {
ownerGroups.push({
...ownerGroup,
owners: ownerGroup.owners.filter(owner => owner.action !== ActionTypes.REMOVED)
.map(owner => {
return owner.individualName ? { ...owner, individualName: normalizeObject(owner.individualName) } : owner
}),
owners: ownerGroup.owners
.filter(owner => owner.action !== ActionTypes.REMOVED)
.map(owner => ({
...owner,
...(owner.individualName && { individualName: normalizeObject(owner.individualName) }),
...(owner.action == ActionTypes.CHANGED && { previousOwnerId: owner.ownerId })
})),
type: ApiHomeTenancyTypes[
Object.keys(HomeTenancyTypes).find(key => HomeTenancyTypes[key] as string === ownerGroup.type)
]
Expand Down
26 changes: 2 additions & 24 deletions ppr-ui/src/composables/mhrInformation/useTransferOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,7 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {

/** Returns true when Add/Edit Owner name fields should be disabled **/
const disableNameFields = computed((): boolean => {
return [
ApiTransferTypes.SURVIVING_JOINT_TENANT
].includes(getMhrTransferType.value?.transferType)
return isTransferDueToDeath.value || isTransferBillOfSale.value || isTransferNonGiftBillOfSale.value
})

/** Returns true when ownership structure is joint tenancy /w min 2 owners but not executors, trustees or admins. **/
Expand Down Expand Up @@ -375,33 +373,13 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
if (enableAllActions) return true

switch (getMhrTransferType.value?.transferType) {
case ApiTransferTypes.SALE_OR_GIFT:
case ApiTransferTypes.TRANS_FAMILY_ACT:
case ApiTransferTypes.TRANS_INFORMAL_SALE:
case ApiTransferTypes.TRANS_QUIT_CLAIM:
case ApiTransferTypes.TRANS_RECEIVERSHIP:
case ApiTransferTypes.TRANS_SEVER_GRANT:
case ApiTransferTypes.TRANS_WRIT_SEIZURE:
case ApiTransferTypes.ABAN:
case ApiTransferTypes.BANK:
case ApiTransferTypes.COU:
case ApiTransferTypes.FORE:
case ApiTransferTypes.GENT:
case ApiTransferTypes.TRANS_LAND_TITLE:
case ApiTransferTypes.REIV:
case ApiTransferTypes.REPV:
case ApiTransferTypes.SZL:
case ApiTransferTypes.TAXS:
case ApiTransferTypes.VEST:
return false // Disable for Sale or Gift
case ApiTransferTypes.TO_EXECUTOR_PROBATE_WILL:
case ApiTransferTypes.TO_EXECUTOR_UNDER_25K_WILL:
return owner.action === ActionTypes.ADDED
case ApiTransferTypes.SURVIVING_JOINT_TENANT:
// Check for joint tenancy (at least two owners who are not executors, trustees or admins)
return owner.type === ApiHomeTenancyTypes.JOINT
default:
return false
return true
}
}

Expand Down
19 changes: 14 additions & 5 deletions ppr-ui/src/views/userAccess/QsInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,20 @@
v-if="[MhrSubTypes.MANUFACTURER, MhrSubTypes.DEALERS].includes(getMhrSubProduct)"
class="manufacturer-home-location-form mt-8"
>
<h2>Location of Manufactured Home(s)</h2>
<p class="mt-1">
Enter the civic address of the manufacturer’s lot/premises where the homes are located. This address will
display as the registered location for homes owned by the manufacturer.
</p>
<template v-if="getMhrSubProduct === MhrSubTypes.MANUFACTURER">
<h2>Location of Manufactured Home(s)</h2>
<p class="mt-1">
Enter the civic address of the manufacturer’s lot/premises where the homes are located. This address will
display as the registered location for homes owned by the manufacturer.
</p>
</template>
<template v-else>
<h2>Location of Dealer Home(s)</h2>
<p class="mt-1">
Enter the civic address of the dealer’s lot/premises where the homes are located. This address will display
as the registered location for homes owned by the dealer.
</p>
</template>

<HomeCivicAddress
:value="getMhrQsHomeLocation"
Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/tests/unit/MhrTransferHomeOwners.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,8 @@ describe('Home Owners', () => {
// has border errors for the group (rows: header, error, owner one, owner two)
expect(homeOwners.find('.group-header-slot.border-error-left').exists()).toBeTruthy()
expect(homeOwners.find(getTestId('invalid-group-msg')).classes('border-error-left')).toBeTruthy()
expect(homeOwners.find(getTestId('owner-info-10')).find('.owner-name').classes('border-error-left')).toBeTruthy()
expect(homeOwners.find(getTestId('owner-info-20')).find('.owner-name').classes('border-error-left')).toBeTruthy()
expect(homeOwners.find(getTestId('owner-info-10')).classes('border-error-left')).toBeTruthy()
expect(homeOwners.find(getTestId('owner-info-20')).classes('border-error-left')).toBeTruthy()
})

it('TRANS SALE GIFT: should not show group error for Added and Deleted groups', async () => {
Expand Down

0 comments on commit 87a7ec7

Please sign in to comment.