From 0043f57a9eddee7f396682e1e5d48a86140821c8 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 29 Nov 2022 09:31:27 -0500 Subject: [PATCH] CSR-944 --- .../heritage-integration/navigation-helper.js | 8 ++++---- src/layouts/estimate/estimate.vue | 12 ++++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 5d02f5dc6..02e834cac 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -76,10 +76,10 @@ async function getLatestPageForRedirection() { const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); const promiseResultMap = [ - { - resultKey: "vinOptionalOptions", - promise: vinOptionalVehiclePromise, - }, + { + resultKey: "vinOptionalOptions", + promise: vinOptionalVehiclePromise, + }, ]; const resultMap = await settleAllPromises(promiseResultMap); diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 058077d39..92913e75a 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -132,19 +132,27 @@ export default { async beforeRouteEnter(to, from, next) { //Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); + const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); + //Settle promises and get results const promiseResultMap = [ { resultKey: "cmsContent", promise: cmsContentPromise, }, + { + resultKey: "vinOptionalOptions", + promise: vinOptionalVehiclePromise, + }, ]; + const resultMap = await settleAllPromises(promiseResultMap); next((vm) => { + vm.isVinOptionalVehicle = resultMap.vinOptionalOptions; if (resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.includes("|")) { const forwardTextOption = resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.split("|"); - if (store.getters.damage.isRepair) { + if (store.getters.damage.isRepair || vm.isVinOptionalVehicle) { resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[1]; } else { @@ -173,7 +181,7 @@ export default { async forwardButtonAction() { if (this.skipVinLookup) { const zipCodeData = await this.getZipCodeData(this.serviceZipCode); - //todo: validation + await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false); await this.dispatchStoreAction( storeActions.SAVE_SERVICE_LOCATION,