From 7b5b58de2db1ee2895c4a8cbdefb43de71db24ab Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Fri, 14 Jun 2024 10:28:06 -0400 Subject: [PATCH] Trim skipvin logic from estimate --- src/layouts/estimate/estimate.vue | 184 ++---------------------------- 1 file changed, 8 insertions(+), 176 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 48613b4ca..4f7c44cdd 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -11,7 +11,7 @@
-
+
- -
-
- - - - - - - - - - - - -
+
@@ -94,9 +43,6 @@ import navbar from "@/fmg-components/nav-bar/nav-bar"; import vehicleBanner from "@/fmg-components/vehicle-banner/vehicle-banner"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; import buttonQuestion from "@/digital-components/button-question/button-question"; -import alert from "@/ux-components/alert/alert"; -import textboxQuestion from "@/digital-components/textbox-question/textbox-question"; -import textBlock from "@/digital-components/text-block/text-block"; import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue"; //Supporting Files @@ -137,10 +83,6 @@ export default { data() { return { selectedVinLookupMethod: null, - serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, - emailAddress: this.getEmailFromStore(), - displayInvalidZipAlert: false, - displayNonServiceableZipAlert: false, skipVin: false, skipVinNotRepair: false, }; @@ -185,22 +127,12 @@ export default { ]; const resultMap = await settleAllPromises(promiseResultMap); - const skipVin = await skipVinLookup(); - const skipVinNotRepair = await skipVinLookupNotRepair(); next((vm) => { - vm.skipVin = skipVin; - vm.skipVinNotRepair = skipVinNotRepair; if (resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.includes("|")) { const forwardTextOption = resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.split("|"); - if (skipVin) { - resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = - forwardTextOption[1]; - } else { - resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = - forwardTextOption[0]; - } + resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0]; } if (!zip || resultMap.vinByAddress === false) { @@ -216,12 +148,6 @@ export default { }); }, methods: { - getZipFromStore() { - return store.getters.order.serviceLocation.zipCode; - }, - getEmailFromStore() { - return store.getters.order.customer.emailAddress; - }, arePagePrerequisitesValid() { return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0; }, @@ -230,80 +156,6 @@ export default { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, async forwardButtonAction() { - if (this.skipVin) { - const zipCodeData = await this.getZipCodeData(this.serviceZipCode); - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false); - await this.dispatchStoreAction( - storeActions.SAVE_SERVICE_ZIP_CODE_INFO, - { - zipCode: this.serviceZipCode, - state: zipCodeData.state, - zipCodeCtu: zipCodeData.zipCodeCtu, - }, - false - ); - - if (!zipCodeData.isValid) { - this.displayInvalidZipAlert = true; - return this.$refs.navbar.removeLoader(); - } - this.displayInvalidZipAlert = false; - - if (!zipCodeData.isServiceable) { - this.displayNonServiceableZipAlert = true; - return this.$refs.navbar.removeLoader(); - } - this.displayNonServiceableZipAlert = false; - - const payment = this.$store.getters.payment; - const policy = this.$store.getters.policy; - - const vehicleChangedDuringPolicyLookupInHeritage = - payment.isInsurance && - payment.insuranceCoverage.coverageStatus && - policy.policyNumber !== ""; - - if (vehicleChangedDuringPolicyLookupInHeritage) { - navigateToHeritageFunnel({ - shouldSaveSession: true, - pageNameToLog: "estimate", - }); - } else if (this.$store.getters.order.referralNumber?.length === 6) { - await this.navigateForwardWithSingleCarMatch(); - } else if (this.isRepair) { - const supportingItemsPromise = await this.dispatchStoreActionWithLogging( - storeActions.GET_SUPPORTING_ITEMS, - null, - "estimate" - ); - - const promiseResultMap = [ - { - resultKey: "supportingItems", - promise: supportingItemsPromise, - }, - ]; - - const resultMap = await settleAllPromises(promiseResultMap); - - this.dispatchStoreAction( - this.storeActions.SAVE_SUPPORTING_ITEMS, - resultMap.supportingItems, - false - ); - - // call saveSession here - navigateWithSaving saves too late in the flow - await saveSession({ pageNameToLog: "estimate" }); - return this.$router.navigateWithSaving( - this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, - this.$route - ); - } else { - // if we're skipping the vin-lookup but it's not a repair, we still need to get the parts - await this.navigateForwardWithSingleCarMatch(); - } - } - if (this.selectedVinLookupMethod === vinLookupMethodSelections.MANUALVIN) { await this.dispatchStoreAction(storeActions.CLEAR_VIN); return this.$router.navigateWithSaving( @@ -332,15 +184,6 @@ export default { }, }, computed: { - AlertNonServiceableZipHeader() { - return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll( - "{custom:serviceZip}", - this.serviceZipCode - ); - }, - AlertNonServiceableZipBody() { - return this.getCmsContent("AlertNonServiceableZipWidget", "BodyText"); - }, questionText() { return this.getCmsContent("VinLookupMethod", "QuestionText"); }, @@ -350,18 +193,10 @@ export default { isRepair() { return store.getters.damage.isRepair; }, - alertInfo() { - return this.skipVinNotRepair ? "AlertQuoteVinOptional" : "AlertQuoteReady"; - }, VinLookupQuestionText() { return this.getCmsContent("VinLookupQuestion", "BodyText"); }, }, - watch: { - serviceZipCode() { - this.displayNonServiceableZipAlert = false; - }, - }, components: { funnelHeader, vehicleBanner, @@ -369,9 +204,6 @@ export default { navbar, buttonQuestion, Form, - alert, - textboxQuestion, - textBlock, loadingModal, }, };