Merge pull request #690 from Safelite/feature/richardson/misc2-style-fixes

format only
This commit is contained in:
brich1212safe 2024-05-07 16:15:57 -04:00 committed by GitHub
commit 336d28b718
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,7 +55,7 @@ import {
deductibleForSelectedVehicle, deductibleForSelectedVehicle,
endorsementsForSelectedVehicle, endorsementsForSelectedVehicle,
noCoverageForSelectedVehicle, noCoverageForSelectedVehicle,
repairWaivedForSelectedVehicle, repairWaivedForSelectedVehicle
} from '@/helpers/policy-vehicle-helper'; } from '@/helpers/policy-vehicle-helper';
export default { export default {
@ -66,13 +66,11 @@ export default {
vehicleBanner, vehicleBanner,
policyVehiclesQuestion, policyVehiclesQuestion,
// eslint-disable-next-line vue/no-reserved-component-names // eslint-disable-next-line vue/no-reserved-component-names
Form, Form
}, },
mixins: [BaseFormMixin], mixins: [BaseFormMixin],
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
const cmsContentPromise = await fetchCmsContentForPage( const cmsContentPromise = await fetchCmsContentForPage(to.query.issPage);
to.query.issPage
);
next((vm) => { next((vm) => {
vm.setCmsContent(cmsContentPromise); vm.setCmsContent(cmsContentPromise);
}); });
@ -90,8 +88,8 @@ export default {
displayGeneric: true, displayGeneric: true,
policyVinFound: true, policyVinFound: true,
rules: { rules: {
optionRequired: globalRules.OPTION_REQUIRED, optionRequired: globalRules.OPTION_REQUIRED
}, }
}; };
}, },
computed: { computed: {
@ -108,7 +106,7 @@ export default {
vehicle: v, vehicle: v,
Text: `${v.vehicleYear} ${v.vehicleMake} ${v.vehicleModel}`, Text: `${v.vehicleYear} ${v.vehicleMake} ${v.vehicleModel}`,
Name: v.vin, Name: v.vin,
SubText: `VIN ${vinStart}${vinEnd}`, SubText: `VIN ${vinStart}${vinEnd}`
}; };
}) ?? []; }) ?? [];
return mappedData; return mappedData;
@ -126,11 +124,9 @@ export default {
return repairWaivedForSelectedVehicle(this.selectedPolicyVehicle); return repairWaivedForSelectedVehicle(this.selectedPolicyVehicle);
}, },
selectedVehicle() { selectedVehicle() {
const vehicle = this.mainStore.lookupVehicleByVin( const vehicle = this.mainStore.lookupVehicleByVin(this.selectedVehicleVin);
this.selectedVehicleVin
);
return vehicle; return vehicle;
}, }
}, },
watch: { watch: {
async selectedVehicleVin(value) { async selectedVehicleVin(value) {
@ -154,12 +150,10 @@ export default {
// save selected vehicle to the store // save selected vehicle to the store
this.mainStore.updateVehicle(vehicle.data); this.mainStore.updateVehicle(vehicle.data);
this.displayGeneric = false; this.displayGeneric = false;
this.selectedPolicyVehicle = this.policyVehicles.find( this.selectedPolicyVehicle = this.policyVehicles.find((p) => p.vin === value);
(p) => p.vin === value
);
} }
} }
}, }
}, },
beforeMount() { beforeMount() {
if (this.mainStore.order.vehicle.vin) { if (this.mainStore.order.vehicle.vin) {
@ -177,16 +171,9 @@ export default {
); );
}, },
async forwardButtonAction() { async forwardButtonAction() {
if ( if (this.selectedVehicleVin !== vehicleSelectionOptions.VEHICLE_NOT_LISTED) {
this.selectedVehicleVin !== const vehicleLookupResponse = await this.lookupVehicleByVin(this.selectedVehicleVin);
vehicleSelectionOptions.VEHICLE_NOT_LISTED const vehicle = this.policyVehicles.find((pv) => pv.vin === this.selectedVehicleVin);
) {
const vehicleLookupResponse = await this.lookupVehicleByVin(
this.selectedVehicleVin
);
const vehicle = this.policyVehicles.find(
(pv) => pv.vin === this.selectedVehicleVin
);
if (vehicleLookupResponse.error) { if (vehicleLookupResponse.error) {
if (vehicleLookupResponse.status === 404) { if (vehicleLookupResponse.status === 404) {
@ -202,18 +189,16 @@ export default {
vin: vehicle.vin, vin: vehicle.vin,
noCoverage: this.noCoverageForSelectedVehicle, noCoverage: this.noCoverageForSelectedVehicle,
deductible: this.deductibleForSelectedVehicle, deductible: this.deductibleForSelectedVehicle,
repairWaived: this.repairWaivedForSelectedVehicle, repairWaived: this.repairWaivedForSelectedVehicle
}); });
this.policyVinFound = false; this.policyVinFound = false;
return this.navigateForward(); return this.navigateForward();
} }
this.mainStore.setBailout( this.mainStore.setBailout(bailoutMessage.vehicleLookupError(
bailoutMessage.vehicleLookupError( vehicle.vin,
vehicle.vin, vehicleLookupResponse.data
vehicleLookupResponse.data ));
)
);
return this.navigateForward(); return this.navigateForward();
} }
@ -225,7 +210,7 @@ export default {
noCoverage: this.noCoverageForSelectedVehicle, noCoverage: this.noCoverageForSelectedVehicle,
deductible: this.deductibleForSelectedVehicle, deductible: this.deductibleForSelectedVehicle,
repairWaived: this.repairWaivedForSelectedVehicle, repairWaived: this.repairWaivedForSelectedVehicle,
endorsements: this.endorsementsForSelectedVehicle, endorsements: this.endorsementsForSelectedVehicle
} }
); );
@ -241,24 +226,16 @@ export default {
{}, {},
{} {}
); );
} else if ( } else if (this.selectedVehicleVin === vehicleSelectionOptions.VEHICLE_NOT_LISTED) {
this.selectedVehicleVin ===
vehicleSelectionOptions.VEHICLE_NOT_LISTED
) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios.CLICKED_FORWARD_NON_LISTED_VEHICLE, this.navigationScenarios.CLICKED_FORWARD_NON_LISTED_VEHICLE,
this.$route, this.$route,
{}, {},
{} {}
); );
} else if ( } else if (this.endorsementsForSelectedVehicle?.length > 0
this.endorsementsForSelectedVehicle?.length > 0 && && (this.endorsementsForSelectedVehicle?.includes(endorsementOptions.PARKING_GUARD)
(this.endorsementsForSelectedVehicle?.includes( || this.endorsementsForSelectedVehicle?.includes(endorsementOptions.EDUCATOR))
endorsementOptions.PARKING_GUARD
) ||
this.endorsementsForSelectedVehicle?.includes(
endorsementOptions.EDUCATOR
))
) { ) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios.CLICKED_FORWARD_WITH_ENDORSEMENTS, this.navigationScenarios.CLICKED_FORWARD_WITH_ENDORSEMENTS,
@ -266,8 +243,7 @@ export default {
); );
} else if (!this.policyVinFound) { } else if (!this.policyVinFound) {
this.$router.navigate( this.$router.navigate(
this.navigationScenarios this.navigationScenarios.CLICKED_FORWARD_WITH_CAR_ID_NOT_FOUND,
.CLICKED_FORWARD_WITH_CAR_ID_NOT_FOUND,
this.$route, this.$route,
{}, {},
{} {}
@ -288,11 +264,11 @@ export default {
return { return {
error: true, error: true,
status: responseError.status, status: responseError.status,
data: responseError.data, data: responseError.data
}; };
} }
}, }
}, }
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>