From c14f37f5d0fb3dff55dc57cc81e02a17df855cfe Mon Sep 17 00:00:00 2001 From: Dima K Date: Thu, 30 May 2024 12:23:37 -0700 Subject: [PATCH 1/7] Setup Mhr Re-Registrations --- .../mhrInformation/useMhrInformation.ts | 1 + .../src/composables/mhrRegistration/index.ts | 1 + .../mhrRegistration/useMhrCorrections.ts | 16 +++--- .../mhrRegistration/useMhrReRegistration.ts | 56 +++++++++++++++++++ ppr-ui/src/enums/registrationTypes.ts | 6 +- .../MhrRegistrationHomeLocationIF.ts | 2 +- ppr-ui/src/resources/registrationTypes.ts | 11 ++++ ppr-ui/src/store/store.ts | 16 +++++- 8 files changed, 97 insertions(+), 12 deletions(-) create mode 100644 ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts diff --git a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts index fbb52efb7..faae3178a 100644 --- a/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts +++ b/ppr-ui/src/composables/mhrInformation/useMhrInformation.ts @@ -541,6 +541,7 @@ export const useMhrInformation = () => { initDraftMhrInformation, parseSubmittingPartyInfo, getLienInfo, + parseMhrPermitData, ...toRefs(localState) } } diff --git a/ppr-ui/src/composables/mhrRegistration/index.ts b/ppr-ui/src/composables/mhrRegistration/index.ts index 80cd62d4c..e6fbff0a0 100644 --- a/ppr-ui/src/composables/mhrRegistration/index.ts +++ b/ppr-ui/src/composables/mhrRegistration/index.ts @@ -2,3 +2,4 @@ export { useHomeOwners } from './useHomeOwners' export { useMhrValidations } from './useMhrValidations' export { useNewMhrRegistration } from './useNewMhrRegistration' export { useMhrCorrections } from './useMhrCorrections' +export { useMhrReRegistration } from './useMhrReRegistration' diff --git a/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts b/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts index ad737259d..2e676ce80 100755 --- a/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts +++ b/ppr-ui/src/composables/mhrRegistration/useMhrCorrections.ts @@ -48,7 +48,6 @@ export const useMhrCorrections = () => { } = storeToRefs(useStore()) const { containsCurrentRoute, goToRoute } = useNavigation() - // const { initDraftOrCurrentMhr } = useNewMhrRegistration(true) /** Returns true for staff when the feature flag is enabled **/ const isMhrChangesEnabled: ComputedRef = computed((): boolean => { @@ -81,13 +80,13 @@ export const useMhrCorrections = () => { /** Returns true when the set registration type is a REGC_CLIENT and current route is a Registration Route **/ const isClientCorrection: ComputedRef = computed((): boolean => { - return isRegistrationRoute.value && + return isRegistrationRoute.value && getRegistrationType.value?.registrationTypeAPI === APIRegistrationTypes.MHR_CORRECTION_CLIENT }) /** Returns true when the set registration type is a PUBA and current route is a Registration Route **/ const isPublicAmendment: ComputedRef = computed((): boolean => { - return isRegistrationRoute.value && + return isRegistrationRoute.value && getRegistrationType.value?.registrationTypeAPI === APIRegistrationTypes.MHR_PUBLIC_AMENDMENT }) @@ -327,6 +326,7 @@ export const useMhrCorrections = () => { * @returns {AdminRegistrationIF} - The correction payload for the Admin Registration. */ const buildCorrectionPayload = (mhrState: NewMhrRegistrationApiIF): AdminRegistrationIF => { + const correctionsList = getCorrectionsList() return { attentionReference: mhrState.attentionReference || '', documentId: mhrState.documentId, @@ -335,10 +335,10 @@ export const useMhrCorrections = () => { draftNumber: mhrState.draftNumber }), submittingParty: mhrState.submittingParty, - ...(getCorrectionsList().includes('status') && { + ...(correctionsList.includes('status') && { status: getMhrStatusType.value }), - ...(getCorrectionsList().some(value => descriptionGroup.includes(value)) && { + ...(correctionsList.some(value => descriptionGroup.includes(value)) && { description: { ...mhrState.description, baseInformation: { @@ -347,7 +347,7 @@ export const useMhrCorrections = () => { } } }), - ...(getCorrectionsList().includes('ownerGroups') && { + ...(correctionsList.includes('ownerGroups') && { addOwnerGroups: mhrState.ownerGroups .filter(group => group.action !== ActionTypes.REMOVED) .map(group => ({ @@ -356,10 +356,10 @@ export const useMhrCorrections = () => { })), deleteOwnerGroups: getMhrBaseline.value.ownerGroups }), - ...(getCorrectionsList().some(value => locationGroup.includes(value)) && { + ...(correctionsList.some(value => locationGroup.includes(value)) && { location: { ...mhrState.location, taxCertificate: false } }), - ...(getCorrectionsList().includes('landDetails') && { + ...(correctionsList.includes('landDetails') && { ownLand: mhrState.ownLand }) } diff --git a/ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts b/ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts new file mode 100644 index 000000000..64753f42a --- /dev/null +++ b/ppr-ui/src/composables/mhrRegistration/useMhrReRegistration.ts @@ -0,0 +1,56 @@ +import { HomeCertificationOptions } from '@/enums' +import { MhRegistrationSummaryIF } from '@/interfaces' +import { MhrReRegistrationType } from '@/resources' +import { useStore } from '@/store/store' +import { fetchMhRegistration } from '@/utils' +import { useNewMhrRegistration } from './useNewMhrRegistration' +import { cloneDeep } from 'lodash' +import { useMhrInformation } from '../mhrInformation' + +export const useMhrReRegistration = () => { + const { + setMhrBaseline, + setRegistrationType + } = useStore() + + const { setMhrNumber, setMhrStatusType } = useStore() + const { parseMhrPermitData } = useMhrInformation() + + const initMhrReRegistration = async (mhrSummary: MhRegistrationSummaryIF): Promise => { + setMhrNumber(mhrSummary.mhrNumber) + setRegistrationType(MhrReRegistrationType) + setMhrStatusType(mhrSummary.statusType) + + const { data } = await fetchMhRegistration(mhrSummary.mhrNumber) + + // Handle 'certificationOption' or 'noCertification' value mapping (because it's not returned in response) + const certificationOption = + (data?.description?.csaNumber && HomeCertificationOptions.CSA) || + (data?.description?.engineerName && HomeCertificationOptions.ENGINEER_INSPECTION) || + null + + // remove props that should not be pre-populated into Re-Registration + data.documentId = '' + data.ownerGroups = [] + + // parse Transport Permit data to correctly show Location of Home step + parseMhrPermitData(data) + + // Preserve MHR snapshot + await setMhrBaseline( + cloneDeep({ + ...data, + description: { + ...data.description, + certificationOption: certificationOption, + hasNoCertification: certificationOption === null + } + }) + ) + await useNewMhrRegistration().initDraftOrCurrentMhr(data, false) + } + + return { + initMhrReRegistration + } +} diff --git a/ppr-ui/src/enums/registrationTypes.ts b/ppr-ui/src/enums/registrationTypes.ts index 9eb1c18e0..d1339be37 100644 --- a/ppr-ui/src/enums/registrationTypes.ts +++ b/ppr-ui/src/enums/registrationTypes.ts @@ -57,6 +57,7 @@ export enum APIRegistrationTypes { MHR_CORRECTION_STAFF = 'REGC_STAFF', MHR_CORRECTION_CLIENT = 'REGC_CLIENT', MHR_PUBLIC_AMENDMENT = 'PUBA', + MHR_RE_REGISTRATION = 'EXRE' } export enum UIRegistrationTypes { @@ -115,7 +116,10 @@ export enum UIRegistrationTypes { TRANSFER_DUE_TO_DEATH = 'Sale or Gift due to death', NON_RESIDENTIAL_EXEMPTION = 'Non-Residential Exemption', RESIDENTIAL_EXEMPTION = 'Residential Exemption', - TRANSPORT_PERMIT = 'Transport Permit' + TRANSPORT_PERMIT = 'Transport Permit', + + // MHR Re-registration + MANUFACTURED_HOME_RE_REGISTRATION = 'Re-Register Manufactured Home' } export enum StatementTypes { diff --git a/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts b/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts index aa7dd60a3..7e98d9344 100644 --- a/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts +++ b/ppr-ui/src/interfaces/mhr-registration-interfaces/MhrRegistrationHomeLocationIF.ts @@ -3,7 +3,7 @@ import { HomeLocationTypes } from '@/enums' export interface MhrRegistrationHomeLocationIF extends MhrRegistrationHomeLocationWithoutAddressIF { address: { street: string - streetAdditional: string + streetAdditional?: string city: string region: string country: string diff --git a/ppr-ui/src/resources/registrationTypes.ts b/ppr-ui/src/resources/registrationTypes.ts index f25bfb1eb..0ab618ec0 100644 --- a/ppr-ui/src/resources/registrationTypes.ts +++ b/ppr-ui/src/resources/registrationTypes.ts @@ -331,6 +331,17 @@ export const MhrRegistrationType: RegistrationTypeIF = { `${UIRegistrationTypes.MANUFACTURED_HOME_REGISTRATION} (${APIRegistrationTypes.MANUFACTURED_HOME_REGISTRATION})` } +export const MhrReRegistrationType: RegistrationTypeIF = { + class: 'registration-list-item', + disabled: false, + divider: false, + group: 3, + registrationTypeUI: UIRegistrationTypes.MANUFACTURED_HOME_RE_REGISTRATION, + registrationTypeAPI: APIRegistrationTypes.MHR_RE_REGISTRATION, + text: + `${UIRegistrationTypes.MANUFACTURED_HOME_RE_REGISTRATION} (${APIRegistrationTypes.MHR_RE_REGISTRATION})` +} + export const MhrCorrectionStaff: RegistrationTypeIF = { class: 'registration-list-item', disabled: false, diff --git a/ppr-ui/src/store/store.ts b/ppr-ui/src/store/store.ts index e741f3d84..39f2899ac 100644 --- a/ppr-ui/src/store/store.ts +++ b/ppr-ui/src/store/store.ts @@ -237,6 +237,10 @@ export const useStore = defineStore('assetsStore', () => { APIRegistrationTypes.MHR_PUBLIC_AMENDMENT ].includes(state.value.registration?.registrationType?.registrationTypeAPI) }) + const isMhrReRegistration = computed(() => { + return isRoleStaffReg.value && + state.value.registration?.registrationType?.registrationTypeAPI === APIRegistrationTypes.MHR_RE_REGISTRATION + }) const isMhrStaffRegistration = computed(() => { return isMhrRegistration.value && isRoleStaff.value }) @@ -257,7 +261,7 @@ export const useStore = defineStore('assetsStore', () => { useMhrValidations(modelRef).getStepValidation(MhrSectVal.SUBMITTING_PARTY_VALID) && useMhrValidations(modelRef).getStepValidation(MhrSectVal.HOME_OWNERS_VALID) && useMhrValidations(modelRef).getStepValidation(MhrSectVal.LOCATION_VALID) && - useMhrCorrections().hasMadeMhrCorrections.value + (isMhrReRegistration.value ? true : useMhrCorrections().hasMadeMhrCorrections.value) }) const isMhrManufacturerRegistrationReviewValid = computed(() => { const modelRef = toRefs(getMhrRegistrationValidationModel.value) @@ -538,7 +542,9 @@ export const useStore = defineStore('assetsStore', () => { return isMhrManufacturerRegistration.value ? getMhrManufacturerSteps.value : getMhrStaffSteps.value }) const getFooterButtonConfig = computed(() => { - return isMhrRegistration.value ? getMhrButtonFooterConfig.value : RegistrationButtonFooterConfig + return isMhrRegistration.value || isMhrReRegistration.value + ? getMhrButtonFooterConfig.value + : RegistrationButtonFooterConfig }) const getMhrButtonFooterConfig = computed(() => { return isMhrManufacturerRegistration.value @@ -1266,6 +1272,10 @@ export const useStore = defineStore('assetsStore', () => { } // MHR Information + function setMhrNumber (mhrNumber: string) { + state.value.mhrInformation.mhrNumber = mhrNumber + } + function setMhrInformation (mhrInfo: MhRegistrationSummaryIF) { state.value.mhrInformation = mhrInfo } @@ -1529,6 +1539,7 @@ export const useStore = defineStore('assetsStore', () => { getRegistrationNumber, getRegistrationType, isMhrRegistration, + isMhrReRegistration, isMhrStaffRegistration, isMhrManufacturerRegistration, isMhrRegistrationReviewValid, @@ -1745,6 +1756,7 @@ export const useStore = defineStore('assetsStore', () => { setMhrRegistrationOwnLand, // MHR Information + setMhrNumber, setMhrInformation, setMhrInformationDraftId, setMhrStatusType, From 09aa2db2f67cb1287f2494f9aed02b9763c83309 Mon Sep 17 00:00:00 2001 From: Dima K Date: Thu, 30 May 2024 12:28:07 -0700 Subject: [PATCH 2/7] Mhr Re-Registrations Stepper components, updated badges --- .../common/RegistrationsWrapper.vue | 19 +++++++++++++- .../ReviewConfirm/HomeLocationReview.vue | 11 +++++--- .../ReviewConfirm/YourHomeReview.vue | 25 ++++++++++--------- .../YourHome/HomeCertification.vue | 10 +++++--- .../YourHome/ManufacturedYearInput.vue | 9 ++++--- .../YourHome/ManufacturerMakeModel.vue | 13 +++++----- .../YourHome/OtherInformation.vue | 10 +++++--- .../YourHome/RebuiltStatus.vue | 10 +++++--- .../src/components/tables/common/TableRow.vue | 13 ++++++---- ppr-ui/src/composables/index.ts | 1 + ppr-ui/src/composables/useUpdatedBadges.ts | 17 +++++++++++++ .../views/newMhrRegistration/HomeLocation.vue | 10 +++++--- .../newMhrRegistration/MhrRegistration.vue | 24 ++++++++++++++++-- .../newMhrRegistration/MhrReviewConfirm.vue | 2 +- 14 files changed, 123 insertions(+), 51 deletions(-) create mode 100644 ppr-ui/src/composables/useUpdatedBadges.ts diff --git a/ppr-ui/src/components/common/RegistrationsWrapper.vue b/ppr-ui/src/components/common/RegistrationsWrapper.vue index 92a2e9595..ed5e8c204 100644 --- a/ppr-ui/src/components/common/RegistrationsWrapper.vue +++ b/ppr-ui/src/components/common/RegistrationsWrapper.vue @@ -281,7 +281,13 @@ import { } from '@/resources/dialogOptions' import { StatusCodes } from 'http-status-codes' import { cloneDeep } from 'lodash' -import { useExemptions, useMhrCorrections, useNavigation, useNewMhrRegistration } from '@/composables' +import { + useExemptions, + useMhrCorrections, + useNavigation, + useNewMhrRegistration, + useMhrReRegistration +} from '@/composables' export default defineComponent({ name: 'RegistrationsWrapper', @@ -342,6 +348,8 @@ export default defineComponent({ const { goToExemptions } = useExemptions() + const { initMhrReRegistration } = useMhrReRegistration() + const localState = reactive({ loading: false, myRegAdd: '', @@ -721,6 +729,9 @@ export default defineComponent({ case UnitNoteDocTypes.NON_RESIDENTIAL_EXEMPTION: openMhrExemption(mhrInfo, action) break + case UnitNoteDocTypes.RESCIND_EXEMPTION: + openMhrReRegistration(mhrInfo) + break default: localState.myRegAction = null localState.myRegActionDocId = '' @@ -778,6 +789,12 @@ export default defineComponent({ await goToExemptions(type) } + const openMhrReRegistration = async (mhrSummary: MhRegistrationSummaryIF): Promise => { + localState.loading = true + await initMhrReRegistration(mhrSummary) + await goToRoute(RouteNames.SUBMITTING_PARTY) + } + const removeMhrDraft = async (mhrNumber: string): Promise => { localState.myRegDataLoading = true await deleteMhrDraft(mhrNumber) diff --git a/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue b/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue index aa7b04685..3c9aa2492 100644 --- a/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue +++ b/ppr-ui/src/components/mhrRegistration/ReviewConfirm/HomeLocationReview.vue @@ -422,7 +422,7 @@ >

Civic Address

Manufacturer's Name

Year of Manufacture

Make

Model

Home Certification

CSA Standard

Date of Engineer's Report

Rebuilt Status

Other Information

{ @@ -374,7 +375,7 @@ export default defineComponent({ formatAsHtml, RouteNames, correctionState, - isMhrCorrection, + showUpdatedBadge, getMhrRegistrationOtherInfo, getMhrRegistrationHomeDescription, isMhrManufacturerRegistration, diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue b/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue index a0e5fd87b..476647125 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/HomeCertification.vue @@ -16,7 +16,7 @@ :class="{ 'error-text': validate }" >Certification string|boolean> => customRules( @@ -143,7 +144,7 @@ export default defineComponent({ hasError, yearRef, manufactureYearRules, - isMhrCorrection, + showUpdatedBadge, correctionState, getMhrBaseline, getMhrRegistration, diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue b/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue index d32f19921..2fcd6b5f1 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/ManufacturerMakeModel.vue @@ -18,7 +18,7 @@ Manufacturer's Name Make Model string|boolean> => { return [ @@ -235,7 +236,7 @@ export default defineComponent({ maxLength, greaterThan, isMhrManufacturerRegistration, - isMhrCorrection, + showUpdatedBadge, correctionState, ...toRefs(localState) } diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue b/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue index 34e4f18f9..f1e4b6a12 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/OtherInformation.vue @@ -16,7 +16,7 @@ :class="{'error-text': validate}" >Other import { defineComponent, reactive, ref, toRefs, watch } from 'vue' import { useStore } from '@/store/store' -import { useInputRules, useMhrCorrections, useMhrValidations } from '@/composables/' +import { useInputRules, useMhrCorrections, useMhrValidations, useUpdatedBadges } from '@/composables/' import { storeToRefs } from 'pinia' import { FormIF } from '@/interfaces' import { UpdatedBadge } from '@/components/common' @@ -70,7 +70,9 @@ export default defineComponent({ MhrSectVal, setValidation } = useMhrValidations(toRefs(getMhrRegistrationValidationModel.value)) - const { correctionState, isMhrCorrection } = useMhrCorrections() + const { correctionState } = useMhrCorrections() + const { showUpdatedBadge } = useUpdatedBadges() + const otherInformationForm = ref(null) as FormIF const localState = reactive({ @@ -93,7 +95,7 @@ export default defineComponent({ return { maxLength, correctionState, - isMhrCorrection, + showUpdatedBadge, ...toRefs(localState) } } diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue b/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue index 49aa0a5b2..8a2639276 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/RebuiltStatus.vue @@ -21,7 +21,7 @@ Rebuilt Description import { defineComponent, reactive, ref, toRefs, watch } from 'vue' import { useStore } from '@/store/store' -import { useInputRules, useMhrCorrections, useMhrValidations } from '@/composables/' +import { useInputRules, useMhrCorrections, useMhrValidations, useUpdatedBadges } from '@/composables/' import { storeToRefs } from 'pinia' import { FormIF } from '@/interfaces' import { UpdatedBadge } from '@/components/common' @@ -72,7 +72,9 @@ export default defineComponent({ MhrSectVal, setValidation } = useMhrValidations(toRefs(getMhrRegistrationValidationModel.value)) - const { correctionState, isMhrCorrection } = useMhrCorrections() + const { correctionState } = useMhrCorrections() + const { showUpdatedBadge } = useUpdatedBadges() + const rebuiltStatus = ref(null) as FormIF const localState = reactive({ @@ -96,7 +98,7 @@ export default defineComponent({ maxLength, rebuiltStatus, correctionState, - isMhrCorrection, + showUpdatedBadge, ...toRefs(localState) } } }) diff --git a/ppr-ui/src/components/tables/common/TableRow.vue b/ppr-ui/src/components/tables/common/TableRow.vue index 71fa05b67..fbe774565 100644 --- a/ppr-ui/src/components/tables/common/TableRow.vue +++ b/ppr-ui/src/components/tables/common/TableRow.vue @@ -495,7 +495,7 @@ v-if="isRoleStaffReg && isExemptionEnabled && hasChildResExemption(item) && ![HomeLocationTypes.HOME_PARK, HomeLocationTypes.LOT].includes(item.locationType)" data-test-id="rescind-exemption-btn" - :disabled="true" + :disabled="!isExemptOrCancelled(item.statusType)" @click="openExemption(UnitNoteDocTypes.RESCIND_EXEMPTION, item)" > @@ -504,7 +504,7 @@ class="ml-0 icon-small" src="@/assets/svgs/ic_exemption2.svg" > - Re-Register Home + Re-Register Manufactured Home { + const openExemption = (docType: UnitNoteDocTypes, item: MhRegistrationSummaryIF): void => { emit('action', { - action: doctType, + action: docType, mhrInfo: item }) } @@ -997,6 +997,9 @@ export default defineComponent({ return item.registrationType === APIRegistrationTypes.REPAIRERS_LIEN } + const isExemptOrCancelled = (statusType: MhApiStatusTypes): boolean => + [MhApiStatusTypes.EXEMPT, MhApiStatusTypes.CANCELLED].includes(statusType) + const refresh = async (item: RegistrationSummaryIF): Promise => { // could be base reg or child reg if (item.registeringName) { @@ -1128,7 +1131,6 @@ export default defineComponent({ hasRequiredTransfer, multipleWordsToTitleCase, freezeScrolling, - MhApiStatusTypes, APIMhrDescriptionTypes, getFormattedDate, getRegistrationType, @@ -1147,6 +1149,7 @@ export default defineComponent({ isDraft, isExpired, isRepairersLien, + isExemptOrCancelled, isRenewalDisabled, isRepairersLienAmendDisabled, isRoleStaffReg, diff --git a/ppr-ui/src/composables/index.ts b/ppr-ui/src/composables/index.ts index c6bf432bd..a37ca400d 100644 --- a/ppr-ui/src/composables/index.ts +++ b/ppr-ui/src/composables/index.ts @@ -6,3 +6,4 @@ export * from './useTableFeatures' export * from './userAccess' export * from './exemption' export * from './common' +export * from './useUpdatedBadges' diff --git a/ppr-ui/src/composables/useUpdatedBadges.ts b/ppr-ui/src/composables/useUpdatedBadges.ts new file mode 100644 index 000000000..eae987085 --- /dev/null +++ b/ppr-ui/src/composables/useUpdatedBadges.ts @@ -0,0 +1,17 @@ +import { ComputedRef, computed } from 'vue' +import { useMhrCorrections } from './mhrRegistration' +import { useStore } from '@/store/store' +import { storeToRefs } from 'pinia' + +export const useUpdatedBadges = () => { + + const { isMhrReRegistration } = storeToRefs(useStore()) + const { isMhrCorrection } = useMhrCorrections() + + const showUpdatedBadge: ComputedRef = computed((): boolean => + isMhrCorrection.value || isMhrReRegistration.value) + + return { + showUpdatedBadge + } +} diff --git a/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue b/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue index f03353cc6..07e4508ef 100644 --- a/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue +++ b/ppr-ui/src/views/newMhrRegistration/HomeLocation.vue @@ -3,8 +3,8 @@ id="mhr-home-location" class="increment-sections" > - -