no message

This commit is contained in:
Jason Wheeler 2023-01-13 11:45:49 -05:00
parent 2933f6e8c8
commit ecb80542e4
4 changed files with 47 additions and 68 deletions

View file

@ -13,7 +13,6 @@
:displayGenericVehicleImage="false" /> :displayGenericVehicleImage="false" />
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" ref="siteSubHeader" /> <siteSubHeader cmsWidgetName="SiteSubHeaderWidget" ref="siteSubHeader" />
<div class="fade-on-route-transition sub-container make-tall"> <div class="fade-on-route-transition sub-container make-tall">
<customerQuestions ref="customerQuestions" v-model="customerQuestions" />
<alert <alert
ref="alertVinNotFound" ref="alertVinNotFound"
v-if="displayVinNotFoundAlert" v-if="displayVinNotFoundAlert"
@ -67,6 +66,7 @@
</div> </div>
</div> </div>
</transition> </transition>
<customerQuestions ref="customerQuestions" v-model="customerQuestions" />
<siteFooter <siteFooter
cmsWidgetName="SiteFooterWidget" cmsWidgetName="SiteFooterWidget"
ref="siteFooter" ref="siteFooter"
@ -136,14 +136,13 @@ export default {
return { return {
customerQuestions: { customerQuestions: {
addressQuestions: { addressQuestions: {
streetAddress: this.registrationAddress, streetAddress: "",
city: this.registrationCity, city: "",
state: this.registrationState, state: "",
zipCode: this.registrationZip, zipCode: "",
}, },
firstName: this.registrationFirstName, firstName: "",
lastName: this.registrationLastName, lastName: "",
emailAddress: this.getEmailFromStore,
}, },
serviceZipCode: this.serviceZip, serviceZipCode: this.serviceZip,
displayNonServiceableZipAlert: false, displayNonServiceableZipAlert: false,
@ -159,35 +158,24 @@ export default {
isZipServiceable: false, isZipServiceable: false,
}; };
}, },
computed: {
registrationAddress() {
return this.mainStore.order.vehicle.registration.address;
},
registrationCity() {
return this.mainStore.order.vehicle.registration.city;
},
registrationState() {
return this.mainStore.order.vehicle.registration.state;
},
registrationZip() {
return this.mainStore.order.vehicle.registration.zipCode;
},
registrationFirstName() {
return this.mainStore.order.vehicle.registration.firstName;
},
registrationLastName() {
return this.mainStore.order.vehicle.registration.lastName;
},
getEmailFromStore() {
return this.mainStore.order.customer.emailAddress;
},
serviceZip() {
return this.mainStore.order.serviceLocation.zipCode;
}
},
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
return useMainStore().order.vehicle.carId !== null; return this.mainStore.order.vehicle.carId !== null;
},
loadDefaultsFromStore() {
const data = this.mainStore.order.vehicle.registration;
this.customerQuestions = { ...this.customerQuestions,
...{
firstName: data.firstName,
lastName: data.lastName,
addressQuestions: {
streetAddress: data.address,
city: data.city,
state: data.state,
zipCode: data.zipCode
}
}
};
}, },
backButtonAction() { backButtonAction() {
// route to move backwards // route to move backwards
@ -382,6 +370,7 @@ export default {
}, },
mounted() { mounted() {
this.attachCustomEvents(); this.attachCustomEvents();
this.loadDefaultsFromStore();
}, },
computed: { computed: {
AlertNonServiceableZipHeader() { AlertNonServiceableZipHeader() {

View file

@ -1,5 +1,20 @@
<template> <template>
<div role="application"> <div role="application">
<alert
ref="alertVerificationWarning"
v-if="displayVerificationWarning"
class="mb-4"
cmsWidgetName="AlertVerificationWarningWidget"
alertClass="alert-warning"
v-bind:isDismissible="false" />
<alert
ref="alertNoMatchWarning"
v-if="displayNoMatchWarning"
class="mb-4"
cmsWidgetName="AlertNoMatchWarningWidget"
alertClass="alert-warning"
v-bind:isDismissible="false" />
<div class="row mt-2 mb-4"> <div class="row mt-2 mb-4">
<div class="col"> <div class="col">
<textboxQuestion <textboxQuestion
@ -17,7 +32,7 @@
</div> </div>
</div> </div>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<div class="row mb-4" v-show="showAddressFields" aria-live="polite"> <div class="row mb-4" aria-live="polite">
<div class="col"> <div class="col">
<textboxQuestion <textboxQuestion
cmsWidgetName="CityQuestionWidget" cmsWidgetName="CityQuestionWidget"
@ -30,7 +45,7 @@
</div> </div>
</transition> </transition>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<div class="row mb-4" v-show="showAddressFields" aria-live="polite"> <div class="row mb-4" aria-live="polite">
<div class="col"> <div class="col">
<dropdownQuestion <dropdownQuestion
cmsWidgetName="StateQuestionWidget" cmsWidgetName="StateQuestionWidget"
@ -53,20 +68,7 @@
</div> </div>
</div> </div>
</transition> </transition>
<alert
ref="alertVerificationWarning"
v-if="displayVerificationWarning"
class="mb-4"
cmsWidgetName="AlertVerificationWarningWidget"
alertClass="alert-warning"
v-bind:isDismissible="false" />
<alert
ref="alertNoMatchWarning"
v-if="displayNoMatchWarning"
class="mb-4"
cmsWidgetName="AlertNoMatchWarningWidget"
alertClass="alert-warning"
v-bind:isDismissible="false" />
</div> </div>
</template> </template>
@ -105,7 +107,6 @@ export default {
}, },
data() { data() {
return { return {
showAddressFields: false,
displayVerificationWarning: false, displayVerificationWarning: false,
displayNoMatchWarning: false, displayNoMatchWarning: false,
alertHeadlineVerificationWarning: "", alertHeadlineVerificationWarning: "",
@ -135,16 +136,7 @@ export default {
}, },
methods: { methods: {
setupAddressLookup() { setupAddressLookup() {
if (
this.addressModel.streetAddress &&
this.addressModel.city &&
this.addressModel.state &&
this.addressModel.zipCode
) {
this.showAddressFields = true;
return;
}
const addressField1 = document.getElementById("autocomplete"); const addressField1 = document.getElementById("autocomplete");
const self = this; const self = this;
@ -249,8 +241,7 @@ export default {
self.matchFound = true; self.matchFound = true;
self.addressModel.streetAddress = ""; self.addressModel.streetAddress = "";
self.$nextTick(function () { self.$nextTick(function () {
self.showAddressFields = true;
for (const component of place.address_components) { for (const component of place.address_components) {
const componentType = component.types[0]; const componentType = component.types[0];
@ -313,7 +304,6 @@ export default {
this.addressModel.city = ""; this.addressModel.city = "";
this.addressModel.state = ""; this.addressModel.state = "";
this.addressModel.zipCode = ""; this.addressModel.zipCode = "";
this.showAddressFields = true;
this.displayVerificationWarning = false; this.displayVerificationWarning = false;
this.$nextTick(function () { this.$nextTick(function () {

View file

@ -51,7 +51,6 @@ export default {
}, },
firstName: "", firstName: "",
lastName: "", lastName: "",
emailAddress: "",
}, },
}), }),
}, },

View file

@ -165,10 +165,11 @@ export const useMainStore = defineStore({
], ],
}; };
}, },
experimentSettings: (state) => experimentSettings: (state) => {
state.applicationUser.experiments return state.applicationUser.experiments
.map((x) => x.settings) .map((x) => x.settings)
.reduce((r, c) => Object.assign(r, c), {}) ?? {} .reduce((r, c) => Object.assign(r, c), {}) ?? {}
}
}, },
actions: actions:
{ {