From e0de3694110072890f53bc396b79cc5aaf73bf99 Mon Sep 17 00:00:00 2001 From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:57:15 -0700 Subject: [PATCH 1/3] lien validation update (#2006) --- ppr-ui/package-lock.json | 4 ++-- ppr-ui/package.json | 2 +- ppr-ui/src/composables/mhrInformation/useMhrInformation.ts | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index c6e429399..46445a77f 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.2.45", + "version": "3.2.46", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.2.45", + "version": "3.2.46", "dependencies": { "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 9dc41041b..64a97ba28 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.2.45", + "version": "3.2.46", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts index 922af9fc6..656b77df6 100644 --- a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts +++ b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts @@ -308,20 +308,18 @@ export const useMhrInformation = () => { // Get information about the lien to help with styling and functionality const getLienInfo = (): { class: string, msg: string, isSubmissionAllowed: boolean } => { - const isLienRegistrationTypeSA = getLienRegistrationType.value === APIRegistrationTypes.SECURITY_AGREEMENT const routeName = router.currentRoute.value.name - const isQSorSBC: boolean = isRoleQualifiedSupplier.value || isRoleStaffSbc.value if (routeName === RouteNames.MHR_INFORMATION && - (isRoleStaffReg.value || (isLienRegistrationTypeSA && isQSorSBC))) { + (isRoleStaffReg.value || (!localState.hasQsTransferOrExemptionBlockingLien && isQSorSBC))) { return { class: 'warning-msg', msg: LienMessages.defaultWarning, isSubmissionAllowed: true } } else if ((isRoleStaffReg.value && routeName === RouteNames.EXEMPTION_DETAILS) || - (isRoleQualifiedSupplier.value && isLienRegistrationTypeSA && + (isRoleQualifiedSupplier.value && !localState.hasQsTransferOrExemptionBlockingLien && [RouteNames.EXEMPTION_DETAILS, RouteNames.EXEMPTION_REVIEW].includes(routeName as RouteNames) )) { return { From cd9b7a2ae3a676b4c79414e215835cd25510c0d5 Mon Sep 17 00:00:00 2001 From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com> Date: Thu, 22 Aug 2024 09:37:25 -0700 Subject: [PATCH 2/3] Submissions Lien Check Update (#2008) --- ppr-ui/package-lock.json | 4 ++-- ppr-ui/package.json | 2 +- .../mhrInformation/useMhrInformation.ts | 19 ++++++++++++++++++- .../views/mhrInformation/MhrInformation.vue | 4 +++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 46445a77f..79374a6aa 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.2.46", + "version": "3.2.47", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.2.46", + "version": "3.2.47", "dependencies": { "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 64a97ba28..8aef59772 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.2.46", + "version": "3.2.47", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts index 656b77df6..a80bab271 100644 --- a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts +++ b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts @@ -152,7 +152,6 @@ export const useMhrInformation = () => { }) /** New Filings / Initializing **/ - const initMhrTransfer = (): MhrTransferIF => { return { mhrNumber: '', @@ -173,6 +172,23 @@ export const useMhrInformation = () => { } } + /** Returns true when the lien type is includes in the blocked lien list **/ + const includesBlockingLien = (lienType: APIRegistrationTypes) => { + return [ + APIRegistrationTypes.SECURITY_AGREEMENT_TAX, + APIRegistrationTypes.TRANSITION_SECURITY_AGREEMENT_TAX, + APIRegistrationTypes.TRANSITION_MH_TAX, + 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(lienType) + } + const parseMhrInformation = async (includeDetails = false): Promise => { const { data } = await fetchMhRegistration(getMhrInformation.value.mhrNumber) @@ -573,6 +589,7 @@ export const useMhrInformation = () => { initDraftMhrInformation, parseSubmittingPartyInfo, getLienInfo, + includesBlockingLien, parseMhrPermitData, ...toRefs(localState) } diff --git a/ppr-ui/src/views/mhrInformation/MhrInformation.vue b/ppr-ui/src/views/mhrInformation/MhrInformation.vue index 7f4340e06..2c41fb609 100644 --- a/ppr-ui/src/views/mhrInformation/MhrInformation.vue +++ b/ppr-ui/src/views/mhrInformation/MhrInformation.vue @@ -803,6 +803,7 @@ export default defineComponent({ initMhrTransfer, getUiTransferType, parseMhrInformation, + includesBlockingLien, initDraftMhrInformation, parseSubmittingPartyInfo, isFrozenMhrDueToUnitNote, @@ -1181,7 +1182,8 @@ export default defineComponent({ ? await getMHRegistrationSummary(getMhrInformation.value.mhrNumber, false) : null - if (!!regSum && !!regSum.lienRegistrationType && !isRoleStaffReg.value) { + if (!!regSum && !!regSum.lienRegistrationType && includesBlockingLien(regSum.lienRegistrationType) && + !isRoleStaffReg.value) { await setLienType(regSum.lienRegistrationType) await scrollToFirstError(true) localState.hasLienInfoDisplayed = true From b71479bab51e6d2d40e907cdca92c5ccff630c58 Mon Sep 17 00:00:00 2001 From: CameronEYDS <53542131+cameron-eyds@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:53:52 -0700 Subject: [PATCH 3/3] Preserve Table Filters for both PPR/MHR (#2005) * Preserve Table Filters for both PPR/MHR * clean up --- ppr-ui/package-lock.json | 4 +-- ppr-ui/package.json | 2 +- .../common/RegistrationsWrapper.vue | 28 +++++++++---------- .../components/dashboard/DashboardTabs.vue | 3 +- .../components/tables/RegistrationTable.vue | 6 ---- .../reg-table-data-interface.ts | 1 + ppr-ui/src/store/state/state-model.ts | 13 +++++++++ ppr-ui/src/store/store.ts | 23 ++++++--------- ppr-ui/src/utils/mhr-api-helper.ts | 1 + 9 files changed, 41 insertions(+), 40 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 79374a6aa..bbcae6ba1 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.2.47", + "version": "3.2.48", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.2.47", + "version": "3.2.48", "dependencies": { "@bcrs-shared-components/input-field-date-picker": "^1.0.0", "@lemoncode/fonk": "^1.5.1", diff --git a/ppr-ui/package.json b/ppr-ui/package.json index 8aef59772..baa8e2d92 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.2.47", + "version": "3.2.48", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/components/common/RegistrationsWrapper.vue b/ppr-ui/src/components/common/RegistrationsWrapper.vue index bf0fc24de..56dfe1663 100644 --- a/ppr-ui/src/components/common/RegistrationsWrapper.vue +++ b/ppr-ui/src/components/common/RegistrationsWrapper.vue @@ -201,7 +201,7 @@ :setNewRegItem="getRegTableNewItem" :setRegistrationHistory="myRegistrations" :setSearch="myRegFilter" - :setSort="getRegTableSortOptions" + :setSort="isPpr ? getRegTableSortOptions : getRegTableMhSortOptions" @action="myRegActionHandler($event)" @error="emitError($event)" @sort="myRegSort($event)" @@ -357,7 +357,7 @@ export default defineComponent({ getRegTableBaseRegs, getRegTableDraftsBaseReg, isMhrRegistration, isMhrManufacturerRegistration, getRegTableTotalRowCount, getStateModel, getRegTableDraftsChildReg, hasMorePages, getRegTableNewItem, getRegTableSortOptions, getRegTableSortPage, getUserSettings, getMhRegTableBaseRegs, isRoleStaffReg, - isRoleQualifiedSupplier + isRoleQualifiedSupplier, getRegTableMhSortOptions } = storeToRefs(useStore()) const { @@ -365,11 +365,8 @@ export default defineComponent({ initNewManufacturerMhr, fetchMhRegistrations } = useNewMhrRegistration(true) - const { initDraftMhrCorrection } = useMhrCorrections() - const { goToExemptions } = useExemptions() - const { initMhrReRegistration, initDraftMhrReRegistration } = useMhrReRegistration() const localState = reactive({ @@ -447,8 +444,8 @@ export default defineComponent({ } else if (props.isPpr) { // load in registrations from scratch resetRegTableData(null) - const myRegDrafts = await draftHistory(cloneDeep(getRegTableSortOptions.value)) - const myRegHistory = await registrationHistory() + const myRegDrafts = await draftHistory(getRegTableSortOptions.value) + const myRegHistory = await registrationHistory(getRegTableSortOptions.value) if (myRegDrafts?.error || myRegHistory?.error) { // prioritize reg error @@ -469,7 +466,7 @@ export default defineComponent({ setRegTableTotalRowCount(getRegTableTotalRowCount.value + historyDraftsCollapsed.drafts.length) } } else if (props.isMhr && !props.isTabView) { // If Tab view, Mhr Data will be loaded in dashboardTabs component - await fetchMhRegistrations() + await fetchMhRegistrations(getRegTableMhSortOptions.value) } @@ -703,7 +700,7 @@ export default defineComponent({ prevDraft: '' } setRegTableNewItem(newRegItem) - await fetchMhRegistrations() + await fetchMhRegistrations(getRegTableMhSortOptions.value) } localState.loading = false } @@ -869,7 +866,7 @@ export default defineComponent({ const removeMhrDraft = async (mhrNumber: string): Promise => { localState.myRegDataLoading = true await deleteMhrDraft(mhrNumber) - await fetchMhRegistrations() // Refresh the table with update Registration History + await fetchMhRegistrations(getRegTableMhSortOptions.value) localState.myRegDataLoading = false } @@ -916,7 +913,7 @@ export default defineComponent({ localState.myRegDataLoading = true const page = getRegTableSortPage.value + 1 setRegTableSortPage(page) - const nextRegs = await registrationHistory(cloneDeep(getRegTableSortOptions.value), page) + const nextRegs = await registrationHistory(getRegTableSortOptions.value, page) if (nextRegs.error) { emitError(nextRegs.error) } else { @@ -1029,7 +1026,7 @@ export default defineComponent({ const myRegSort = async (args: { sortOptions: RegistrationSortIF, sorting: boolean }): Promise => { localState.myRegDataLoading = true - setRegTableSortOptions(args.sortOptions) + setRegTableSortOptions(args.sortOptions, props.isMhr) const sorting = args.sorting let sortedDrafts = { drafts: [] as DraftResultIF[], error: null } @@ -1062,7 +1059,7 @@ export default defineComponent({ setRegTableBaseRegs(updatedRegs.registrations) } } else if (props.isMhr) { - await fetchMhRegistrations(cloneDeep(args.sortOptions)) + await fetchMhRegistrations(getRegTableMhSortOptions.value) } localState.myRegDataLoading = false } @@ -1086,7 +1083,7 @@ export default defineComponent({ val.addedRegSummary = regSummary } else { // its a draft - get draft summary - const drafts = await draftHistory(null) + const drafts = await draftHistory(getRegTableSortOptions.value) if (drafts.error) { emitError(drafts.error) // dialog and will reload the dash after localState.myRegDataAdding = false @@ -1177,7 +1174,7 @@ export default defineComponent({ } } } else { - await fetchMhRegistrations() + await fetchMhRegistrations(getRegTableMhSortOptions.value) } localState.myRegDataAdding = false @@ -1282,6 +1279,7 @@ export default defineComponent({ getRegTableNewItem, getRegTableTotalRowCount, getRegTableSortOptions, + getRegTableMhSortOptions, getMhRegTableBaseRegs, hasMorePages, myRegSort, diff --git a/ppr-ui/src/components/dashboard/DashboardTabs.vue b/ppr-ui/src/components/dashboard/DashboardTabs.vue index 2526933db..813f89d0e 100644 --- a/ppr-ui/src/components/dashboard/DashboardTabs.vue +++ b/ppr-ui/src/components/dashboard/DashboardTabs.vue @@ -104,6 +104,7 @@ export default defineComponent({ } = useStore() const { // Getters + getRegTableMhSortOptions, getMhRegTableBaseRegs, getRegTableBaseRegs, getRegTableTotalRowCount, @@ -133,7 +134,7 @@ export default defineComponent({ } onMounted(async () => { - await fetchMhRegistrations() + await fetchMhRegistrations(getRegTableMhSortOptions.value) }) return { diff --git a/ppr-ui/src/components/tables/RegistrationTable.vue b/ppr-ui/src/components/tables/RegistrationTable.vue index 0d7e5f5ad..1e964d5fb 100644 --- a/ppr-ui/src/components/tables/RegistrationTable.vue +++ b/ppr-ui/src/components/tables/RegistrationTable.vue @@ -369,7 +369,6 @@ import { computed, defineComponent, - onBeforeMount, onUpdated, reactive, ref, @@ -812,11 +811,6 @@ export default defineComponent({ { deep: true } ) - // Ensures filtering is cleared when returing to dashboard from registrations - onBeforeMount(() => { - clearFilters() - }) - onUpdated(() => { // needed to set overrideWidth to true if (localState.firstColRef?.value?.length > 0) { diff --git a/ppr-ui/src/interfaces/store-interfaces/state-interfaces/reg-table-data-interface.ts b/ppr-ui/src/interfaces/store-interfaces/state-interfaces/reg-table-data-interface.ts index 8e25b0f9d..0c6ff4f6e 100644 --- a/ppr-ui/src/interfaces/store-interfaces/state-interfaces/reg-table-data-interface.ts +++ b/ppr-ui/src/interfaces/store-interfaces/state-interfaces/reg-table-data-interface.ts @@ -21,6 +21,7 @@ export interface RegTableDataI { newItem: RegTableNewItemI sortHasMorePages: boolean sortOptions: RegistrationSortIF + mhSortOptions: RegistrationSortIF sortPage: number totalRowCount: number } diff --git a/ppr-ui/src/store/state/state-model.ts b/ppr-ui/src/store/state/state-model.ts index 81375a800..55f8bea47 100644 --- a/ppr-ui/src/store/state/state-model.ts +++ b/ppr-ui/src/store/state/state-model.ts @@ -116,6 +116,19 @@ export const stateModel: StateModelIF = { startDate: null, status: '' }, + mhSortOptions: { + endDate: null, + folNum: '', + orderBy: 'createDateTime', + orderVal: 'desc', + regBy: '', + regNum: '', + regParty: '', + regType: '', + secParty: '', + startDate: null, + status: '' + }, sortPage: 1, totalRowCount: 0 }, diff --git a/ppr-ui/src/store/store.ts b/ppr-ui/src/store/store.ts index f51113023..d27b8af9b 100644 --- a/ppr-ui/src/store/store.ts +++ b/ppr-ui/src/store/store.ts @@ -582,6 +582,9 @@ export const useStore = defineStore('assetsStore', () => { const getRegTableSortOptions = computed(() => { return state.value.registrationTable.sortOptions }) + const getRegTableMhSortOptions = computed(() => { + return state.value.registrationTable.mhSortOptions + }) const getRegTableSortPage = computed(() => { return state.value.registrationTable.sortPage }) @@ -957,19 +960,6 @@ export const useStore = defineStore('assetsStore', () => { prevDraft: '' } state.value.registrationTable.sortHasMorePages = true - state.value.registrationTable.sortOptions = { - endDate: null, - folNum: '', - orderBy: 'createDateTime', - orderVal: 'desc', - regBy: '', - regNum: '', - regParty: '', - regType: '', - secParty: '', - startDate: null, - status: '' - } state.value.registrationTable.sortPage = 1 state.value.registrationTable.totalRowCount = 0 } @@ -1223,8 +1213,10 @@ export const useStore = defineStore('assetsStore', () => { state.value.registrationTable.sortHasMorePages = hasMorePages } - function setRegTableSortOptions (options: RegistrationSortIF) { - state.value.registrationTable.sortOptions = options + function setRegTableSortOptions (options: RegistrationSortIF, isMhr: boolean = false) { + isMhr + ? state.value.registrationTable.mhSortOptions = options + : state.value.registrationTable.sortOptions = options } function setRegTableSortPage (page: number) { @@ -1644,6 +1636,7 @@ export const useStore = defineStore('assetsStore', () => { getRegTableDraftsChildReg, getRegTableNewItem, getRegTableSortOptions, + getRegTableMhSortOptions, getRegTableSortPage, getRegTableTotalRowCount, hasMorePages, diff --git a/ppr-ui/src/utils/mhr-api-helper.ts b/ppr-ui/src/utils/mhr-api-helper.ts index e63c62338..25501f6e4 100644 --- a/ppr-ui/src/utils/mhr-api-helper.ts +++ b/ppr-ui/src/utils/mhr-api-helper.ts @@ -325,6 +325,7 @@ export async function submitMhrRegistration (payloadData, staffPayment) { * Method to return Mhr registrations. * * @param withCollapse // Used to indicate whether api should return registrations collapsed + * @param sortOptions // Used to sort the registration results * @returns MhRegistrationSummaryIF */ export async function mhrRegistrationHistory (withCollapse: boolean = false, sortOptions: RegistrationSortIF = null) {