CASH-353 - Redoing 353 revert branch to get merged to develop

This commit is contained in:
Minojhini Valaiyapathi 2025-04-17 09:27:13 -04:00
parent f06da57711
commit 76b058077b
4 changed files with 39 additions and 22 deletions

View file

@ -172,7 +172,7 @@ export default {
}, },
serviceZipCode: this.getServiceZipFromStore(), serviceZipCode: this.getServiceZipFromStore(),
carId: this.getCarIdfromStore(), carId: this.getCarIdfromStore(),
isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), isHeavyTruck: this.getIsVehicleHeavyTruckServiceableFromStore(),
displayNonServiceableZipAlert: false, displayNonServiceableZipAlert: false,
displayVinNotFoundAlert: false, displayVinNotFoundAlert: false,
displayMatchedDifferentVehicleAlert: false, displayMatchedDifferentVehicleAlert: false,
@ -232,8 +232,8 @@ export default {
getCarIdfromStore() { getCarIdfromStore() {
return store.getters.vehicle.carId; return store.getters.vehicle.carId;
}, },
getIsVehicleHeavyTruckFromStore() { getIsVehicleHeavyTruckServiceableFromStore() {
return store.getters.isHeavyTruckVehicle; return store.getters.vehicle.isBigTruck && store.getters.vehicle.canSafeliteService;
}, },
async findClosestApplicableShops() { async findClosestApplicableShops() {
return await this.dispatchStoreActionWithLogging( return await this.dispatchStoreActionWithLogging(

View file

@ -76,7 +76,6 @@
:manualCopy="AlertMatchedDifferentVehicleBody" :manualCopy="AlertMatchedDifferentVehicleBody"
alertClass="alert-warning" alertClass="alert-warning"
v-bind:isDismissible="false" /> v-bind:isDismissible="false" />
<alert <alert
ref="AlertNoService" ref="AlertNoService"
v-if="displayNoServiceAlert" v-if="displayNoServiceAlert"
@ -90,7 +89,7 @@
cmsWidgetName="FunnelFooterWidget" cmsWidgetName="FunnelFooterWidget"
:isForwardActionDisabled="!meta.valid" :isForwardActionDisabled="!meta.valid"
@back-clicked="backButtonAction" @back-clicked="backButtonAction"
@ForwardClicked="forwardButtonAction" /> @ForwardClicked="forwardButtonAction || displayNoServiceAlert" />
</div> </div>
</div> </div>
</div> </div>
@ -167,7 +166,7 @@ export default {
emailOrSms: this.getEmailOrSmsFromStore(), emailOrSms: this.getEmailOrSmsFromStore(),
serviceZipCode: this.getServiceZipFromStore(), serviceZipCode: this.getServiceZipFromStore(),
carId: this.getCarIdfromStore(), carId: this.getCarIdfromStore(),
isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), isHeavyTruck: this.getIsVehicleHeavyTruckServiceableFromStore(),
displayNonServiceableZipAlert: false, displayNonServiceableZipAlert: false,
displayVinNotFoundAlert: false, displayVinNotFoundAlert: false,
displayMatchedDifferentVehicleAlert: false, displayMatchedDifferentVehicleAlert: false,
@ -214,8 +213,8 @@ export default {
getCarIdfromStore() { getCarIdfromStore() {
return store.getters.vehicle.carId; return store.getters.vehicle.carId;
}, },
getIsVehicleHeavyTruckFromStore() { getIsVehicleHeavyTruckServiceableFromStore() {
return store.getters.isHeavyTruckVehicle; return store.getters.vehicle.isBigTruck && store.getters.vehicle.canSafeliteService;
}, },
async findClosestApplicableShops() { async findClosestApplicableShops() {
return await this.dispatchStoreActionWithLogging( return await this.dispatchStoreActionWithLogging(

View file

@ -119,7 +119,7 @@ export default {
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
emailOrSms: this.getEmailOrSmsFromStore(), emailOrSms: this.getEmailOrSmsFromStore(),
carId: this.getCarIdfromStore(), carId: this.getCarIdfromStore(),
isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), isHeavyTruck: this.getIsVehicleHeavyTruckServiceableFromStore(),
displayInvalidZipAlert: false, displayInvalidZipAlert: false,
displayNonServiceableZipAlert: false, displayNonServiceableZipAlert: false,
displayNoServiceAlert: false, displayNoServiceAlert: false,
@ -198,8 +198,8 @@ export default {
getCarIdfromStore() { getCarIdfromStore() {
return store.getters.vehicle.carId; return store.getters.vehicle.carId;
}, },
getIsVehicleHeavyTruckFromStore() { getIsVehicleHeavyTruckServiceableFromStore() {
return store.getters.isHeavyTruckVehicle; return store.getters.vehicle.isBigTruck && store.getters.vehicle.canSafeliteService;
}, },
async findClosestApplicableShops() { async findClosestApplicableShops() {
return await this.dispatchStoreActionWithLogging( return await this.dispatchStoreActionWithLogging(
@ -208,6 +208,7 @@ export default {
"service-zip" "service-zip"
); );
}, },
async backButtonAction() { async backButtonAction() {
const skipVin = await skipVinLookup(); const skipVin = await skipVinLookup();
// route to move backwards // route to move backwards
@ -286,6 +287,16 @@ export default {
return this.$refs.navbar.removeLoader(); return this.$refs.navbar.removeLoader();
} }
} }
if (this.isHeavyTruck) {
const closestShops = await this.findClosestApplicableShops(
this.serviceZipCode,
this.carId
);
this.displayNoServiceAlert = !closestShops?.data?.providers?.length;
if (this.displayNoServiceAlert) {
return this.$refs.navbar.removeLoader();
}
}
const payment = this.$store.getters.payment; const payment = this.$store.getters.payment;
const policy = this.$store.getters.policy; const policy = this.$store.getters.policy;
@ -344,6 +355,7 @@ export default {
serviceZipCode() { serviceZipCode() {
this.displayNonServiceableZipAlert = false; this.displayNonServiceableZipAlert = false;
this.displayNoServiceAlert = false; this.displayNoServiceAlert = false;
this.displayNoServiceAlert = false;
}, },
}, },
components: { components: {

View file

@ -208,7 +208,7 @@ export default {
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode,
emailOrSms: this.getEmailOrSmsFromStore(), emailOrSms: this.getEmailOrSmsFromStore(),
carId: this.getCarIdfromStore(), carId: this.getCarIdfromStore(),
isHeavyTruck: this.getIsVehicleHeavyTruckFromStore(), isHeavyTruck: this.getIsVehicleHeavyTruckServiceableFromStore(),
isCarIdDifferent: false, isCarIdDifferent: false,
customAlertData: {}, customAlertData: {},
previouslyEnteredCarId: "", previouslyEnteredCarId: "",
@ -264,6 +264,9 @@ export default {
); );
} }
}, },
getIsVehicleHeavyTruckServiceableFromStore() {
return store.getters.vehicle.isBigTruck && store.getters.vehicle.canSafeliteService;
},
async findClosestApplicableShops() { async findClosestApplicableShops() {
return await this.dispatchStoreActionWithLogging( return await this.dispatchStoreActionWithLogging(
storeActions.GET_CLOSEST_APPLICABLE_SHOPS, storeActions.GET_CLOSEST_APPLICABLE_SHOPS,
@ -366,6 +369,18 @@ export default {
}, },
false false
); );
if (this.isHeavyTruck) {
closestShops = await this.findClosestApplicableShops(
this.serviceZipCode,
this.carId
);
this.displayNoServiceAlert = !closestShops?.data?.providers?.length;
if (this.displayNoServiceAlert) {
return this.$refs.navbar.removeLoader();
}
}
// if no value due to field being optional, blank both phone and email address
// if no value due to field being optional, blank both phone and email address // if no value due to field being optional, blank both phone and email address
if (!this.emailOrSms) { if (!this.emailOrSms) {
@ -430,16 +445,6 @@ export default {
false false
); );
} }
closestShops = await this.findClosestApplicableShops(
this.serviceZipCode,
this.carId
);
this.displayNoServiceAlert = !closestShops?.data?.providers?.length;
if (this.displayNoServiceAlert) {
return this.$refs.navbar.removeLoader();
}
// if no value due to field being optional, blank both phone and email address // if no value due to field being optional, blank both phone and email address
if (!this.emailOrSms) { if (!this.emailOrSms) {
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
@ -523,6 +528,7 @@ export default {
this.displayVinNotFoundAlert = false; this.displayVinNotFoundAlert = false;
this.displayVinScanFailedAlert = false; this.displayVinScanFailedAlert = false;
this.displayNoServiceAlert = false; this.displayNoServiceAlert = false;
this.displayNoServiceAlert = false;
}, },
}, },
mounted() { mounted() {