Finally everything *seems* to be working

This commit is contained in:
Leah Schumann 2023-02-15 15:49:21 -05:00
parent f87368f5e6
commit 38b346a05e
3 changed files with 11 additions and 44 deletions

View file

@ -137,13 +137,6 @@ export default {
// Reset the validation form // Reset the validation form
this.$refs[this.modalName].form.resetForm(); this.$refs[this.modalName].form.resetForm();
// {
// values: {
// state: this.modelValue.addressQuestions.state,
// zipCode: this.modelValue.addressQuestions.zipCode,
// },
// dirty: false,
// });
// Reinitialize the Address Auto Complete // Reinitialize the Address Auto Complete
this.$refs.addressQuestions.setupAddressLookup(); this.$refs.addressQuestions.setupAddressLookup();
@ -164,6 +157,7 @@ export default {
async setMobileLocation() { async setMobileLocation() {
// TODO: Any lookups or actions to be taken before assigning the Mobile Location // TODO: Any lookups or actions to be taken before assigning the Mobile Location
// Update the page level model
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);
this.closeModal(); this.closeModal();

View file

@ -38,15 +38,6 @@ import serviceZipQuestion from "@/layouts/service-location/service-zip-modal-que
import modal from "@/digital-components/modal/modal"; import modal from "@/digital-components/modal/modal";
import alert from "@/ux-components/alert/alert"; import alert from "@/ux-components/alert/alert";
//Supporting Files
import { defineRule, useForm } from "vee-validate";
import { required, regex } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
// Define Validation Rules
// defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED));
// defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT));
export default { export default {
name: "service-zip-modal-question", name: "service-zip-modal-question",
data() { data() {
@ -85,14 +76,6 @@ export default {
modalName() { modalName() {
return this.modalWidgetName; return this.modalWidgetName;
}, },
// serviceZipModel: {
// get: function () {
// return this.modelValue;
// },
// set: function (newValue) {
// this.$emit("update:modelValue", newValue);
// },
// },
}, },
methods: { methods: {
resetAlerts() { resetAlerts() {
@ -105,7 +88,8 @@ export default {
}, },
focusOnZipInput() { focusOnZipInput() {
const input = document.getElementById("serviceZipCodeTextBoxQuestion"); const inputId = this.$refs.serviceZipQuestion.$refs.zipInputTextQuestion.inputId;
const input = document.getElementById(inputId);
input.focus(); input.focus();
}, },
@ -125,15 +109,9 @@ export default {
this.$refs[this.modalName].closeModal(); this.$refs[this.modalName].closeModal();
}, },
// onModalOpened() { onModalOpened() {
// this.serviceZipCodeInput = this.serviceZipModel.zipCode; this.focusOnZipInput();
// this.focusOnZipInput(); },
// },
// onModalClosed() {
// this.serviceZipCodeInput = this.serviceZipModel.zipCode;
// this.resetsOnZipInput();
// },
async setZipCode() { async setZipCode() {
this.resetAlerts(); this.resetAlerts();
@ -147,14 +125,10 @@ export default {
this.internalModel.state = zipCodeData.state; this.internalModel.state = zipCodeData.state;
this.internalModel.isServiceable = zipCodeData.isServiceable; this.internalModel.isServiceable = zipCodeData.isServiceable;
// if the service zip code is changing we need to clear the Mobile Location Model // Notify the page that the service zip has been updated to clear Mobile Location form
if ( this.$emit("service-zip-updated");
this.modelValue.zipCode !== "" &&
this.internalModel.zipCode !== this.modelValue.zipCode // Update the page level model
) {
this.$emit("service-zip-updated");
}
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);
this.closeModal(); this.closeModal();

View file

@ -5,8 +5,7 @@
v-model="value" v-model="value"
inputId="serviceZipCode" inputId="serviceZipCode"
questionAlignment="center" questionAlignment="center"
mask="#####" mask="#####"
:preventAutoFill="true"
:displayQuestionText="false" :displayQuestionText="false"
isRequired isRequired
validationRules="zip-required|zip-format" /> validationRules="zip-required|zip-format" />