Trim skipvin logic from estimate
This commit is contained in:
parent
3711094141
commit
7b5b58de2d
1 changed files with 8 additions and 176 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
<div class="col-md-6 col-xl-4">
|
<div class="col-md-6 col-xl-4">
|
||||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" />
|
<vehicleBanner cmsWidgetName="VehicleBannerWidget" />
|
||||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
<div v-if="!skipVin">
|
<div>
|
||||||
<div class="vinlookupquestion" v-html="this.VinLookupQuestionText"></div>
|
<div class="vinlookupquestion" v-html="this.VinLookupQuestionText"></div>
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
cmsWidgetName="VinLookupMethod"
|
cmsWidgetName="VinLookupMethod"
|
||||||
|
|
@ -22,65 +22,14 @@
|
||||||
isRequired
|
isRequired
|
||||||
validationRules="option-required"
|
validationRules="option-required"
|
||||||
:logDisplayedValuesEvent="true" />
|
:logDisplayedValuesEvent="true" />
|
||||||
|
|
||||||
<navbar
|
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
|
||||||
ref="navbar"
|
|
||||||
:isForwardActionDisabled="!meta.valid"
|
|
||||||
@back-clicked="backButtonAction"
|
|
||||||
@ForwardClicked="forwardButtonAction" />
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else>
|
<navbar
|
||||||
<alert
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
class="mt-4 mb-4"
|
ref="navbar"
|
||||||
:cmsWidgetName="alertInfo"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
alertClass="alert-info"
|
@back-clicked="backButtonAction"
|
||||||
v-bind:isDismissible="false" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
|
|
||||||
<textboxQuestion
|
|
||||||
class="mb-4"
|
|
||||||
cmsWidgetName="ServiceZipQuestionWidget"
|
|
||||||
v-model="serviceZipCode"
|
|
||||||
inputId="serviceZipCode"
|
|
||||||
mask="#####"
|
|
||||||
isRequired
|
|
||||||
validationRules="zip-required|zip-format" />
|
|
||||||
|
|
||||||
<textboxQuestion
|
|
||||||
class="mb-0"
|
|
||||||
cmsWidgetName="EmailAddressQuestionWidget"
|
|
||||||
v-model="emailAddress"
|
|
||||||
inputId="emailAddress"
|
|
||||||
:isRequired="!IsEmailOptional"
|
|
||||||
disableAutoFill
|
|
||||||
:validationRules="EmailValidationRules"
|
|
||||||
:addOptionalText="IsEmailOptional" />
|
|
||||||
<textBlock cmsWidgetName="QuoteEmailTextBlockWidget" typeStyle="caption" />
|
|
||||||
|
|
||||||
<alert
|
|
||||||
ref="alertInvalidZip"
|
|
||||||
v-if="displayInvalidZipAlert"
|
|
||||||
class="my-4"
|
|
||||||
cmsWidgetName="AlertInvalidZipWidget"
|
|
||||||
alertClass="alert-danger"
|
|
||||||
v-bind:isDismissible="false" />
|
|
||||||
|
|
||||||
<alert
|
|
||||||
class="my-4"
|
|
||||||
:manualHeadline="AlertNonServiceableZipHeader"
|
|
||||||
:manualCopy="AlertNonServiceableZipBody"
|
|
||||||
v-model="customAlertData"
|
|
||||||
v-if="displayNonServiceableZipAlert"
|
|
||||||
alertClass="alert-danger" />
|
|
||||||
|
|
||||||
<navbar
|
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
|
||||||
ref="navbar"
|
|
||||||
:isForwardActionDisabled="!meta.valid"
|
|
||||||
@back-clicked="backButtonAction"
|
|
||||||
@ForwardClicked="forwardButtonAction" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -94,9 +43,6 @@ import navbar from "@/fmg-components/nav-bar/nav-bar";
|
||||||
import vehicleBanner from "@/fmg-components/vehicle-banner/vehicle-banner";
|
import vehicleBanner from "@/fmg-components/vehicle-banner/vehicle-banner";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import buttonQuestion from "@/digital-components/button-question/button-question";
|
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";
|
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||||
|
|
||||||
//Supporting Files
|
//Supporting Files
|
||||||
|
|
@ -137,10 +83,6 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedVinLookupMethod: null,
|
selectedVinLookupMethod: null,
|
||||||
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
|
|
||||||
emailAddress: this.getEmailFromStore(),
|
|
||||||
displayInvalidZipAlert: false,
|
|
||||||
displayNonServiceableZipAlert: false,
|
|
||||||
skipVin: false,
|
skipVin: false,
|
||||||
skipVinNotRepair: false,
|
skipVinNotRepair: false,
|
||||||
};
|
};
|
||||||
|
|
@ -185,22 +127,12 @@ export default {
|
||||||
];
|
];
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
const skipVin = await skipVinLookup();
|
|
||||||
const skipVinNotRepair = await skipVinLookupNotRepair();
|
|
||||||
|
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.skipVin = skipVin;
|
|
||||||
vm.skipVinNotRepair = skipVinNotRepair;
|
|
||||||
if (resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.includes("|")) {
|
if (resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.includes("|")) {
|
||||||
const forwardTextOption =
|
const forwardTextOption =
|
||||||
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.split("|");
|
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText.split("|");
|
||||||
if (skipVin) {
|
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0];
|
||||||
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText =
|
|
||||||
forwardTextOption[1];
|
|
||||||
} else {
|
|
||||||
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText =
|
|
||||||
forwardTextOption[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zip || resultMap.vinByAddress === false) {
|
if (!zip || resultMap.vinByAddress === false) {
|
||||||
|
|
@ -216,12 +148,6 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getZipFromStore() {
|
|
||||||
return store.getters.order.serviceLocation.zipCode;
|
|
||||||
},
|
|
||||||
getEmailFromStore() {
|
|
||||||
return store.getters.order.customer.emailAddress;
|
|
||||||
},
|
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0;
|
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);
|
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
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) {
|
if (this.selectedVinLookupMethod === vinLookupMethodSelections.MANUALVIN) {
|
||||||
await this.dispatchStoreAction(storeActions.CLEAR_VIN);
|
await this.dispatchStoreAction(storeActions.CLEAR_VIN);
|
||||||
return this.$router.navigateWithSaving(
|
return this.$router.navigateWithSaving(
|
||||||
|
|
@ -332,15 +184,6 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
AlertNonServiceableZipHeader() {
|
|
||||||
return this.getCmsContent("AlertNonServiceableZipWidget", "HeadlineText").replaceAll(
|
|
||||||
"{custom:serviceZip}",
|
|
||||||
this.serviceZipCode
|
|
||||||
);
|
|
||||||
},
|
|
||||||
AlertNonServiceableZipBody() {
|
|
||||||
return this.getCmsContent("AlertNonServiceableZipWidget", "BodyText");
|
|
||||||
},
|
|
||||||
questionText() {
|
questionText() {
|
||||||
return this.getCmsContent("VinLookupMethod", "QuestionText");
|
return this.getCmsContent("VinLookupMethod", "QuestionText");
|
||||||
},
|
},
|
||||||
|
|
@ -350,18 +193,10 @@ export default {
|
||||||
isRepair() {
|
isRepair() {
|
||||||
return store.getters.damage.isRepair;
|
return store.getters.damage.isRepair;
|
||||||
},
|
},
|
||||||
alertInfo() {
|
|
||||||
return this.skipVinNotRepair ? "AlertQuoteVinOptional" : "AlertQuoteReady";
|
|
||||||
},
|
|
||||||
VinLookupQuestionText() {
|
VinLookupQuestionText() {
|
||||||
return this.getCmsContent("VinLookupQuestion", "BodyText");
|
return this.getCmsContent("VinLookupQuestion", "BodyText");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
serviceZipCode() {
|
|
||||||
this.displayNonServiceableZipAlert = false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
vehicleBanner,
|
vehicleBanner,
|
||||||
|
|
@ -369,9 +204,6 @@ export default {
|
||||||
navbar,
|
navbar,
|
||||||
buttonQuestion,
|
buttonQuestion,
|
||||||
Form,
|
Form,
|
||||||
alert,
|
|
||||||
textboxQuestion,
|
|
||||||
textBlock,
|
|
||||||
loadingModal,
|
loadingModal,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue