From ca306c76a4edd0968965829f9a5fca38ea90d012 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Fri, 6 Jan 2023 09:25:59 -0500 Subject: [PATCH] CSR-1041: update logic to fix issue --- src/mixins/vehicle-questions-mixin.js | 37 ++++++++------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index dc1cf0a71..93e57daeb 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -473,35 +473,18 @@ export default { fmgPageValues.PART_QUESTIONS ); - let currentPartsOrQuestions = null; + const allPartsOrQuestions = [ + ...(pageDataCapabilityQuestions?.partsOrQuestions || []), + ...(pageDataMoldingQuestions?.partsOrQuestions || []), + ...(pageDataVehicleParts?.partsOrQuestions || []), + ...(pageDataPartQuestions?.partsOrQuestions || []), + ]; - if ( - this.currentPageComesAfterPage(currentPage, fmgPageValues.CAPABILITY_QUESTIONS) && - !!pageDataCapabilityQuestions - ) { - currentPartsOrQuestions = pageDataCapabilityQuestions?.partsOrQuestions; - } else if ( - this.currentPageComesAfterPage(currentPage, fmgPageValues.MOLDING_QUESTIONS) && - !!pageDataMoldingQuestions - ) { - currentPartsOrQuestions = pageDataMoldingQuestions?.partsOrQuestions; - } else if ( - this.currentPageComesAfterPage(currentPage, fmgPageValues.VEHICLE_PARTS) && - !!pageDataVehicleParts - ) { - currentPartsOrQuestions = pageDataVehicleParts?.partsOrQuestions; - } else if ( - this.currentPageComesAfterPage(currentPage, fmgPageValues.PARTS_QUESTIONS) && - !!pageDataPartQuestions - ) { - currentPartsOrQuestions = pageDataPartQuestions?.partsOrQuestions; - } - - const hasPartQuestions = this.hasPartQuestions(currentPartsOrQuestions); + const hasPartQuestions = this.hasPartQuestions(allPartsOrQuestions); const hasGlassLocationWithMultipleParts = - this.hasGlassLocationWithMultipleParts(currentPartsOrQuestions); - const hasChildPartQuestions = this.hasChildPartQuestions(currentPartsOrQuestions); - const hasCapabilityQuestions = this.hasCapabilityQuestions(currentPartsOrQuestions); + this.hasGlassLocationWithMultipleParts(allPartsOrQuestions); + const hasChildPartQuestions = this.hasChildPartQuestions(allPartsOrQuestions); + const hasCapabilityQuestions = this.hasCapabilityQuestions(allPartsOrQuestions); const skipVinLookup = await store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); const vin = self.$store.getters.vehicle.vin;