Merge pull request #747 from Safelite/feature/richardson/SSR-1349
format only
This commit is contained in:
commit
26d4ba7bc4
1 changed files with 27 additions and 35 deletions
|
|
@ -89,7 +89,7 @@ import settleAllPromises from '@/helpers/layout-helper';
|
|||
import routerParams from '@/router/router-constants/router-params';
|
||||
import {
|
||||
getDamageString,
|
||||
isGlassAvailableForCarId,
|
||||
isGlassAvailableForCarId
|
||||
} from '@/helpers/damage-helper';
|
||||
|
||||
import vinPagesMixin from '@/mixins/vin-pages-mixin';
|
||||
|
|
@ -105,7 +105,7 @@ export default {
|
|||
customerQuestions,
|
||||
alert,
|
||||
// eslint-disable-next-line vue/no-reserved-component-names
|
||||
Form,
|
||||
Form
|
||||
},
|
||||
mixins: [baseFormMixin, vinPagesMixin],
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -116,8 +116,8 @@ export default {
|
|||
const promiseResultMap = [
|
||||
{
|
||||
resultKey: 'cmsContent',
|
||||
promise: cmsContentPromise,
|
||||
},
|
||||
promise: cmsContentPromise
|
||||
}
|
||||
];
|
||||
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
|
@ -138,7 +138,7 @@ export default {
|
|||
isCarIdDifferent: false,
|
||||
isSelectedGlassAvailableForVehicle: true,
|
||||
customAlertData: {},
|
||||
forwardButtonCarStyle: '',
|
||||
forwardButtonCarStyle: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -198,20 +198,18 @@ export default {
|
|||
useMainStore().order.vehicle.make
|
||||
} ${useMainStore().order.vehicle.model}`;
|
||||
return vinYmmFound.toLowerCase() === vinYmmExpected.toLowerCase();
|
||||
},
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
customerQuestions: {
|
||||
handler() {
|
||||
// if they modify one of the lookup fields (address, city, state, zipCode, or lastName),
|
||||
// then modify the button text back to "Get my personalized quote"
|
||||
this.$refs.siteFooter.updateButtonText(
|
||||
this.getCmsContent('siteFooterWidget', 'ForwardButtonText')
|
||||
);
|
||||
this.$refs.siteFooter.updateButtonText(this.getCmsContent('siteFooterWidget', 'ForwardButtonText'));
|
||||
this.resetWarningsAndErrors();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.attachCustomEvents();
|
||||
|
|
@ -242,15 +240,15 @@ export default {
|
|||
licenseStreetAddress:
|
||||
this.customerQuestions.addressQuestions.streetAddress,
|
||||
licenseZip: this.customerQuestions.addressQuestions.zipCode,
|
||||
licenseState: this.customerQuestions.addressQuestions.state,
|
||||
licenseState: this.customerQuestions.addressQuestions.state
|
||||
});
|
||||
|
||||
// Settle promises and get results
|
||||
const promiseResultMap = [
|
||||
{
|
||||
resultKey: 'vinLookupResponse',
|
||||
promise: vinLookupResponse,
|
||||
},
|
||||
promise: vinLookupResponse
|
||||
}
|
||||
];
|
||||
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
|
@ -272,8 +270,8 @@ export default {
|
|||
this.isCarIdDifferent =
|
||||
carFound.carId !== useMainStore().order.vehicle.carId;
|
||||
if (
|
||||
this.isCarIdDifferent &&
|
||||
carFound.carId !== this.previouslyEnteredCarId
|
||||
this.isCarIdDifferent
|
||||
&& carFound.carId !== this.previouslyEnteredCarId
|
||||
) {
|
||||
// Display Alert
|
||||
this.previouslyEnteredCarId = carFound.carId;
|
||||
|
|
@ -291,28 +289,24 @@ export default {
|
|||
// Update button "Continue with..."
|
||||
this.$refs.siteFooter
|
||||
// eslint-disable-next-line max-len
|
||||
.updateButtonText(
|
||||
`Continue with ${carFound.year} ${carFound.make} ${carFound.model} ${this.forwardButtonCarStyle}`
|
||||
);
|
||||
.updateButtonText(`Continue with ${carFound.year} ${carFound.make} ${carFound.model} ${this.forwardButtonCarStyle}`);
|
||||
return this.$refs.siteFooter.removeLoader();
|
||||
}
|
||||
|
||||
// update data
|
||||
vehicleInfoToCommit = Object.assign(carFound, {
|
||||
vin: carsFound[0].vin,
|
||||
vin: carsFound[0].vin
|
||||
});
|
||||
} else if (carsFound.length > 1) {
|
||||
// If multiple cars were found and one and only one of them matches the carId entered, save the vehicle info
|
||||
const matchingCars = carsFound.filter(
|
||||
(vin) =>
|
||||
vin.vehicle.carId === useMainStore().order.vehicle.carId
|
||||
);
|
||||
const matchingCars = carsFound.filter((vin) =>
|
||||
vin.vehicle.carId === useMainStore().order.vehicle.carId);
|
||||
|
||||
if (matchingCars.length === 1) {
|
||||
vehicleInfoToCommit = Object.assign(
|
||||
matchingCars[0].vehicle,
|
||||
{
|
||||
vin: matchingCars[0].vin,
|
||||
vin: matchingCars[0].vin
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -341,8 +335,8 @@ export default {
|
|||
city: this.customerQuestions.addressQuestions.city,
|
||||
state: this.customerQuestions.addressQuestions.state,
|
||||
zipCode:
|
||||
this.customerQuestions.addressQuestions.zipCode,
|
||||
},
|
||||
this.customerQuestions.addressQuestions.zipCode
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
|
|
@ -351,17 +345,15 @@ export default {
|
|||
},
|
||||
async navigateForward(carsFound) {
|
||||
// Match vehicles found to vehicles in state.
|
||||
const matchingCars = carsFound.filter(
|
||||
(car) =>
|
||||
car.vehicle.carId === useMainStore().order.vehicle.carId
|
||||
);
|
||||
const matchingCars = carsFound.filter((car) =>
|
||||
car.vehicle.carId === useMainStore().order.vehicle.carId);
|
||||
|
||||
// If a different vehicle is found than the one entered and the selected glass
|
||||
// is not available for that vehicle then navigate back to "vehicle-damage"
|
||||
// display vehicle changed alert on that page.
|
||||
if (
|
||||
this.isCarIdDifferent &&
|
||||
!this.isSelectedGlassAvailableForVehicle
|
||||
this.isCarIdDifferent
|
||||
&& !this.isSelectedGlassAvailableForVehicle
|
||||
) {
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
|
||||
|
|
@ -387,7 +379,7 @@ export default {
|
|||
this.displayMatchedDifferentVehicleAlert = false;
|
||||
this.displayVinLookupByHomeAddressNotAllowedAlert = false;
|
||||
this.$refs.siteFooter.enableForwardAction();
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue