Skip to content

Commit

Permalink
Mhr History Setup
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-eyds committed Jun 27, 2024
1 parent ce98a2f commit d57f06f
Show file tree
Hide file tree
Showing 18 changed files with 429 additions and 14 deletions.
53 changes: 51 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.

3 changes: 2 additions & 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.2.27",
"version": "3.2.28",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down Expand Up @@ -32,6 +32,7 @@
"@vuelidate/validators": "^2.0.4",
"@vuepic/vue-datepicker": "^7.2.2",
"axios": "^1.6.2",
"axios-mock-adapter": "^1.22.0",
"flush-promises": "^1.0.2",
"http-status-codes": "^2.1.4",
"material-design-icons": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export default defineComponent({
amendBreadcrumb[2].text =
`Base Registration ${getRegistrationNumber.value} - Amendment` || amendBreadcrumb[2].text
return amendBreadcrumb
} else if (name === RouteNames.MHR_INFORMATION) {
} else if ([RouteNames.MHR_INFORMATION, RouteNames.MHR_HISTORY].includes(name as RouteNames)) {
const mhrInfoBreadcrumb = [...tombstoneBreadcrumbMhrInformation]
mhrInfoBreadcrumb[2].text = `MHR Number ${getMhrInformation.value.mhrNumber}`
return mhrInfoBreadcrumb
Expand Down
10 changes: 8 additions & 2 deletions ppr-ui/src/components/common/RegistrationsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,9 @@ export default defineComponent({
}
openMhr(mhrInfo)
break
case TableActions.OPEN_MHR_HISTORY:
openMhr(mhrInfo, true)
break
case TableActions.OPEN_DRAFT_CORRECTION:
if (mhrInfo.outOfDate) {
// Handle stale drafts before opening the MHR when flagged as outOfDate
Expand Down Expand Up @@ -820,9 +823,12 @@ export default defineComponent({
await startNewRegistration(MhrRegistrationType, mhrInfo.draftNumber)
}
const openMhr = async (mhrSummary: MhRegistrationSummaryIF): Promise<void> => {
const openMhr = async (mhrSummary: MhRegistrationSummaryIF, isHistory = false): Promise<void> => {
setMhrInformation(mhrSummary)
await router.replace({ name: RouteNames.MHR_INFORMATION })
// Change the route for history
if (isHistory) await router.replace({ name: RouteNames.MHR_HISTORY })
else await router.replace({ name: RouteNames.MHR_INFORMATION })
}
const openDraftMhrCorrection = async (draftMhrCorrection) => {
Expand Down
23 changes: 22 additions & 1 deletion ppr-ui/src/components/tables/common/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,17 @@
<span class="ml-1">Non-Residential Exemption</span>
</v-list-item-subtitle>
</v-list-item>
<v-list-item
v-if="isRoleStaffReg"
@click="openMhrHistory(item)"
>
<v-list-item-subtitle>
<v-icon size="small">
mdi-clock
</v-icon>
<span class="ml-1">Historical Home Information</span>
</v-list-item-subtitle>
</v-list-item>
<v-list-item
data-test-id="remove-mhr-row-btn"
@click="handleAction(item, TableActions.REMOVE)"
Expand Down Expand Up @@ -905,6 +916,13 @@ export default defineComponent({
})
}
const openMhrHistory = (item) => {
emit('action', {
action: TableActions.OPEN_MHR_HISTORY,
mhrInfo: item
})
}
const isMhrTransfer = (item: any): boolean => {
const formattedTransferTypes = [
UITransferTypes.SALE_OR_GIFT,
Expand Down Expand Up @@ -1127,6 +1145,7 @@ export default defineComponent({
}, { deep: true, immediate: true })
return {
openMhrHistory,
hasRequiredTransfer,
multipleWordsToTitleCase,
freezeScrolling,
Expand Down Expand Up @@ -1184,7 +1203,6 @@ export default defineComponent({

<style lang="scss" scoped>
@import '@/assets/styles/theme.scss';
.registration-row {
// $blueSelected 0.5 opacity colour at full opacity (needed for .actions-cell overlay)
background-color: #f2f6fb;
Expand All @@ -1199,6 +1217,9 @@ export default defineComponent({
border-bottom: thin solid rgba(0, 0, 0, .12)
}
}
img {
margin-bottom: -2px;
}
.base-registration-row {
background-color: white;
Expand Down
1 change: 1 addition & 0 deletions ppr-ui/src/enums/routeNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export enum RouteNames {
YOUR_HOME = 'your-home',
MHR_INFORMATION = 'mhr-information',
MHR_INFORMATION_NOTE = 'mhr-information-note',
MHR_HISTORY = 'mhr-history',
RESIDENTIAL_EXEMPTION = 'residential-exemption',
NON_RESIDENTIAL_EXEMPTION = 'non-residential-exemption',
EXEMPTION_DETAILS = 'exemption-details',
Expand Down
3 changes: 2 additions & 1 deletion ppr-ui/src/enums/tableActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export enum TableActions {
OPEN_MHR = 'openMhr',
EDIT_NEW_MHR = 'editMhr',
OPEN_DRAFT_CORRECTION = 'openDraftCorrection',
OPEN_DRAFT_RE_REGISTRATION = 'openDraftReRegistration'
OPEN_DRAFT_RE_REGISTRATION = 'openDraftReRegistration',
OPEN_MHR_HISTORY = 'openMhrHistory'
}
1 change: 1 addition & 0 deletions ppr-ui/src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export * from './exemption-interfaces'
export * from './base-data-union-interface'
export * from './updated-badge-interface'
export * from './admin-registration-interfaces'
export * from './mhr-api-interfaces'

/** A filing's business object from the API. */
export interface StaffPaymentIF {
Expand Down
105 changes: 105 additions & 0 deletions ppr-ui/src/interfaces/mhr-api-interfaces/MhrHistoryIF.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
interface Description {
baseInformation?: {
circa?: boolean
make?: string
model?: string
year?: number
}
createDateTime?: string
csaNumber?: string
csaStandard?: string
documentId?: string
documentRegistrationNumber?: string
manufacturer?: string
otherRemarks?: string
rebuiltRemarks?: string
registrationDescription?: string
sectionCount?: number
sections?: Section[]
status?: string
}

interface Section {
lengthFeet?: number
lengthInches?: number
serialNumber?: string
widthFeet?: number
widthInches?: number
}

interface Address {
city?: string
country?: string
postalCode?: string
region?: string
street?: string
}

interface Location {
address?: Address
additionalDescription?: string
createDateTime?: string
documentId?: string
documentRegistrationNumber?: string
endDateTime?: string
endRegistrationDescription?: string
leaveProvince?: boolean
legalDescription?: string
locationId?: number
locationType?: string
pidNumber?: string
registrationDescription?: string
status?: string
taxCertificate?: boolean
}

interface IndividualName {
first?: string
last?: string
middle?: string
}

interface Owner {
address?: Address
createDateTime?: string
documentId?: string
documentRegistrationNumber?: string
endDateTime?: string
endRegistrationDescription?: string
groupCount?: number
groupId?: number
groupOwnerCount?: number
groupTenancyType?: string
individualName?: IndividualName
interest?: string
interestDenominator?: number
interestNumerator?: number
ownerId?: number
partyType?: string
phoneNumber?: string
registrationDescription?: string
status?: string
type?: string
}

interface Registration {
affirmByName?: string
attentionReference?: string
consideration?: string
createDateTime?: string
declaredValue?: number
documentId?: string
documentRegistrationNumber?: string
ownLand?: boolean
registrationDescription?: string
transferDate?: string
}

export interface MhrHistoryRoIF {
descriptions?: Description[]
locations?: Location[]
mhrNumber: string
owners?: Owner[]
registrations?: Registration[]
statusType: string
}
1 change: 1 addition & 0 deletions ppr-ui/src/interfaces/mhr-api-interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './MhrHistoryIF'
9 changes: 9 additions & 0 deletions ppr-ui/src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
MHRSearch,
MhrRegistration,
MhrInformation,
MhrHistory,
ConfirmMHRSearch,
ReviewConfirm,
RenewRegistration,
Expand Down Expand Up @@ -242,6 +243,14 @@ export const routes: any = [
requiresAuth: true,
},
},
{
path: '/mhr-history',
name: RouteNames.MHR_HISTORY,
component: MhrHistory,
meta: {
requiresAuth: true,
},
},
{
path: '/user-access/qs-access-type',
name: RouteNames.QS_ACCESS_TYPE,
Expand Down
1 change: 1 addition & 0 deletions ppr-ui/src/utils/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const defaultFlagSet: LDFlagSet = {
'mhr-amend-transport-permit-enabled': false,
'mhr-cancel-transport-permit-enabled': false,
'mhr-user-access-enabled': false,
'mhr-history-enabled': false,
'sentry-enable': false, // by default, no sentry logs
'banner-text': '' // by default, there is no banner text
}
Expand Down
Loading

0 comments on commit d57f06f

Please sign in to comment.