add big truck no service alert to vin/license/address lookup, remove bailout

This commit is contained in:
Katie Kroell 2025-09-08 11:51:12 -04:00
parent 8dcca6951d
commit 490641ceba
6 changed files with 79 additions and 9 deletions

View file

@ -2,7 +2,8 @@ const vehicleLookupAlertTypes = Object.freeze({
NOT_FOUND: 'notFound', NOT_FOUND: 'notFound',
NOT_MATCHED: 'notMatched', NOT_MATCHED: 'notMatched',
TWO_IDENTICAL_YMM_MATCHED: 'twoIdenticalYMMMatched', TWO_IDENTICAL_YMM_MATCHED: 'twoIdenticalYMMMatched',
PERFECT_MATCH: 'perfectMatch' PERFECT_MATCH: 'perfectMatch',
NO_SERVICE: 'noService'
}); });
export default vehicleLookupAlertTypes; export default vehicleLookupAlertTypes;

View file

@ -53,6 +53,13 @@
cmsWidgetName="AlertVinLookupsByHomeAddressNotAllowedWidget" cmsWidgetName="AlertVinLookupsByHomeAddressNotAllowedWidget"
alertClass="alert-danger" alertClass="alert-danger"
:isDismissible="false" /> :isDismissible="false" />
<alert
v-if="displayNoServiceAlert"
ref="AlertNoService"
class="mt-5"
cmsWidgetName="AlertNoServiceWidget"
alertClass="alert-danger"
:isDismissable="false" />
<customerQuestions <customerQuestions
ref="customerQuestions" ref="customerQuestions"
v-model="customerQuestions" /> v-model="customerQuestions" />
@ -137,7 +144,8 @@ export default {
isCarIdDifferent: false, isCarIdDifferent: false,
isSelectedGlassAvailableForVehicle: true, isSelectedGlassAvailableForVehicle: true,
customAlertData: {}, customAlertData: {},
forwardButtonCarStyle: '' forwardButtonCarStyle: '',
displayNoServiceAlert: false
}; };
}, },
computed: { computed: {
@ -255,6 +263,15 @@ export default {
return this.$refs.siteFooter.removeLoader(); return this.$refs.siteFooter.removeLoader();
} }
// Check if vehicle is a non-servicable big truck
if (resultMap.vinLookupResponse.isBigTruck && !resultMap.vinLookupResponse.canSafeliteService) {
this.displayNoServiceAlert = true;
this.resetVehicleFromLookup();
this.$refs.siteFooter.disableForwardButton();
this.$refs.siteFooter.removeLoader();
return;
}
const carsFound = resultMap.vinLookupResponse.vinVehicles; const carsFound = resultMap.vinLookupResponse.vinVehicles;
// Handle cases for different amounts of VINS found for the address. // Handle cases for different amounts of VINS found for the address.
@ -370,6 +387,7 @@ export default {
this.displayVinNotFoundAlert = false; this.displayVinNotFoundAlert = false;
this.displayMatchedDifferentVehicleAlert = false; this.displayMatchedDifferentVehicleAlert = false;
this.displayVinLookupByHomeAddressNotAllowedAlert = false; this.displayVinLookupByHomeAddressNotAllowedAlert = false;
this.displayNoServiceAlert = false;
this.$refs.siteFooter.enableForwardAction(); this.$refs.siteFooter.enableForwardAction();
} }
} }

View file

@ -47,6 +47,13 @@
:manualCopy="AlertMatchedTwoIdenticalYMMVehicleBody" :manualCopy="AlertMatchedTwoIdenticalYMMVehicleBody"
alertClass="alert-warning" alertClass="alert-warning"
:isDismissible="false" /> :isDismissible="false" />
<alert
v-if="displayNoServiceAlert"
ref="AlertNoService"
class="mt-5 mb-5"
cmsWidgetName="AlertNoServiceWidget"
alertClass="alert-danger"
:isDismissable="false" />
<textboxQuestion <textboxQuestion
id="license-plate-question-wrapper" id="license-plate-question-wrapper"
v-model="licensePlate" v-model="licensePlate"
@ -156,7 +163,8 @@ export default {
isCarIdDifferent: false, isCarIdDifferent: false,
customAlertData: {}, customAlertData: {},
isSelectedGlassAvailableForVehicle: true, isSelectedGlassAvailableForVehicle: true,
forwardButtonCarStyle: '' forwardButtonCarStyle: '',
displayNoServiceAlert: false
}; };
}, },
computed: { computed: {
@ -299,6 +307,14 @@ export default {
return this.$refs.siteFooter.removeLoader(); return this.$refs.siteFooter.removeLoader();
} }
// Check if vehicle is a non-servicable big truck
if (vehicleFromLookup.isBigTruck && !vehicleFromLookup.canSafeliteService) {
this.displayNoServiceAlert = true;
this.resetVehicleFromLookup();
this.$refs.siteFooter.disableForwardButton();
return this.$refs.siteFooter.removeLoader();
}
// Save vehicle, license plate, and registration information // Save vehicle, license plate, and registration information
useMainStore().saveRegistrationLicensePlateLookup({ useMainStore().saveRegistrationLicensePlateLookup({
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle, isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
@ -333,6 +349,7 @@ export default {
resetWarningsAndErrors() { resetWarningsAndErrors() {
this.displayVinNotFoundAlert = false; this.displayVinNotFoundAlert = false;
this.displayMatchedDifferentVehicleAlert = false; this.displayMatchedDifferentVehicleAlert = false;
this.displayNoServiceAlert = false;
} }
} }
}; };

View file

@ -0,0 +1,26 @@
<template>
<alert
id="no-service-alert"
alertClass="alert-danger"
cmsWidgetName="AlertNoServiceWidget"
aria-label="no-service-alert" />
</template>
<script>
import alert from '@/ux-components/alert/alert.vue';
export default {
name: 'no-service-alert',
components: {
alert
},
inject: ['vehicleFromLookup']
};
</script>
<style>
/**
Override wrong margin-bottom rule in the Alert component.
*/
#no-service-alert p:last-of-type {
margin-bottom: 0 !important;
}
</style>

View file

@ -10,6 +10,8 @@
v-else-if="isVehicleNotMatchedVisible" /> v-else-if="isVehicleNotMatchedVisible" />
<perfectMatchAlert <perfectMatchAlert
v-else-if="isPerfectMatchVisible" /> v-else-if="isPerfectMatchVisible" />
<noServiceAlert
v-else-if="isNoServiceVisible" />
</div> </div>
</template> </template>
<script> <script>
@ -19,6 +21,7 @@ import vehicleNotMatchedAlert from '@/layouts/vin-lookup/vin-lookup-alerts/vehic
import twoIdenticalYMMVehicleAlert from import twoIdenticalYMMVehicleAlert from
'@/layouts/vin-lookup/vin-lookup-alerts/two-identical-ymm-vehicle-alert/two-identical-ymm-vehicle-alert.vue'; '@/layouts/vin-lookup/vin-lookup-alerts/two-identical-ymm-vehicle-alert/two-identical-ymm-vehicle-alert.vue';
import perfectMatchAlert from '@/layouts/vin-lookup/vin-lookup-alerts//perfect-match-alert/perfect-match-alert.vue'; import perfectMatchAlert from '@/layouts/vin-lookup/vin-lookup-alerts//perfect-match-alert/perfect-match-alert.vue';
import noServiceAlert from './no-service-alert/no-service-alert.vue';
export default { export default {
name: 'vin-lookup-alerts', name: 'vin-lookup-alerts',
@ -26,7 +29,8 @@ export default {
vehicleNotFoundAlert, vehicleNotFoundAlert,
vehicleNotMatchedAlert, vehicleNotMatchedAlert,
twoIdenticalYMMVehicleAlert, twoIdenticalYMMVehicleAlert,
perfectMatchAlert perfectMatchAlert,
noServiceAlert
}, },
props: { props: {
activeAlertType: { activeAlertType: {
@ -51,6 +55,9 @@ export default {
isPerfectMatchVisible() { isPerfectMatchVisible() {
return this.activeAlertType === vehicleLookupAlertTypes.PERFECT_MATCH; return this.activeAlertType === vehicleLookupAlertTypes.PERFECT_MATCH;
}, },
isNoServiceVisible() {
return this.activeAlertType === vehicleLookupAlertTypes.NO_SERVICE;
},
wrapperCssClass() { wrapperCssClass() {
return { return {
'mb-5': this.activeAlertType !== null 'mb-5': this.activeAlertType !== null

View file

@ -196,14 +196,15 @@ export default {
return; return;
} }
if (!vehicleLookupResponse.data.canSafeliteService) { // Check if vehicle is a non-servicable big truck
this.mainStore.setBailout(bailoutMessage.HeavyTruckVehicle(vehicleLookupResponse.data.carId)); if (vehicleLookupResponse.data.isBigTruck && !vehicleLookupResponse.data.canSafeliteService) {
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD_WITH_BAILOUT, this.$route); this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.NO_SERVICE;
this.resetVehicleFromLookup();
this.$refs.siteFooter.disableForwardButton();
this.$refs.siteFooter.removeLoader();
return; return;
} }
this.mainStore.resetBailout();
// Add vin bcs the response from the service doesn't contain vin // Add vin bcs the response from the service doesn't contain vin
this.vehicleFromLookup = Object.assign( this.vehicleFromLookup = Object.assign(
vehicleLookupResponse.data, vehicleLookupResponse.data,