Skip to content

Commit

Permalink
Merge branch 'main' into 22482-fix-error-on-cancel-note
Browse files Browse the repository at this point in the history
  • Loading branch information
flutistar authored Aug 19, 2024
2 parents 070f682 + 1fcb149 commit e01f92a
Show file tree
Hide file tree
Showing 16 changed files with 135 additions and 72 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.2.44",
"version": "3.2.45",
"private": true,
"appName": "Assets UI",
"sbcName": "SBC Common Components",
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/mhrTransfers/DeathCertificate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default defineComponent({
deathCertificateNumberRules: computed((): Array<()=>string|boolean> => {
return customRules(
maxLength(20),
required('Enter Death Certificate Registration Number')
required('Enter death certificate registration number')
)
})
})
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/tables/RegistrationTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@
singleLine
persistentClear
:clearIcon="'mdi-close'"
@click="showDatePicker = true"
aria-hidden="true"
@click="showDatePicker = true"
/>
<v-select
v-if="isPpr && header.value === 'statusType'"
Expand Down
30 changes: 18 additions & 12 deletions ppr-ui/src/components/tables/common/TableRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
color="primary"
size="small"
icon
:aria-label="isPpr ? 'Expand Amendments' : 'Expand History'"
role="button"
@click="toggleExpand(item)"
@mouseover="rollover = true"
@mouseleave="rollover = false"
Expand Down Expand Up @@ -252,14 +254,17 @@
class="pdf-btn px-0 mt-n3"
variant="plain"
:loading="item.path === loadingPDF"
@click="downloadPDF(item)"
aria-label="Download PDF"
@click="downloadPDF(item)"
>
<img
<img
src="@/assets/svgs/pdf-icon-blue.svg"
role="img"
>
<span class="pl-1" aria-hidden="true">PDF</span>
<span
class="pl-1"
aria-hidden="true"
>PDF</span>
</v-btn>
<v-tooltip
v-else-if="!isDraft(item)"
Expand Down Expand Up @@ -303,8 +308,8 @@
v-if="isDraft(item)"
class="edit-btn"
color="primary"
@click="editDraft(item)"
aria-label="Edit Button"
@click="editDraft(item)"
>
<span>Edit</span>
</v-btn>
Expand All @@ -320,19 +325,19 @@
v-else-if="!isExpired(item) && !isDischarged(item)"
class="edit-btn"
color="primary"
aria-hidden="false"
aria-label="Amend Button"
@click="handleAction(item, TableActions.AMEND)"
aria-hidden="false"
aria-label="Amend Button"
>
<span>Amend</span>
</v-btn>
<v-btn
v-else
color="primary"
class="remove-btn"
aria-label="Remove From Table Button"
aria-hidden="false"
@click="handleAction(item, TableActions.REMOVE)"
aria-hidden="false"
aria-label="Remove From Table Button"
>
<span class="fs-12">Remove From Table</span>
</v-btn>
Expand Down Expand Up @@ -471,9 +476,9 @@
<v-btn
color="primary"
class="edit-btn"
@click="openMhr(item)"
aria-hidden="false"
aria-label="Open Button"
@click="openMhr(item)"
>
<span>Open</span>
</v-btn>
Expand Down Expand Up @@ -618,9 +623,9 @@
<v-btn
color="primary"
class="edit-btn"
@click="openMhr(item)"
aria-hidden="false"
aria-label="Edit Button"
@click="openMhr(item)"
>
<span>Edit</span>
</v-btn>
Expand Down Expand Up @@ -696,7 +701,7 @@ import {
HomeLocationTypes
} from '@/enums'
import { useRegistration } from '@/composables/useRegistration'
import { useExemptions, useTransferOwners } from '@/composables'
import { useExemptions, useMhrInformation, useTransferOwners } from '@/composables'
import moment from 'moment'
import { storeToRefs } from 'pinia'
import { QSLockedStateUnitNoteTypes } from '@/resources'
Expand Down Expand Up @@ -741,6 +746,7 @@ export default defineComponent({
securedParties
} = useRegistration(null)
const { isTransAffi } = useTransferOwners()
const { hasQsTransferOrExemptionBlockingLien } = useMhrInformation()
const { isExemptionEnabled, isNonResExemptionEnabled, hasChildResExemption } = useExemptions()
const localState = reactive({
Expand Down Expand Up @@ -779,7 +785,7 @@ export default defineComponent({
hasLienForQS: computed(() => {
return isRoleQualifiedSupplier.value &&
localState.item.lienRegistrationType &&
localState.item.lienRegistrationType !== APIRegistrationTypes.SECURITY_AGREEMENT
hasQsTransferOrExemptionBlockingLien.value
}),
hasLockedForQS: computed(() => {
return hasLockedState(localState.item) && isRoleQualifiedSupplier.value
Expand Down
8 changes: 6 additions & 2 deletions ppr-ui/src/components/unitNotes/UnitNoteAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ export default defineComponent({
: personGivingNoticeContent
),
isNoticeOfTaxSale: computed((): boolean => props.docType === UnitNoteDocTypes.NOTICE_OF_TAX_SALE),
hasNoPersonGivingNotice: props.docType === UnitNoteDocTypes.DECAL_REPLACEMENT || (getMhrUnitNote.value as UnitNoteIF).hasNoPersonGivingNotice || false,
hasNoPersonGivingNotice: props.docType === UnitNoteDocTypes.DECAL_REPLACEMENT ||
(getMhrUnitNote.value as UnitNoteIF).hasNoPersonGivingNotice || false,
// Remarks
unitNoteRemarks: (getMhrUnitNote.value as UnitNoteIF).remarks || '',
Expand Down Expand Up @@ -176,7 +177,10 @@ export default defineComponent({
onMounted(() => {
if(props.docType === UnitNoteDocTypes.DECAL_REPLACEMENT) {
setValidation(MhrSectVal.UNIT_NOTE_VALID, MhrCompVal.PERSON_GIVING_NOTICE_VALID, localState.hasNoPersonGivingNotice)
setValidation(
MhrSectVal.UNIT_NOTE_VALID, MhrCompVal.PERSON_GIVING_NOTICE_VALID,
localState.hasNoPersonGivingNotice
)
handleStoreUpdate('hasNoPersonGivingNotice', localState.hasNoPersonGivingNotice)
}
})
Expand Down
33 changes: 32 additions & 1 deletion ppr-ui/src/composables/mhrInformation/useMhrInformation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,38 @@ export const useMhrInformation = () => {
localState.isFrozenMhr &&
QSLockedStateUnitNoteTypes.includes(getMhrInformation.value?.frozenDocumentType)
)
})
}),
/** Returns true when there is a lien present that would block a Qualified Supplier from ALL Registration Types **/
hasQsBlockingLien: computed((): boolean => {
return [
APIRegistrationTypes.SECURITY_AGREEMENT_TAX,
APIRegistrationTypes.TRANSITION_SECURITY_AGREEMENT_TAX,
APIRegistrationTypes.TRANSITION_MH_TAX
].includes(getLienRegistrationType.value)
}),
/** Returns true when there is a lien present that would block a Qualified Supplier from Transfers or Exemptions **/
hasQsTransferOrExemptionBlockingLien: computed((): boolean => {
return localState.hasQsBlockingLien ||
[
APIRegistrationTypes.SECURITY_AGREEMENT_GOV,
APIRegistrationTypes.TRANSITION_SECURITY_AGREEMENT_GOV,
APIRegistrationTypes.TRANSITION_MH_GOV,
APIRegistrationTypes.MARRIAGE_MH,
APIRegistrationTypes.LAND_TAX_LIEN,
APIRegistrationTypes.MAINTENANCE_LIEN,
APIRegistrationTypes.MANUFACTURED_HOME_NOTICE,
APIRegistrationTypes.SALE_OF_GOODS
].includes(getLienRegistrationType.value)
}),
/** Returns true when there is a lien present that would block a Qualified Supplier from Transport Permits **/
hasQsPermitBlockingLien: computed((): boolean => {
return localState.hasQsBlockingLien ||
[
APIRegistrationTypes.LAND_TAX_LIEN,
APIRegistrationTypes.MAINTENANCE_LIEN,
APIRegistrationTypes.MANUFACTURED_HOME_NOTICE
].includes(getLienRegistrationType.value)
}),
})

/** New Filings / Initializing **/
Expand Down
23 changes: 10 additions & 13 deletions ppr-ui/src/composables/mhrInformation/useTransportPermits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import {
UnitNoteIF
} from '@/interfaces'
import {
APIRegistrationTypes,
HomeLocationTypes,
MhApiStatusTypes,
UnitNoteDocTypes,
UnitNoteStatusTypes
} from '@/enums'
import { cloneDeep, get, isEqual } from 'lodash'
import { useMhrInformation } from '@/composables'

// Global constants
const isChangeLocationActive: Ref<boolean> = ref(false)
Expand All @@ -36,7 +36,6 @@ export const useTransportPermits = () => {
isRoleStaffSbc,
isRoleStaffReg,
isRoleQualifiedSupplier,
getLienRegistrationType,
getMhrUnitNotes,
getMhrTransportPermit,
getMhrOriginalTransportPermit,
Expand All @@ -54,6 +53,8 @@ export const useTransportPermits = () => {
setMhrTransportPermitLocationChangeType
} = useStore()

const { hasQsPermitBlockingLien } = useMhrInformation()

/** Returns true when the Mhr Information permitStatus is ACTIVE **/
const hasActiveTransportPermit: ComputedRef<boolean> = computed((): boolean => {
return getMhrInformation.value.permitStatus === MhApiStatusTypes.ACTIVE
Expand Down Expand Up @@ -143,24 +144,20 @@ export const useTransportPermits = () => {
.includes(newLocation)
}

const isTransportPermitDisabled = computed((): boolean =>
const isTransportPermitDisabled = computed((): boolean => {
// QS or SBC role check
(isRoleQualifiedSupplier.value || isRoleStaffSbc.value) &&
// PPR Liens check
([APIRegistrationTypes.LAND_TAX_LIEN,
APIRegistrationTypes.MAINTENANCE_LIEN,
APIRegistrationTypes.MANUFACTURED_HOME_NOTICE]
.includes(getLienRegistrationType.value as APIRegistrationTypes) ||
// Unit Notes check
return (isRoleQualifiedSupplier.value || isRoleStaffSbc.value) &&
// PPR Liens check
((isRoleQualifiedSupplier.value && hasQsPermitBlockingLien.value) ||
// Unit Notes check
getMhrUnitNotes.value
.filter(note => note.status === UnitNoteStatusTypes.ACTIVE)
.some(note => [
UnitNoteDocTypes.NOTICE_OF_TAX_SALE,
UnitNoteDocTypes.CONFIDENTIAL_NOTE,
UnitNoteDocTypes.RESTRAINING_ORDER
].includes(note.documentType))
)
)
].includes(note.documentType)))
})

/**
* Check if Amend or Cancel Transport Permit is allowed for Exempt MHR based on few conditions.
Expand Down
10 changes: 9 additions & 1 deletion ppr-ui/src/enums/registrationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ export enum APIRegistrationTypes {
MHR_CORRECTION_STAFF = 'REGC_STAFF',
MHR_CORRECTION_CLIENT = 'REGC_CLIENT',
MHR_PUBLIC_AMENDMENT = 'PUBA',
MHR_RE_REGISTRATION = 'EXRE'
MHR_RE_REGISTRATION = 'EXRE',
// Secured Party is the Crown
SECURITY_AGREEMENT_GOV = 'SA_GOV',
TRANSITION_SECURITY_AGREEMENT_GOV = 'TA_GOV',
TRANSITION_MH_GOV = 'TM_GOV',
// Provincial Ministry tax branch
SECURITY_AGREEMENT_TAX = 'SA_TAX',
TRANSITION_SECURITY_AGREEMENT_TAX = 'TA_TAX',
TRANSITION_MH_TAX = 'TM_TAX'
}

export enum UIRegistrationTypes {
Expand Down
25 changes: 25 additions & 0 deletions ppr-ui/src/utils/axios-base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Axios from 'axios'
import * as Sentry from '@sentry/browser'

const axios = Axios.create()

axios.interceptors.request.use(
config => {
config.headers['x-apikey'] = sessionStorage.getItem('PPR_API_KEY')
return config
},
error => {
// console.log('axios interceptor set request headers error: ' + error)
Promise.reject(error)
}
)

axios.interceptors.response.use(
response => response,
error => {
Sentry.captureException(error)
return Promise.reject(error)
}
)

export { axios }
14 changes: 0 additions & 14 deletions ppr-ui/src/utils/axios-von.ts

This file was deleted.

2 changes: 1 addition & 1 deletion ppr-ui/src/utils/ltsa-api-helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Libraries
import { axios } from '@/utils/axios-ppr'
import { axios } from '@/utils/axios-base'
import { StatusCodes } from 'http-status-codes'
import { ErrorCategories } from '@/enums'
import { LtsaDetailsIF, TitleSummariesIF } from '@/interfaces/ltsa-api-interfaces'
Expand Down
Loading

0 comments on commit e01f92a

Please sign in to comment.