We no longer need obfuscated names for the address fields as we are ok with auto-fill now, removing them for clarity in code that resets validation

This commit is contained in:
Leah Schumann 2023-02-15 08:45:40 -05:00
parent c6b59f1421
commit e46570fb9e
4 changed files with 21 additions and 21 deletions

View file

@ -26,7 +26,7 @@
cmsWidgetName="ApartmentNumberOrBusinessNameQuestionWidget"
v-model="addressModel.apartmentNumberOrBusinessName"
ref="apartmentNumberOrBusinessName"
inputId="639b0aaa35f64609ad6995f86a74322b"
inputId="apartmentNumberOrBusinessName"
disableAutoFill />
</div>
</div>
@ -38,7 +38,7 @@
cmsWidgetName="CityQuestionWidget"
v-model="addressModel.city"
ref="city"
inputId="cbf28188fdf2436688fd735915f7ee56"
inputId="city"
disableAutoFill
validationRules="city-required" />
</div>
@ -51,7 +51,7 @@
cmsWidgetName="StateQuestionWidget"
v-model="addressModel.state"
ref="state"
inputId="8fdf9dc2e13e430eb57529499dceb3eb"
inputId="state"
:options="stateOptions"
disableAutoFill
validationRules="state-required" />
@ -61,7 +61,7 @@
cmsWidgetName="ZipQuestionWidget"
v-model="addressModel.zipCode"
ref="zipCode"
inputId="01a9a1c2de0b4c9da8e023c9ae3be498"
inputId="zipCode"
mask="#####"
disableAutoFill
validationRules="zip-code-required|zip-code-format" />

View file

@ -51,7 +51,7 @@ export default {
data() {
return {
internalModel: this.copyModel(this.modelValue),
}
};
},
props: {
modelValue: {
@ -112,7 +112,8 @@ export default {
return {
addressQuestions: {
streetAddress: modelToCopy.addressQuestions.streetAddress,
apartmentNumberOrBusinessName: modelToCopy.addressQuestions.apartmentNumberOrBusinessName,
apartmentNumberOrBusinessName:
modelToCopy.addressQuestions.apartmentNumberOrBusinessName,
city: modelToCopy.addressQuestions.city,
state: modelToCopy.addressQuestions.state,
zipCode: modelToCopy.addressQuestions.zipCode,
@ -120,7 +121,7 @@ export default {
isVehicleProtected: modelToCopy.isVehicleProtected,
isZipServiceableMobile: modelToCopy.isZipServiceableMobile,
isZipServiceableInShop: modelToCopy.isZipServiceableInShop,
}
};
},
openModal() {
@ -133,14 +134,12 @@ export default {
resetComponent() {
this.resetModel();
// Reset the validation form
this.$refs[this.modalName].form.resetForm({
values: {
"8fdf9dc2e13e430eb57529499dceb3eb": "OH"
}
state: this.modelValue.addressQuestions.state,
},
});
// Reinitialize the Address Auto Complete
@ -156,7 +155,7 @@ export default {
this.internalModel.addressQuestions.zipCode = "";
// Is Vehicle Protected
this.internalModel.isVehicleProtected = null;
this.internalModel.isVehicleProtected = null;
},
async setMobileLocation() {
@ -170,7 +169,7 @@ export default {
watch: {
modelValue(newValue) {
this.internalModel = this.copyModel(newValue);
}
},
},
components: {
textLink,

View file

@ -54,7 +54,7 @@ export default {
internalModel: this.copyModel(this.modelValue),
displayInvalidZipAlert: false,
};
},
},
props: {
modelValue: {
type: Object,
@ -114,7 +114,7 @@ export default {
state: modelToCopy.state,
zipCode: modelToCopy.zipCode,
isServiceable: modelToCopy.isServiceable,
}
};
},
openModal() {
@ -148,14 +148,15 @@ export default {
this.internalModel.isServiceable = zipCodeData.isServiceable;
// if the service zip code is changing we need to clear the Mobile Location Model
if (this.modelValue.zipCode !== "" && this.internalModel.zipCode !== this.modelValue.zipCode ) {
if (
this.modelValue.zipCode !== "" &&
this.internalModel.zipCode !== this.modelValue.zipCode
) {
this.$emit("service-zip-updated");
}
this.$emit("update:modelValue", this.internalModel);
this.closeModal();
}
},
@ -166,7 +167,7 @@ export default {
},
modelValue(newValue) {
this.internalModel = this.copyModel(newValue);
}
},
},
components: {
textLink,

View file

@ -3,7 +3,7 @@
ref="zipInputTextQuestion"
:cmsWidgetName="cmsWidgetName"
v-model="value"
inputId="serviceZipCodeTextBoxQuestion"
inputId="serviceZipCode"
questionAlignment="center"
mask="#####"
:displayQuestionText="false"