CSR-1088 - Additional model / prop related changes
This commit is contained in:
parent
0517b7072a
commit
1aa470bf18
4 changed files with 40 additions and 12 deletions
|
|
@ -44,7 +44,6 @@
|
||||||
import buttonMain from "@/ux-components/button-main/button-main";
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
import { Modal } from "bootstrap";
|
import { Modal } from "bootstrap";
|
||||||
import { useIsFormTouched, useIsFormDirty, useIsFormValid } from "vee-validate";
|
import { useIsFormTouched, useIsFormDirty, useIsFormValid } from "vee-validate";
|
||||||
import { checkPropertyChange } from "json-schema";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "modal",
|
name: "modal",
|
||||||
|
|
|
||||||
|
|
@ -54,11 +54,6 @@ import textBlock from "@/digital-components/text-block/text-block";
|
||||||
export default {
|
export default {
|
||||||
name: "mobile-location-modal-questions",
|
name: "mobile-location-modal-questions",
|
||||||
emits: ["update:modelValue"], // The component emits an event
|
emits: ["update:modelValue"], // The component emits an event
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
answers: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
modelValue: {
|
modelValue: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
@ -70,11 +65,12 @@ export default {
|
||||||
state: "",
|
state: "",
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
},
|
},
|
||||||
|
isVehicleProtected: Boolean,
|
||||||
isZipServiceableMobile: Boolean,
|
isZipServiceableMobile: Boolean,
|
||||||
isZipServiceableInShop: Boolean,
|
isZipServiceableInShop: Boolean,
|
||||||
isVehicleProtected: Boolean,
|
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
serviceZipCode: String,
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
modalWidgetName: String,
|
modalWidgetName: String,
|
||||||
mobileFeeDisclaimerWidgetName: String,
|
mobileFeeDisclaimerWidgetName: String,
|
||||||
|
|
@ -100,7 +96,6 @@ export default {
|
||||||
}
|
}
|
||||||
return this.getCmsContent(this.cmsWidgetName, "BodyText");
|
return this.getCmsContent(this.cmsWidgetName, "BodyText");
|
||||||
},
|
},
|
||||||
|
|
||||||
modalHeaderText() {
|
modalHeaderText() {
|
||||||
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
return this.getCmsContent(this.modalWidgetName, "HeaderText");
|
||||||
},
|
},
|
||||||
|
|
@ -120,6 +115,14 @@ export default {
|
||||||
return this.mobileLocationQuestionModel.addressQuestions;
|
return this.mobileLocationQuestionModel.addressQuestions;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
_isVehicleProtected: {
|
||||||
|
get: function () {
|
||||||
|
return this.modelValue.isVehicleProtected;
|
||||||
|
},
|
||||||
|
set: function (newValue) {
|
||||||
|
this.$emit("update:modelValue.isVehicleProtected", newValue);
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
openModal() {
|
||||||
|
|
@ -128,10 +131,29 @@ export default {
|
||||||
closeModal() {
|
closeModal() {
|
||||||
this.$refs.mobileLocationModal.closeModal();
|
this.$refs.mobileLocationModal.closeModal();
|
||||||
},
|
},
|
||||||
|
resetModel() {
|
||||||
|
// Address
|
||||||
|
this.addressModel.streetAddress = "";
|
||||||
|
this.addressModel.apartmentNumberOrBusinessName = "";
|
||||||
|
this.addressModel.city = "";
|
||||||
|
this.addressModel.state = "";
|
||||||
|
this.addressModel.zipCode = "";
|
||||||
|
|
||||||
|
// Is Vehicle Protected
|
||||||
|
this._isVehicleProtected = null;
|
||||||
|
},
|
||||||
async setMobileLocation() {
|
async setMobileLocation() {
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
serviceZipCode: {
|
||||||
|
handler() {
|
||||||
|
// if they modify the Service Zip Code, clear the model
|
||||||
|
this.resetModel();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
components: {
|
components: {
|
||||||
textLink,
|
textLink,
|
||||||
modal,
|
modal,
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
export default {
|
export default {
|
||||||
name: "vehicle-protected-question",
|
name: "vehicle-protected-question",
|
||||||
props: {
|
props: {
|
||||||
modelValue: String,
|
modelValue: {
|
||||||
|
isVehicleProtected: Boolean,
|
||||||
|
},
|
||||||
cmsWidgetName: String,
|
cmsWidgetName: String,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
fmg
|
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<div class="page-container-grouped-styles">
|
<div class="page-container-grouped-styles">
|
||||||
|
|
@ -12,6 +11,7 @@ fmg
|
||||||
alertInvalidZipWidgetName="AlertInvalidZipWidget" />
|
alertInvalidZipWidgetName="AlertInvalidZipWidget" />
|
||||||
<mobileLocationModalQuestions
|
<mobileLocationModalQuestions
|
||||||
v-model="mobileLocationQuestions"
|
v-model="mobileLocationQuestions"
|
||||||
|
:serviceZipCode="serviceZipQuestion.serviceZipCode"
|
||||||
cmsWidgetName="MobileLocationLinkWidget"
|
cmsWidgetName="MobileLocationLinkWidget"
|
||||||
modalWidgetName="MobileLocationModalWidget"
|
modalWidgetName="MobileLocationModalWidget"
|
||||||
mobileFeeDisclaimerWidgetName="MobileFeeDisclaimerWidget"
|
mobileFeeDisclaimerWidgetName="MobileFeeDisclaimerWidget"
|
||||||
|
|
@ -54,6 +54,9 @@ export default {
|
||||||
state: "",
|
state: "",
|
||||||
zipCode: "",
|
zipCode: "",
|
||||||
},
|
},
|
||||||
|
isVehicleProtected: null,
|
||||||
|
isZipServiceableMobile: null,
|
||||||
|
isZipServiceableInShop: null,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -80,7 +83,9 @@ export default {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
resetMobileLocationTest() {
|
||||||
|
this.serviceZipQuestion.serviceZipCode = "43054";
|
||||||
|
},
|
||||||
backButtonAction() {},
|
backButtonAction() {},
|
||||||
forwardButtonAction() {},
|
forwardButtonAction() {},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue