Skip to content

Commit

Permalink
Add FF for Staff Misc Transfer Types (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimak1 authored May 3, 2024
1 parent 4a3cc8c commit e12b95a
Show file tree
Hide file tree
Showing 9 changed files with 285 additions and 17 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.1.12",
"version": "3.1.13",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
75 changes: 71 additions & 4 deletions ppr-ui/src/components/mhrTransfers/TransferType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@
data-test-id="transfer-type-selector"
:rules="transferTypeRules"
:disabled="disableSelect"
:menuProps="{ maxHeight: 392 }"
:menuProps="isMiscTransfersEnabled ? { maxHeight: 392 } : {}"
returnObject
>
<template #item="{ props, item }">
<template
v-if="isMiscTransfersEnabled"
#item="{ props, item }"
>
<!-- Type Header -->
<template v-if="item.raw.class === 'transfer-type-list-header'">
<v-divider
Expand Down Expand Up @@ -121,6 +124,63 @@
</v-tooltip>
</v-list-item>
</template>
<template
v-else
#item="{ props, item }"
>
<!-- Type Header -->
<template v-if="item.raw.class === 'transfer-type-list-header'">
<v-list-item
v-if="item.raw.class === 'transfer-type-list-header'"
:aria-disabled="true"
>
<v-row
:id="`transfer-type-drop-${item.raw.group}`"
noGutters
>
<v-col alignSelf="center">
<span class="transfer-type-list-header px-1">{{ item.raw.textLabel }}</span>
</v-col>
</v-row>
</v-list-item>
</template>
<v-list-item
v-else
:id="`list-${item.raw.transferType}`"
class="copy-normal gray7"
v-bind="props"
:title="null"
@click="handleTypeChange(item.raw)"
>
<v-tooltip
location="right"
contentClass="right-tooltip pa-5"
transition="fade-transition"
data-test-id="suffix-tooltip"
>
<template #activator="{ props }">
<v-list-item-title
class="pl-5"
v-bind="props"
>
{{ item.raw.textLabel }}
</v-list-item-title>
</template>
<span class="font-weight-bold">{{ item.raw.tooltip.title }}:</span><br>
<li
v-for="(item, index) in item.raw.tooltip.bullets"
:key="index"
>
{{ item }}
</li>
<div v-if="item.raw.tooltip.note">
<br>
<span class="font-weight-bold">Note:</span>
{{ item.raw.tooltip.note }}
</div>
</v-tooltip>
</v-list-item>
</template>
</v-select>
</v-col>
</v-row>
Expand Down Expand Up @@ -172,6 +232,7 @@ import { BaseDialog } from '@/components/dialogs'
import {
ClientTransferTypes,
QualifiedSupplierTransferTypes,
StaffTransferTypesOrg,
StaffTransferTypes,
transfersContent,
transfersErrors
Expand Down Expand Up @@ -208,6 +269,7 @@ export default defineComponent({
} = storeToRefs(useStore())
const {
isMiscTransfersEnabled,
isJointTenancyStructure,
hasGroupsWithPersonOwners
} = useTransferOwners()
Expand Down Expand Up @@ -235,11 +297,15 @@ export default defineComponent({
transferTypesSelector: computed((): Array<TransferTypeSelectIF> => {
switch (true) {
case isRoleStaffReg.value:
return StaffTransferTypes.filter(item =>
return isMiscTransfersEnabled
? StaffTransferTypes.filter(item =>
localState.displayGroup[item.group] || item.class === 'transfer-type-list-header')
: StaffTransferTypesOrg
case isRoleQualifiedSupplierLawyersNotaries.value:
return QualifiedSupplierTransferTypes.filter(item =>
return isMiscTransfersEnabled
? QualifiedSupplierTransferTypes.filter(item =>
localState.displayGroup[item.group] || item.class === 'transfer-type-list-header')
: QualifiedSupplierTransferTypes
default:
return ClientTransferTypes
}
Expand Down Expand Up @@ -344,6 +410,7 @@ export default defineComponent({
})
return {
isMiscTransfersEnabled,
hasError,
required,
isRoleStaffReg,
Expand Down
37 changes: 30 additions & 7 deletions ppr-ui/src/components/tables/RegistrationTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
id="txt-type"
v-model="registrationType"
:items="mhrRegistrationTypes"
:menuProps="{ maxHeight: 440, width: 500 }"
:menuProps="isMiscTransfersEnabled ? { maxHeight: 440, width: 500 } : {}"
singleLine
itemTitle="registrationTypeUI"
itemValue="registrationTypeAPI"
Expand All @@ -118,9 +118,12 @@
hideDetails
density="compact"
label="Registration Type"
@update:menu="hideAllGroups"
@update:menu="isMiscTransfersEnabled ? hideAllGroups() : ''"
>
<template #item="{ props, item }">
<template
v-if="isMiscTransfersEnabled"
#item="{ props, item }"
>
<template v-if="item.raw.class === 'registration-list-header'">
<v-divider
v-if="item.raw.group !== 1"
Expand Down Expand Up @@ -160,6 +163,14 @@
v-bind="props"
/>
</template>
<template
v-else
#default="item"
>
<span class="list-item py-3">
{{ item.registrationTypeUI }}
</span>
</template>
</v-select>
</div>
<v-text-field
Expand Down Expand Up @@ -378,9 +389,15 @@ import {
TableActions
} from '@/enums'
import { useRegistration } from '@/composables/useRegistration'
import { MHRegistrationTypes, RegistrationTypesStandard, StatusTypes, MhStatusTypes } from '@/resources'
import {
MHRegistrationTypes,
RegistrationTypesStandard,
StatusTypes,
MhStatusTypes,
MHRegistrationTypesOrg
} from '@/resources'
import { storeToRefs } from 'pinia'
import { useTableFeatures } from '@/composables'
import { useTableFeatures, useTransferOwners } from '@/composables'
import { RangeDatePicker } from '@/components/common'
import { dateToYyyyMmDd, localTodayDate } from '@/utils'
import TableObserver from '@/components/tables/common/TableObserver.vue'
Expand Down Expand Up @@ -498,6 +515,8 @@ export default defineComponent({
} = useRegistration(props.setSort)
const { sortDates } = useTableFeatures()
const { isMiscTransfersEnabled } = useTransferOwners()
const localState = reactive({
expanded: [],
freezeTableScroll: false,
Expand All @@ -508,8 +527,11 @@ export default defineComponent({
statusTypes: [...StatusTypes],
mhStatusTypes: MhStatusTypes,
registrationTypes: [...RegistrationTypesStandard].slice(1),
mhrRegistrationTypes: computed(() => MHRegistrationTypes.filter(item =>
localState.displayGroup[item.group] || item.class === 'registration-list-header')),
mhrRegistrationTypes: computed(() =>
isMiscTransfersEnabled
? MHRegistrationTypes.filter(item =>
localState.displayGroup[item.group] || item.class === 'registration-list-header')
: [...MHRegistrationTypesOrg].slice(1)),
loadingNewPages: false,
hasRPPR: computed(() => {
const productSubscriptions =
Expand Down Expand Up @@ -796,6 +818,7 @@ export default defineComponent({
})
return {
isMiscTransfersEnabled,
getNext,
localTodayDate,
dateSortHandler,
Expand Down
6 changes: 5 additions & 1 deletion ppr-ui/src/composables/mhrInformation/useTransferOwners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@/interfaces'
import { computed, reactive, toRefs } from 'vue'
import { find, isEqual, uniq } from 'lodash'
import { normalizeObject } from '@/utils'
import { getFeatureFlag, normalizeObject } from '@/utils'
import {
QSLockedStateUnitNoteTypes,
transferOwnerPartyTypes,
Expand Down Expand Up @@ -51,6 +51,9 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
getCurrentGroupById
} = useHomeOwners(true)

// Enables all Misc and Non Bill of Sale Transfers for Staff
const isMiscTransfersEnabled: boolean = getFeatureFlag('mhr-misc-transfers-enabled')

/** Local State for custom computed properties. **/
const localState = reactive({
isSOorJT: computed((): boolean => {
Expand Down Expand Up @@ -901,6 +904,7 @@ export const useTransferOwners = (enableAllActions: boolean = false) => {
}

return {
isMiscTransfersEnabled,
isAddedHomeOwnerGroup,
isRemovedHomeOwnerGroup,
isChangedOwnerGroup,
Expand Down
78 changes: 78 additions & 0 deletions ppr-ui/src/resources/registrationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,84 @@ export const MhrPublicAmendment: RegistrationTypeIF = {
text: UIRegistrationTypes.MHR_PUBLIC_AMENDMENT
}

export const MHRegistrationTypesOrg: Array<MhRegistrationTypeIF> = [
{
class: 'registration-list-header',
disabled: true,
divider: false,
group: 3,
registrationTypeUI: null,
registrationTypeAPI: null,
text: 'Standard Registrations'
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.CONVERTED,
registrationTypeAPI: APIMhrDescriptionTypes.CONVERTED,
text: `${UIMhrDescriptionTypes.CONVERTED} (${APIMhrDescriptionTypes.CONVERTED})`
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.REGISTER_NEW_UNIT,
registrationTypeAPI: APIMhrDescriptionTypes.REGISTER_NEW_UNIT,
text: `${UIMhrDescriptionTypes.REGISTER_NEW_UNIT} (${APIMhrDescriptionTypes.REGISTER_NEW_UNIT})`
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.SALE_OR_GIFT,
registrationTypeAPI: APIMhrDescriptionTypes.SALE_OR_GIFT,
text: `${UIMhrDescriptionTypes.SALE_OR_GIFT} (${APIMhrDescriptionTypes.SALE_OR_GIFT})`
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.SURVIVING_JOINT_TENANT,
registrationTypeAPI: APIMhrDescriptionTypes.SURVIVING_JOINT_TENANT,
text: `${UIMhrDescriptionTypes.SURVIVING_JOINT_TENANT} (${APIMhrDescriptionTypes.SURVIVING_JOINT_TENANT})`
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.TRANSFER_EXECUTOR_PROBATE_WILL,
registrationTypeAPI: APIMhrDescriptionTypes.TRANSFER_EXECUTOR_PROBATE_WILL,
text: `${UIMhrDescriptionTypes.TRANSFER_EXECUTOR_PROBATE_WILL}
(${APIMhrDescriptionTypes.TRANSFER_EXECUTOR_PROBATE_WILL})`
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.TRANSFER_EXECUTOR_UNDER_25_WILL,
registrationTypeAPI: APIMhrDescriptionTypes.TRANSFER_EXECUTOR_UNDER_25_WILL,
text: `${UIMhrDescriptionTypes.TRANSFER_EXECUTOR_UNDER_25_WILL}
(${APIMhrDescriptionTypes.TRANSFER_EXECUTOR_UNDER_25_WILL})`
},
{
class: 'registration-list-item',
disabled: false,
divider: false,
group: 3,
registrationTypeUI: UIMhrDescriptionTypes.TRANSFER_ADMINISTRATOR,
registrationTypeAPI: APIMhrDescriptionTypes.TRANSFER_ADMINISTRATOR,
text: `${UIMhrDescriptionTypes.TRANSFER_ADMINISTRATOR}
(${APIMhrDescriptionTypes.TRANSFER_ADMINISTRATOR})`
}
]

export const MHRegistrationTypes: Array<MhRegistrationTypeIF> = [
{
class: 'registration-list-header',
Expand Down
Loading

0 comments on commit e12b95a

Please sign in to comment.