Revert "Halfway through - highly notated fields"
This reverts commit ece57def13.
This commit is contained in:
parent
ece57def13
commit
9e79accb3a
1 changed files with 29 additions and 27 deletions
|
|
@ -209,11 +209,9 @@ export default {
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
MatchedDifferentVehicleAlertBody(){
|
MatchedDifferentVehicleAlertBody(){
|
||||||
const text = this.getCmsContent("MatchedDifferentVehicle", "BodyText")
|
const text = this.getCmsContent("MatchedDifferentVehicle",
|
||||||
.replaceAll("{custom:damage}", getDamageString())
|
"BodyText").replaceAll("{custom:damage}", getDamageString()).replaceAll("{custom:vinlookupYear}", this.customAlertData?.vehicleInfo?.year).replaceAll("{custom:vinlookupMake}", this.customAlertData?.vehicleInfo?.make).replaceAll("{custom:vinlookupModel}",
|
||||||
.replaceAll("{custom:vinlookupYear}", this.customAlertData?.vehicleInfo?.year)
|
this.customAlertData?.vehicleInfo?.model);
|
||||||
.replaceAll("{custom:vinlookupMake}", this.customAlertData?.vehicleInfo?.make)
|
|
||||||
.replaceAll("{custom:vinlookupModel}", this.customAlertData?.vehicleInfo?.model);
|
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
|
|
@ -289,43 +287,47 @@ export default {
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const zipValidation = this.validateZip(this.zip);
|
const zipValidation = this.validateZip(this.zip);
|
||||||
const vehicleLookup = this.lookupVehicle(this.vin);
|
const vehicleLookup = this.lookupVehicle(this.vin);
|
||||||
// await responses below to let above service calls run asynchronously
|
|
||||||
const zipValidationResponse = await zipValidation;
|
const zipValidationResponse = await zipValidation;
|
||||||
const vehicleLookupResponse = await vehicleLookup.catch(() => {
|
const vehicleLookupResponse = await vehicleLookup.catch(() => {
|
||||||
|
this.vinNotFound = true;
|
||||||
|
this.$refs.funnelFooter.removeLoader();
|
||||||
|
this.noServiceZip = false;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
// validations
|
if (!vehicleLookupResponse) {
|
||||||
if (!vehicleLookupResponse) { // vehicle response is null or false (it fails)
|
return;
|
||||||
this.vinNotFound = true; // used to determine alerts that show
|
}
|
||||||
|
if (!zipValidationResponse.data.isServiceable) {
|
||||||
|
this.customAlertData.zip = this.zip;
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.noServiceZip = false; // used to determine alerts that show
|
this.noServiceZip = true;
|
||||||
} else if (!zipValidationResponse.data.isServiceable) { // zip response shows zip is not serviceable
|
this.invalidZip = this.zip;
|
||||||
this.$refs.funnelFooter.removeLoader();
|
return;
|
||||||
this.noServiceZip = true; // used to determine alerts that show
|
}
|
||||||
this.invalidZip = this.zip; // used to populate the alert
|
this.isCarIdDifferent = vehicleLookupResponse.data.carId !== store.getters.vehicle.carId;
|
||||||
} else if (vehicleLookupResponse.data.carId !== store.getters.vehicle.carId && // response does not match what was selected previously in the flow &&
|
|
||||||
(vehicleLookupResponse.data.carId !== this.previouslyEnteredCarId)) // response does not match what was returned from a previous response
|
if (this.isCarIdDifferent && (vehicleLookupResponse.data.carId !== this.previouslyEnteredCarId)) {
|
||||||
{
|
this.previouslyEnteredCarId = vehicleLookupResponse.data.carId;
|
||||||
this.isCarIdDifferent = true; // because vehicleLookupResponse.data.carId !== store.getters.vehicle.carId
|
this.noServiceZip = false;
|
||||||
this.previouslyEnteredCarId = vehicleLookupResponse.data.carId; // tracks if car ID is different since last time we got a vehicle lookup response
|
this.customAlertData.vehicleInfo = vehicleLookupResponse.data;
|
||||||
this.noServiceZip = false; // used to determine alerts that show
|
|
||||||
this.customAlertData.vehicleInfo = vehicleLookupResponse.data; // populate the vehicle info alert info
|
|
||||||
this.$refs.funnelFooter.updateButtonText(`Continue with ${vehicleLookupResponse.data.year} ${vehicleLookupResponse.data.make} ${vehicleLookupResponse.data.model}`);
|
this.$refs.funnelFooter.updateButtonText(`Continue with ${vehicleLookupResponse.data.year} ${vehicleLookupResponse.data.make} ${vehicleLookupResponse.data.model}`);
|
||||||
this.isVinValid = true; //I don't think this line is needed
|
this.isVinValid = true;
|
||||||
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookupResponse.data.carId);
|
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(vehicleLookupResponse.data.carId);
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
} else {
|
this.isCarIdDifferent = true;
|
||||||
this.isCarIdDifferent = vehicleLookupResponse.data.carId !== store.getters.vehicle.carId; // do I need this line? -- I do
|
return;
|
||||||
this.updateStore(vehicleLookupResponse.data, zipValidationResponse.data);
|
|
||||||
this.navigateForward();
|
|
||||||
}
|
}
|
||||||
|
this.updateStore(vehicleLookupResponse.data, zipValidationResponse.data);
|
||||||
|
this.navigateForward();
|
||||||
},
|
},
|
||||||
navigateForward(){
|
navigateForward(){
|
||||||
if(this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle){ // does it matter if the carId is different here? would we ever go forward if we didn't have glass match? -- it does
|
if(this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle){
|
||||||
this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, { displayVehicleChangeAlert: true }, {});
|
this.$router.navigateAfterSave(this.navigationScenarios.CLICKED_FORWARD, this.$route, {}, { displayVehicleChangeAlert: true }, {});
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.$refs.loadingModal.showModal();
|
this.$refs.loadingModal.showModal();
|
||||||
navigateAfterSaveToHeritageFunnel(this.$route);
|
navigateAfterSaveToHeritageFunnel(this.$route);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
validateZip(zip) {
|
validateZip(zip) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue