Merged with CSR-1012

This commit is contained in:
Leah Schumann 2023-03-06 10:22:25 -05:00
commit 108ba814ff
4 changed files with 46 additions and 26 deletions

View file

@ -1,10 +1,5 @@
<template> <template>
<div class="text-center"> <div class="text-center">
<label
for="mobileLocationLinkPromptId"
:aria-label="mobileLocationLinkPromptText"
class="form-label fw-bold w-100 ps-4 pe-4 pt-4"
v-html="mobileLocationLinkPromptText"></label>
<div class="update-mobile-location-text-link"> <div class="update-mobile-location-text-link">
<textLink <textLink
ref="mobileLocationLink" ref="mobileLocationLink"
@ -15,10 +10,6 @@
@click-event="openModal" @click-event="openModal"
aria-label="Modal window" /> aria-label="Modal window" />
</div> </div>
<textBlock
:customText="mobileFeeText"
cmsWidgetName="MobileFeeDisclaimerWidget"
typeStyle="caption" />
</div> </div>
<modal <modal
:ref="modalName" :ref="modalName"
@ -89,9 +80,6 @@ export default {
alertInvalidZipWidgetName: String, alertInvalidZipWidgetName: String,
}, },
computed: { computed: {
mobileLocationLinkPromptText() {
return this.getCmsContent(this.linkWidgetName, "HeaderText");
},
mobileLocationLinkText() { mobileLocationLinkText() {
if ( if (
this.addressModel.streetAddress !== null && this.addressModel.streetAddress !== null &&
@ -153,7 +141,6 @@ export default {
// Reinitialize the Address Auto Complete // Reinitialize the Address Auto Complete
this.$refs.addressQuestions.setupAddressLookup(); this.$refs.addressQuestions.setupAddressLookup();
}, },
resetModel() { resetModel() {
// Address // Address
this.internalModel.addressQuestions.streetAddress = ""; this.internalModel.addressQuestions.streetAddress = "";
@ -163,7 +150,6 @@ export default {
// Is Vehicle Protected // Is Vehicle Protected
this.internalModel.isVehicleProtected = null; this.internalModel.isVehicleProtected = null;
}, },
async setMobileLocation() { async setMobileLocation() {
// Validate the Zip Code // Validate the Zip Code
const zipCodeData = await this.getZipCodeData( const zipCodeData = await this.getZipCodeData(

View file

@ -10,11 +10,21 @@
ref="serviceZipCodeQuestion" ref="serviceZipCodeQuestion"
linkWidgetName="ServiceZipLinkWidget" linkWidgetName="ServiceZipLinkWidget"
modalWidgetName="ServiceZipModalWidget" /> modalWidgetName="ServiceZipModalWidget" />
<div class="text-center">
<label
for="mobileLocationLinkPromptId"
:aria-label="mobileLocationLinkPromptText"
class="form-label fw-bold w-100 ps-4 pe-4 pt-4"
v-html="mobileLocationLinkPromptText"></label>
</div>
<mobileLocationModalQuestions <mobileLocationModalQuestions
v-model="mobileLocationQuestions" v-model="mobileLocationQuestions"
ref="mobileLocationModalQuestions" ref="mobileLocationModalQuestions"
linkWidgetName="MobileLocationLinkWidget" linkWidgetName="MobileLocationLinkWidget"
modalWidgetName="MobileLocationModalWidget" /> modalWidgetName="MobileLocationModalWidget" />
<div class="text-center">
<textBlock :customText="mobileFeeDisclaimerText" typeStyle="caption" />
</div>
<funnel-footer <funnel-footer
cmsWidgetName="FunnelFooterWidget" cmsWidgetName="FunnelFooterWidget"
ref="funnelFooter" ref="funnelFooter"
@ -39,6 +49,7 @@ import { settleAllPromises } from "@/helpers/layout-helper";
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import { getPricedMobileFeePart } from "@/helpers/service-location-helper"; import { getPricedMobileFeePart } from "@/helpers/service-location-helper";
import store from "@/store"; import store from "@/store";
import textBlock from "@/digital-components/text-block/text-block";
export default { export default {
name: "service-location", name: "service-location",
@ -112,19 +123,37 @@ export default {
zipCode: this.zipCode, zipCode: this.zipCode,
}, },
isVehicleProtected: this.isVehicleProtected, isVehicleProtected: this.isVehicleProtected,
mobileFeePart: this.mobileFeePart mobileFeePart: this.mobileFeePart,
}; };
}, },
set: function (newValue) { set: function (newValue) {
this.streetAddress = newValue.addressQuestions.streetAddress; this.streetAddress = newValue.addressQuestions.streetAddress;
this.apartmentNumberOrBusinessName = newValue.addressQuestions.apartmentNumberOrBusinessName, this.apartmentNumberOrBusinessName =
newValue.addressQuestions.apartmentNumberOrBusinessName;
this.city = newValue.addressQuestions.city; this.city = newValue.addressQuestions.city;
this.state = newValue.addressQuestions.state; this.state = newValue.addressQuestions.state;
this.zipCode = newValue.addressQuestions.zipCode; this.zipCode = newValue.addressQuestions.zipCode;
this.isVehicleProtected = newValue.isVehicleProtected, this.isVehicleProtected = newValue.isVehicleProtected;
this.mobileFeePart = newValue.mobileFeePart; this.mobileFeePart = newValue.mobileFeePart;
}, },
}, },
mobileLocationLinkPromptText() {
return this.getCmsContent("MobileLocationLinkWidget", "HeaderText");
},
mobileFeeDisclaimerText() {
const cmsContentText = this.getCmsContent("MobileFeeDisclaimerWidget", "Text");
return cmsContentText.replaceAll("{custom:mobileFee}", this.mobileFee);
},
mobileFee() {
if (!this.mobileFeePart) {
return 0;
}
return (
this.mobileFeePart.laborAmount +
this.mobileFeePart.sellingPrice +
this.mobileFeePart.kitPrice
);
},
}, },
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
@ -156,13 +185,13 @@ export default {
}, },
resetMobileFeePart(serviceZipCode) { resetMobileFeePart(serviceZipCode) {
getPricedMobileFeePart(serviceZipCode).then((pricedMobileFeePart) => { getPricedMobileFeePart(serviceZipCode).then((pricedMobileFeePart) => {
this.mobileLocationQuestions.mobileFeePart = pricedMobileFeePart; this.mobileFeePart = pricedMobileFeePart;
}); });
}, },
resetMobileLocation(updatedServiceZipCode) { resetMobileLocation(updatedServiceZipCode) {
this.streetAddress = ""; this.streetAddress = "";
this.apartmentNumberOrBusinessName = "", this.apartmentNumberOrBusinessName = "";
this.city = "", this.city = "";
this.isVehicleProtected = null; this.isVehicleProtected = null;
this.$refs.mobileLocationModalQuestions.resetComponent(); this.$refs.mobileLocationModalQuestions.resetComponent();
@ -184,6 +213,7 @@ export default {
funnelSubHeader, funnelSubHeader,
Form, Form,
loadingModal, loadingModal,
textBlock,
}, },
}; };
</script> </script>

View file

@ -60,13 +60,16 @@ export default {
linkWidgetName: String, linkWidgetName: String,
modalWidgetName: String, modalWidgetName: String,
}, },
setup() {
const textboxQuestionWidgetName = "ServiceZipQuestionWidget";
const alertInvalidZipWidgetName = "AlertInvalidZipWidget";
return {
textboxQuestionWidgetName,
alertInvalidZipWidgetName,
};
},
computed: { computed: {
textboxQuestionWidgetName() {
return "ServiceZipQuestionWidget";
},
alertInvalidZipWidgetName() {
return "AlertInvalidZipWidget";
},
serviceZipLinkText() { serviceZipLinkText() {
if (this.modelValue.zipCode && this.modelValue.zipCode.length > 0) { if (this.modelValue.zipCode && this.modelValue.zipCode.length > 0) {
return this.modelValue.state + ", " + this.modelValue.zipCode; return this.modelValue.state + ", " + this.modelValue.zipCode;

View file

@ -5,6 +5,7 @@
v-model="value" v-model="value"
inputId="serviceZipCode" inputId="serviceZipCode"
questionAlignment="center" questionAlignment="center"
cornerStyle="rounded"
mask="#####" mask="#####"
:displayQuestionText="false" :displayQuestionText="false"
isRequired isRequired