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" />
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" ref="siteSubHeader" />
<div class="fade-on-route-transition sub-container make-tall">
<customerQuestions ref="customerQuestions" v-model="customerQuestions" />
<alert
ref="alertVinNotFound"
v-if="displayVinNotFoundAlert"
@ -67,6 +66,7 @@
</div>
</div>
</transition>
<customerQuestions ref="customerQuestions" v-model="customerQuestions" />
<siteFooter
cmsWidgetName="SiteFooterWidget"
ref="siteFooter"
@ -136,14 +136,13 @@ export default {
return {
customerQuestions: {
addressQuestions: {
streetAddress: this.registrationAddress,
city: this.registrationCity,
state: this.registrationState,
zipCode: this.registrationZip,
streetAddress: "",
city: "",
state: "",
zipCode: "",
},
firstName: this.registrationFirstName,
lastName: this.registrationLastName,
emailAddress: this.getEmailFromStore,
firstName: "",
lastName: "",
},
serviceZipCode: this.serviceZip,
displayNonServiceableZipAlert: false,
@ -159,35 +158,24 @@ export default {
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: {
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() {
// route to move backwards
@ -382,6 +370,7 @@ export default {
},
mounted() {
this.attachCustomEvents();
this.loadDefaultsFromStore();
},
computed: {
AlertNonServiceableZipHeader() {

View file

@ -1,5 +1,20 @@
<template>
<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="col">
<textboxQuestion
@ -17,7 +32,7 @@
</div>
</div>
<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">
<textboxQuestion
cmsWidgetName="CityQuestionWidget"
@ -30,7 +45,7 @@
</div>
</transition>
<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">
<dropdownQuestion
cmsWidgetName="StateQuestionWidget"
@ -53,20 +68,7 @@
</div>
</div>
</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>
</template>
@ -105,7 +107,6 @@ export default {
},
data() {
return {
showAddressFields: false,
displayVerificationWarning: false,
displayNoMatchWarning: false,
alertHeadlineVerificationWarning: "",
@ -135,16 +136,7 @@ export default {
},
methods: {
setupAddressLookup() {
if (
this.addressModel.streetAddress &&
this.addressModel.city &&
this.addressModel.state &&
this.addressModel.zipCode
) {
this.showAddressFields = true;
return;
}
const addressField1 = document.getElementById("autocomplete");
const self = this;
@ -249,8 +241,7 @@ export default {
self.matchFound = true;
self.addressModel.streetAddress = "";
self.$nextTick(function () {
self.showAddressFields = true;
for (const component of place.address_components) {
const componentType = component.types[0];
@ -313,7 +304,6 @@ export default {
this.addressModel.city = "";
this.addressModel.state = "";
this.addressModel.zipCode = "";
this.showAddressFields = true;
this.displayVerificationWarning = false;
this.$nextTick(function () {

View file

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

View file

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