diff --git a/ppr-ui/src/components/common/SimpleTable.vue b/ppr-ui/src/components/common/SimpleTable.vue index e83472411..b8edf11a7 100644 --- a/ppr-ui/src/components/common/SimpleTable.vue +++ b/ppr-ui/src/components/common/SimpleTable.vue @@ -67,15 +67,16 @@ import { shortPacificDate } from '@/utils' import { BaseHeaderIF } from '@/interfaces' /** Props **/ -// eslint-disable-next-line @typescript-eslint/no-unused-vars const props = withDefaults(defineProps<{ tableHeaders?: Array, tableData?: Array, - rowLabel: string + rowLabel?: string, + dateFallBackLabel?: string }>(), { tableHeaders: null, tableData: null, - rowLabel: '' + rowLabel: 'History', + dateFallBackLabel: 'Current' }) const expandRow = ref([]) @@ -116,8 +117,8 @@ const getItemValue = (item: object, valuePaths: Array | string): string }, item) // Format the value as a date if the path includes 'date' - if (path.toLowerCase().includes('date') && result) { - return shortPacificDate(result) + if (path.toLowerCase().includes('date')) { + return !!result ? shortPacificDate(result) : props.dateFallBackLabel } return result diff --git a/ppr-ui/src/components/mhrHistory/MhrHistoryLocations.vue b/ppr-ui/src/components/mhrHistory/MhrHistoryLocations.vue new file mode 100644 index 000000000..3a1364264 --- /dev/null +++ b/ppr-ui/src/components/mhrHistory/MhrHistoryLocations.vue @@ -0,0 +1,355 @@ + + + diff --git a/ppr-ui/src/components/mhrHistory/index.ts b/ppr-ui/src/components/mhrHistory/index.ts index 3c76de619..01fd81275 100644 --- a/ppr-ui/src/components/mhrHistory/index.ts +++ b/ppr-ui/src/components/mhrHistory/index.ts @@ -1 +1,2 @@ export { default as MhrHistoryDescription } from './MhrHistoryDescription.vue' +export { default as MhrHistoryLocations } from './MhrHistoryLocations.vue' diff --git a/ppr-ui/src/composables/mhrInformation/useTransportPermits.ts b/ppr-ui/src/composables/mhrInformation/useTransportPermits.ts index dea9416cb..edeef6060 100644 --- a/ppr-ui/src/composables/mhrInformation/useTransportPermits.ts +++ b/ppr-ui/src/composables/mhrInformation/useTransportPermits.ts @@ -152,13 +152,13 @@ export const useTransportPermits = () => { APIRegistrationTypes.MANUFACTURED_HOME_NOTICE] .includes(getLienRegistrationType.value as APIRegistrationTypes) || // Unit Notes check - getMhrUnitNotes.value - .map(note => note.documentType) - .some(note => [ - UnitNoteDocTypes.NOTICE_OF_TAX_SALE, - UnitNoteDocTypes.CONFIDENTIAL_NOTE, - UnitNoteDocTypes.RESTRAINING_ORDER] - .includes(note)) + getMhrUnitNotes.value + .filter(note => note.status === UnitNoteStatusTypes.ACTIVE) + .some(note => [ + UnitNoteDocTypes.NOTICE_OF_TAX_SALE, + UnitNoteDocTypes.CONFIDENTIAL_NOTE, + UnitNoteDocTypes.RESTRAINING_ORDER + ].includes(note.documentType)) ) ) diff --git a/ppr-ui/src/interfaces/mhr-api-interfaces/MhrHistoryIF.ts b/ppr-ui/src/interfaces/mhr-api-interfaces/MhrHistoryIF.ts index 6e178fb86..d2ed19f88 100644 --- a/ppr-ui/src/interfaces/mhr-api-interfaces/MhrHistoryIF.ts +++ b/ppr-ui/src/interfaces/mhr-api-interfaces/MhrHistoryIF.ts @@ -1,3 +1,5 @@ +import { AddressIF, MhrLocationInfoIF } from '@/interfaces' + export interface DescriptionIF { baseInformation?: { circa?: boolean @@ -29,15 +31,7 @@ export interface SectionIF { widthInches?: number } -export interface AddressIF { - city?: string - country?: string - postalCode?: string - region?: string - street?: string -} - -export interface LocationIF { +export interface LocationIF extends MhrLocationInfoIF{ address?: AddressIF additionalDescription?: string createDateTime?: string @@ -53,6 +47,10 @@ export interface LocationIF { registrationDescription?: string status?: string taxCertificate?: boolean + dealerName?: string + parkName?: string + pad?: string + isOwnLand?: string } export interface IndividualNameIF { @@ -99,7 +97,7 @@ export interface RegistrationIF { export interface MhrHistoryRoIF { descriptions?: DescriptionIF[] - locations?: Location[] + locations?: LocationIF[] mhrNumber: string owners?: OwnerIF[] registrations?: RegistrationIF[] diff --git a/ppr-ui/src/resources/mhr-history/mhHistoryTableHeaders.ts b/ppr-ui/src/resources/mhr-history/mhHistoryTableHeaders.ts index 01b336b9e..22812df55 100644 --- a/ppr-ui/src/resources/mhr-history/mhHistoryTableHeaders.ts +++ b/ppr-ui/src/resources/mhr-history/mhHistoryTableHeaders.ts @@ -31,27 +31,27 @@ export const homeDescriptionHeaders: Array = [ export const homeLocationHeaders: Array = [ { name: '', - value: 'action', + value: '', class: 'column-width-md' }, { name: 'Town/City', - value: 'townCity', + value: 'address.city', class: 'col-22-5' }, { name: 'Street', - value: 'street', + value: 'address.street', class: 'column-xs' }, { name: 'From', - value: 'from', + value: 'createDateTime', class: 'column-xs' }, { name: 'To', - value: 'to', + value: 'endDateTime', class: 'column-xs' } ] @@ -64,22 +64,22 @@ export const homeOwnerHeaders: Array = [ }, { name: 'Owner Name', - value: 'name', + value: ['individualName.first', 'individualName.middle', 'individualName.last'], class: 'col-22-5' }, { name: 'Tenancy Type', - value: 'tenancyType', + value: 'type', class: 'column-xs' }, { name: 'Owner From', - value: 'from', + value: 'createDateTime', class: 'column-xs' }, { name: 'Owner Until', - value: 'to', + value: 'endDateTime', class: 'column-xs' }, { diff --git a/ppr-ui/src/views/mhrInformation/MhrHistory.vue b/ppr-ui/src/views/mhrInformation/MhrHistory.vue index aa0265f2e..fceaa2180 100644 --- a/ppr-ui/src/views/mhrInformation/MhrHistory.vue +++ b/ppr-ui/src/views/mhrInformation/MhrHistory.vue @@ -40,7 +40,6 @@ > @@ -106,7 +114,7 @@ import { homeOwnerHeaders, mhHistoryTabConfig } from '@/resources/mhr-history' -import { MhrHistoryDescription } from '@/components/mhrHistory' +import { MhrHistoryDescription, MhrHistoryLocations } from '@/components/mhrHistory' /** Composables **/ const { isAuthenticated } = useAuth()