Contains Military zip emit on Location questions modal

This commit is contained in:
Bill Richardson 2023-03-16 16:49:14 -04:00
parent 14541d110c
commit c4f0624f10
2 changed files with 12 additions and 3 deletions

View file

@ -65,6 +65,7 @@ import { getPricedMobileFeePart } from "@/layouts/service-location/helpers/servi
export default { export default {
name: "mobile-location-modal-questions", name: "mobile-location-modal-questions",
emits: ["update:modelValue", "updated-mobile-fee-part"], emits: ["update:modelValue", "updated-mobile-fee-part"],
emits: ["update:modelValue", "updated-zip-code", "updated-contains-military-base"], // The component emits an event
data() { data() {
return { return {
internalModel: deepClone(this.modelValue), internalModel: deepClone(this.modelValue),
@ -187,6 +188,7 @@ export default {
// Update the page level model // Update the page level model
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);
this.$emit("updated-contains-military-base", zipCodeData.containsMilitaryBase);
this.closeModal(); this.closeModal();
} }
}, },

View file

@ -10,12 +10,12 @@
:mobileFeePart="mobileFeePart" :mobileFeePart="mobileFeePart"
@updated-mobile-fee-part="setMobileFeePart" @updated-mobile-fee-part="setMobileFeePart"
linkWidgetName="ServiceZipLinkWidget" linkWidgetName="ServiceZipLinkWidget"
modalWidgetName="ServiceZipModalWidget" modalWidgetName="ServiceZipModalWidget"
@updated-contains-military-base="setContainsMilitaryBase" /> @updated-contains-military-base="setContainsMilitaryBase" />
<alert <alert
class="my-4" class="my-4"
cmsWidgetName="AlertMilitaryBaseZipWidget" cmsWidgetName="AlertMilitaryBaseZipWidget"
v-if="zipContainsMilitaryBase" v-if="showMilitaryZipAlert"
alertClass="alert-warning" /> alertClass="alert-warning" />
<mobileLocationModalQuestions <mobileLocationModalQuestions
v-model="mobileLocationQuestions" v-model="mobileLocationQuestions"
@ -23,7 +23,8 @@
@updated-mobile-fee-part="setMobileFeePart" @updated-mobile-fee-part="setMobileFeePart"
ref="mobileLocationModalQuestions" ref="mobileLocationModalQuestions"
linkWidgetName="MobileLocationLinkWidget" linkWidgetName="MobileLocationLinkWidget"
modalWidgetName="MobileLocationModalWidget" /> modalWidgetName="MobileLocationModalWidget"
@updated-contains-military-base="setContainsMilitaryBase" />
<funnel-footer <funnel-footer
cmsWidgetName="FunnelFooterWidget" cmsWidgetName="FunnelFooterWidget"
ref="funnelFooter" ref="funnelFooter"
@ -142,6 +143,12 @@ export default {
this.isVehicleProtected = newValue.isVehicleProtected; this.isVehicleProtected = newValue.isVehicleProtected;
}, },
}, },
showMilitaryZipAlert() {
return (
this.zipContainsMilitaryBase &&
(this.isZipServiceableMobile == null || this.isZipServiceableMobile === true)
);
},
}, },
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {