'Final' check-in before submitting to QA
This commit is contained in:
parent
d84607ba7a
commit
d276a24b87
5 changed files with 73 additions and 46 deletions
|
|
@ -43,6 +43,7 @@ export default {
|
||||||
const fieldOptions = {
|
const fieldOptions = {
|
||||||
type: "text",
|
type: "text",
|
||||||
value: props.modelValue,
|
value: props.modelValue,
|
||||||
|
initialValue: props.modelValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ export default {
|
||||||
const fieldOptions = {
|
const fieldOptions = {
|
||||||
type: "text",
|
type: "text",
|
||||||
value: props.modelValue,
|
value: props.modelValue,
|
||||||
|
initialValue: props.modelValue,
|
||||||
};
|
};
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<Form
|
<Form ref="theForm" @submit="onSubmit" @invalid-submit="onInvalidSubmit" v-slot="{ meta }" autocomplete="off">
|
||||||
@submit="onSubmit"
|
|
||||||
@invalid-submit="onInvalidSubmit"
|
|
||||||
ref="theForm"
|
|
||||||
v-slot="{ meta }"
|
|
||||||
autocomplete="off" >
|
|
||||||
<div class="container-fluid shadow rounded-3 p-2 position-relative make-tall px-5">
|
<div class="container-fluid shadow rounded-3 p-2 position-relative make-tall px-5">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
||||||
<vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage=false />
|
<vehicleBanner ref="vehicleBanner" :displayGenericVehicleImage=false />
|
||||||
|
|
@ -126,8 +121,11 @@ export default {
|
||||||
displayVinNotFoundAlert: false,
|
displayVinNotFoundAlert: false,
|
||||||
displayMatchedDifferentVehicleAlert: false,
|
displayMatchedDifferentVehicleAlert: false,
|
||||||
displayVinLookupByHomeAddressNotAllowedAlert: false,
|
displayVinLookupByHomeAddressNotAllowedAlert: false,
|
||||||
previousCarIdFound: "",
|
previouslyEnteredCarId: "",
|
||||||
|
isSelectedGlassAvailableForVehicle: false,
|
||||||
customAlertData: {},
|
customAlertData: {},
|
||||||
|
showServiceZipField: this.getServiceZipFromStore(),
|
||||||
|
isZipServicable: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -189,7 +187,8 @@ export default {
|
||||||
|
|
||||||
// Validate if the original or service zip provided is serviceable
|
// Validate if the original or service zip provided is serviceable
|
||||||
const zipValidation = this.serviceZip ? await this.validateZip(this.serviceZip) : await this.validateZip(this.customerQuestions.addressQuestions.zip);
|
const zipValidation = this.serviceZip ? await this.validateZip(this.serviceZip) : await this.validateZip(this.customerQuestions.addressQuestions.zip);
|
||||||
if (!zipValidation.data.isServiceable) {
|
this.isZipServicable = zipValidation.data.isServiceable;
|
||||||
|
if (!this.isZipServicable) {
|
||||||
this.displayNonServiceableZipAlert = true;
|
this.displayNonServiceableZipAlert = true;
|
||||||
this.showServiceZipField = true;
|
this.showServiceZipField = true;
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
|
|
@ -197,6 +196,7 @@ export default {
|
||||||
|
|
||||||
const carEntered = store.getters.vehicle;
|
const carEntered = store.getters.vehicle;
|
||||||
const carsFound = vinLookup.data.vinVehicles;
|
const carsFound = vinLookup.data.vinVehicles;
|
||||||
|
|
||||||
if (carsFound.length == 0) {
|
if (carsFound.length == 0) {
|
||||||
// No VINs found
|
// No VINs found
|
||||||
this.displayVinNotFoundAlert = true;
|
this.displayVinNotFoundAlert = true;
|
||||||
|
|
@ -204,34 +204,41 @@ export default {
|
||||||
return;
|
return;
|
||||||
} else if (carsFound.length == 1) {
|
} else if (carsFound.length == 1) {
|
||||||
const carFound = carsFound[0].vehicle;
|
const carFound = carsFound[0].vehicle;
|
||||||
|
this.isCarIdDifferent = carFound.carId !== carEntered.carId;
|
||||||
|
|
||||||
if (carEntered.carId == carFound.carId || carFound.carId == this.previousCarIdFound) {
|
if (this.isCarIdDifferent && carFound.carId !== this.previouslyEnteredCarId) {
|
||||||
// update data
|
|
||||||
this.updateVehicleInfo(carFound.vin, carFound);
|
|
||||||
this.updateCustomerInfo();
|
|
||||||
|
|
||||||
// navigate forward
|
|
||||||
this.navigateForward(carEntered, carsFound);
|
|
||||||
} else {
|
|
||||||
// Display Alert
|
// Display Alert
|
||||||
|
this.previouslyEnteredCarId = carFound.carId;
|
||||||
this.customAlertData.vehicleInfo = carFound;
|
this.customAlertData.vehicleInfo = carFound;
|
||||||
this.displayMatchedDifferentVehicleAlert = true;
|
this.displayMatchedDifferentVehicleAlert = true;
|
||||||
|
|
||||||
|
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(carFound.carId);
|
||||||
|
|
||||||
// Update button "Continue with..."
|
// Update button "Continue with..."
|
||||||
this.$refs.funnelFooter.updateButtonText(`Continue with ${carFound.year} ${carFound.make} ${carFound.model}`);
|
this.$refs.funnelFooter.updateButtonText(`Continue with ${carFound.year} ${carFound.make} ${carFound.model}`);
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.previousCarIdFound = carFound.carId;
|
if (!this.isZipServicable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (vinLookup.data.vinVehicles.length > 1) {
|
// update data if the zip or service zip is servicable
|
||||||
|
this.updateVehicleInfo(carFound.vin, carFound);
|
||||||
this.updateCustomerInfo();
|
this.updateCustomerInfo();
|
||||||
|
|
||||||
// navigate forward
|
} else if (carsFound.length > 1) {
|
||||||
this.navigateForward(carEntered, carsFound);
|
if (!this.isZipServicable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// update data if the zip or service zip is servicable
|
||||||
|
this.updateCustomerInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.navigateForward(carEntered, carsFound);
|
||||||
},
|
},
|
||||||
resetWarningsAndErrors() {
|
resetWarningsAndErrors() {
|
||||||
this.displayVinNotFoundAlert = false;
|
this.displayVinNotFoundAlert = false;
|
||||||
|
|
@ -241,16 +248,15 @@ export default {
|
||||||
},
|
},
|
||||||
async navigateForward(carEntered, carsFound) {
|
async navigateForward(carEntered, carsFound) {
|
||||||
if (carsFound.length == 1) {
|
if (carsFound.length == 1) {
|
||||||
// get the damage options for the car that was found
|
if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) {
|
||||||
const carFound = carsFound[0].vehicle;
|
this.$router.navigateAfterSave(
|
||||||
|
this.navigationScenarios.CONTINUING_WITH_DIFFERENT_GLASS,
|
||||||
// if the car entered is the same as the car found or the selected glass is available for the car that was found
|
this.$route, {}, {
|
||||||
if (carEntered.carId == carFound.carId || isGlassAvailableForCarId(carFound.carId)) {
|
displayVehicleChangeAlert: true
|
||||||
navigateAfterSaveToHeritageFunnel(this.$route);
|
}, {}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// if not then navigate to the "vehicle-damage" page
|
navigateAfterSaveToHeritageFunnel(this.$route);
|
||||||
store.dispatch(storeActions.RESET_DAMAGE_STATE_AND_DEPENDENCIES);
|
|
||||||
this.$router.navigateAfterSave(this.navigationScenarios.CONTINUING_WITH_DIFFERENT_GLASS, this.$route, {}, { displayVehicleChangeAlert: true }, {});
|
|
||||||
}
|
}
|
||||||
} else if (carsFound.length > 1) {
|
} else if (carsFound.length > 1) {
|
||||||
// if multiple cars were found
|
// if multiple cars were found
|
||||||
|
|
@ -258,8 +264,10 @@ export default {
|
||||||
// and one of them matches the car id entered
|
// and one of them matches the car id entered
|
||||||
navigateAfterSaveToHeritageFunnel(this.$route);
|
navigateAfterSaveToHeritageFunnel(this.$route);
|
||||||
} else {
|
} else {
|
||||||
// and there is no match, navigate to "address-vehicle" page
|
// and there is no match, navigate to "address-vehicles" page
|
||||||
this.$router.navigateAfterSave(this.navigationScenarios.CONTINUING_WITH_MULTIPLE_VEHICLES, this.$route, {}, {}, carsFound);
|
this.$router.navigateAfterSave(this.navigationScenarios.CONTINUING_WITH_MULTIPLE_VEHICLES,
|
||||||
|
this.$route, {}, {},
|
||||||
|
carsFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -296,11 +304,11 @@ export default {
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, this.customerQuestions.addressQuestions.streetAddress);
|
store.commit(storeMutations.UPDATE_REGISTRATION_ADDRESS, this.customerQuestions.addressQuestions.streetAddress);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_CITY, this.customerQuestions.addressQuestions.city);
|
store.commit(storeMutations.UPDATE_REGISTRATION_CITY, this.customerQuestions.addressQuestions.city);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, this.customerQuestions.addressQuestions.state);
|
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, this.customerQuestions.addressQuestions.state);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.customerQuestions.addressQuestions.zipCode);
|
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.customerQuestions.addressQuestions.zip);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, this.customerQuestions.firstName);
|
store.commit(storeMutations.UPDATE_REGISTRATION_FIRST_NAME, this.customerQuestions.firstName);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, this.customerQuestions.lastName);
|
store.commit(storeMutations.UPDATE_REGISTRATION_LAST_NAME, this.customerQuestions.lastName);
|
||||||
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip);
|
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip);
|
||||||
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.email);
|
store.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, this.customerQuestions.emailAddress);
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -345,6 +353,14 @@ export default {
|
||||||
this.displayNonServiceableZipAlert = false;
|
this.displayNonServiceableZipAlert = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
showServiceZipField: {
|
||||||
|
handler(newValue) {
|
||||||
|
// if the Service Zip field is ever hidden, clear out it's value
|
||||||
|
if (!newValue) {
|
||||||
|
this.serviceZip = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,15 @@ export default ({
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setupAddressLookup() {
|
setupAddressLookup() {
|
||||||
|
|
||||||
|
if (this.addressModel.streetAddress !== null &
|
||||||
|
this.addressModel.city !== null &
|
||||||
|
this.addressModel.state !== null &
|
||||||
|
this.addressModel.zip !== null) {
|
||||||
|
|
||||||
|
this.showAddressFields = true;
|
||||||
|
}
|
||||||
|
|
||||||
const addressField1 = document.getElementById("autocomplete");
|
const addressField1 = document.getElementById("autocomplete");
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,14 +147,14 @@ export const mutations = {
|
||||||
updateServiceLocationZipCode(state, serviceLocationZipCode){
|
updateServiceLocationZipCode(state, serviceLocationZipCode){
|
||||||
state.order.serviceLocation.zipCode = serviceLocationZipCode;
|
state.order.serviceLocation.zipCode = serviceLocationZipCode;
|
||||||
},
|
},
|
||||||
updateRegistrationCity(state, serviceCity){
|
updateRegistrationCity(state, registrationCity){
|
||||||
state.order.serviceLocation.city = serviceCity;
|
state.order.vehicle.registration.city = registrationCity;
|
||||||
},
|
},
|
||||||
updateRegistrationFirstName(state, firstName){
|
updateRegistrationFirstName(state, firstName){
|
||||||
state.order.serviceLocation.firstName = firstName;
|
state.order.vehicle.registration.firstName = firstName;
|
||||||
},
|
},
|
||||||
updateRegistrationLastName(state, lastName){
|
updateRegistrationLastName(state, lastName){
|
||||||
state.order.serviceLocation.lastName = lastName;
|
state.order.vehicle.registration.lastName = lastName;
|
||||||
},
|
},
|
||||||
updateCustomerEmailAddress(state, customerEmailAddress){
|
updateCustomerEmailAddress(state, customerEmailAddress){
|
||||||
state.order.customer.emailAddress = customerEmailAddress;
|
state.order.customer.emailAddress = customerEmailAddress;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue