From 7b01c1203c7672dc1c01b18f35d248cf37c0d7f7 Mon Sep 17 00:00:00 2001 From: Dima K Date: Thu, 16 May 2024 06:09:07 -0700 Subject: [PATCH] Draft Corrections Fixes after QA (#1876) * Fixes for Draft Corrections after QA * Fix Public Amend Draft loading --- ppr-ui/package-lock.json | 4 ++-- ppr-ui/package.json | 2 +- ppr-ui/src/components/common/ButtonFooter.vue | 1 + .../mhrRegistration/useMhrCorrections.ts | 22 +++++++++++-------- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ppr-ui/package-lock.json b/ppr-ui/package-lock.json index 800fe104f..41d12821d 100644 --- a/ppr-ui/package-lock.json +++ b/ppr-ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "ppr-ui", - "version": "3.1.23", + "version": "3.1.24", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ppr-ui", - "version": "3.1.23", + "version": "3.1.24", "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 f55959fa4..7b41fa8cf 100644 --- a/ppr-ui/package.json +++ b/ppr-ui/package.json @@ -1,6 +1,6 @@ { "name": "ppr-ui", - "version": "3.1.23", + "version": "3.1.24", "private": true, "appName": "Assets UI", "sbcName": "SBC Common Components", diff --git a/ppr-ui/src/components/common/ButtonFooter.vue b/ppr-ui/src/components/common/ButtonFooter.vue index 3ed15a063..d31178369 100644 --- a/ppr-ui/src/components/common/ButtonFooter.vue +++ b/ppr-ui/src/components/common/ButtonFooter.vue @@ -258,6 +258,7 @@ export default defineComponent({ prevDraft: prevDraftId } await setRegTableNewItem(newItem) + localState.submitting = false return true } } diff --git a/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts b/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts index a66f57382..2dbbd9d91 100755 --- a/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts +++ b/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts @@ -14,19 +14,21 @@ import { useNavigation, useNewMhrRegistration } from '@/composables' import { AdminRegistrationIF, HomeSectionIF, + MhRegistrationSummaryIF, NewMhrRegistrationApiIF, RegistrationTypeIF, UpdatedBadgeIF } from '@/interfaces' import { cloneDeep, omit } from 'lodash' -import { MhrCorrectionClient, MhrCorrectionStaff } from '@/resources/registrationTypes' +import { MhrCorrectionClient, MhrCorrectionStaff, MhrPublicAmendment } from '@/resources/registrationTypes' export const useMhrCorrections = () => { const { setMhrBaseline, setRegistrationType, setMhrDraftNumber, - setMhrStatusType + setMhrStatusType, + setMhrInformation } = useStore() const { getMhrStatusType, @@ -122,7 +124,7 @@ export const useMhrCorrections = () => { }, currentState: { year: getMhrRegistration.value.description.baseInformation.year, - circa: getMhrRegistration.value.description.baseInformation.circa + circa: getMhrRegistration.value.description.baseInformation.circa || false } })), make: computed((): UpdatedBadgeIF => ({ @@ -179,8 +181,9 @@ export const useMhrCorrections = () => { })), civicAddress: computed((): UpdatedBadgeIF => ({ action: isPublicAmendment.value ? ActionTypes.EDITED : ActionTypes.CORRECTED, - baseline: getMhrBaseline.value?.location.address, - currentState: getMhrRegistrationLocation.value.address + // postal code is not displayed in UI and causing the corrections badge to show up + baseline: omit(getMhrBaseline.value?.location.address, 'postalCode'), + currentState: omit(getMhrRegistrationLocation.value.address, 'postalCode') })), landDetails: computed((): UpdatedBadgeIF => ({ action: isPublicAmendment.value ? ActionTypes.EDITED : ActionTypes.CORRECTED, @@ -243,16 +246,17 @@ export const useMhrCorrections = () => { await goToRoute(RouteNames.SUBMITTING_PARTY) } - const initDraftMhrCorrection = async (draftMhrCorrection): Promise => { + const initDraftMhrCorrection = async (mhrInfo: MhRegistrationSummaryIF): Promise => { - const draftNumber = draftMhrCorrection.draftNumber + const draftNumber = mhrInfo.draftNumber + await setMhrInformation(mhrInfo) // Fetch draft MHR Data const { registration } = await getMhrDraft(draftNumber) // Fetch original MHR Data (before the draft correction updates) - const { data } = await fetchMhRegistration(draftMhrCorrection.mhrNumber) + const { data } = await fetchMhRegistration(mhrInfo.mhrNumber) - const correctionType: RegistrationTypeIF = [MhrCorrectionStaff, MhrCorrectionClient] + const correctionType: RegistrationTypeIF = [MhrCorrectionStaff, MhrCorrectionClient, MhrPublicAmendment] .find((corr: RegistrationTypeIF) => corr.registrationTypeAPI === registration.documentType) setRegistrationType(correctionType)