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

View file

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

View file

@ -54,7 +54,7 @@ export default {
internalModel: this.copyModel(this.modelValue), internalModel: this.copyModel(this.modelValue),
displayInvalidZipAlert: false, displayInvalidZipAlert: false,
}; };
}, },
props: { props: {
modelValue: { modelValue: {
type: Object, type: Object,
@ -114,7 +114,7 @@ export default {
state: modelToCopy.state, state: modelToCopy.state,
zipCode: modelToCopy.zipCode, zipCode: modelToCopy.zipCode,
isServiceable: modelToCopy.isServiceable, isServiceable: modelToCopy.isServiceable,
} };
}, },
openModal() { openModal() {
@ -148,14 +148,15 @@ export default {
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 // 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("service-zip-updated");
} }
this.$emit("update:modelValue", this.internalModel); this.$emit("update:modelValue", this.internalModel);
this.closeModal(); this.closeModal();
} }
}, },
@ -166,7 +167,7 @@ export default {
}, },
modelValue(newValue) { modelValue(newValue) {
this.internalModel = this.copyModel(newValue); this.internalModel = this.copyModel(newValue);
} },
}, },
components: { components: {
textLink, textLink,

View file

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