From 6513b600e20bffb0d97f776455ec7c2b725ff555 Mon Sep 17 00:00:00 2001 From: Dima K Date: Fri, 7 Jun 2024 06:37:21 -0700 Subject: [PATCH 1/2] Fixes for MHR Re-Registrations --- .../mhrRegistration/YourHome/HomeSections.vue | 11 ++++++----- .../tables/mhr/HomeSectionsTable.vue | 19 ++++++++++++------- .../mhrRegistration/useMhrReRegistration.ts | 4 +++- .../mhrRegistration/useNewMhrRegistration.ts | 11 +++++++---- ppr-ui/src/views/Dashboard.vue | 2 ++ 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ppr-ui/src/components/mhrRegistration/YourHome/HomeSections.vue b/ppr-ui/src/components/mhrRegistration/YourHome/HomeSections.vue index 252f88dc8..725cd75f1 100644 --- a/ppr-ui/src/components/mhrRegistration/YourHome/HomeSections.vue +++ b/ppr-ui/src/components/mhrRegistration/YourHome/HomeSections.vue @@ -102,7 +102,8 @@ export default defineComponent({ const { // Getters getMhrHomeSections, - getMhrRegistrationValidationModel + getMhrRegistrationValidationModel, + isMhrReRegistration } = storeToRefs(useStore()) const { @@ -125,7 +126,7 @@ export default defineComponent({ return getMhrHomeSections.value.length >= 1 }), numberOfSections: computed((): number => { - return isMhrCorrection.value + return isMhrCorrection.value || isMhrReRegistration.value ? getMhrHomeSections.value.filter(section => section.action !== ActionTypes.REMOVED).length : getMhrHomeSections.value.length }), @@ -140,7 +141,7 @@ export default defineComponent({ const addHomeSection = (homeSection: HomeSectionIF): void => { const homeSections = [...getMhrHomeSections.value] - if (isMhrCorrection.value) { + if (isMhrCorrection.value || isMhrReRegistration.value) { homeSection.action = ActionTypes.ADDED } // Add new home section to array @@ -153,7 +154,7 @@ export default defineComponent({ // Create edited homeSection without id const { ...editedSection } = homeSection - if (isMhrCorrection.value) { + if (isMhrCorrection.value || isMhrReRegistration.value) { correctHomeSection(editedSection) } // Apply edited section to temp array @@ -166,7 +167,7 @@ export default defineComponent({ const homeSections = [...getMhrHomeSections.value] const homeSectionIndex = homeSections.indexOf(homeSection) - if (isMhrCorrection.value) { + if (isMhrCorrection.value || isMhrReRegistration.value) { if (homeSection.action === ActionTypes.ADDED) { // for newly Added section - remove section completely homeSections.splice(homeSectionIndex, 1) diff --git a/ppr-ui/src/components/tables/mhr/HomeSectionsTable.vue b/ppr-ui/src/components/tables/mhr/HomeSectionsTable.vue index e38fb401c..588b7c801 100644 --- a/ppr-ui/src/components/tables/mhr/HomeSectionsTable.vue +++ b/ppr-ui/src/components/tables/mhr/HomeSectionsTable.vue @@ -7,7 +7,7 @@