This commit is contained in:
Michaela Brydon 2024-04-30 10:59:08 -04:00
parent 0970b612eb
commit bc3815a60a

View file

@ -144,11 +144,11 @@ import serviceZipModalQuestion from '@/layouts/service-location/service-zip-moda
// DEFINE VALIDATION RULES // DEFINE VALIDATION RULES
defineRule('mobile-location-required', (value) => { defineRule('mobile-location-required', (value) => {
if ( if (
value.addressQuestions.streetAddress === '' || value.addressQuestions.streetAddress === ''
value.addressQuestions.city === '' || || value.addressQuestions.city === ''
value.addressQuestions.state === '' || || value.addressQuestions.state === ''
value.addressQuestions.zipCode === '' || || value.addressQuestions.zipCode === ''
value.isVehicleProtected == null || value.isVehicleProtected == null
) { ) {
return errorMessages.MOBILE_LOCATION_REQUIRED; return errorMessages.MOBILE_LOCATION_REQUIRED;
} }
@ -176,8 +176,8 @@ export default {
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage); const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
const serviceZipCode = const serviceZipCode =
useMainStore().order.serviceLocation.zipCode || useMainStore().order.serviceLocation.zipCode
useMainStore().order.customer.address.zipCode; || useMainStore().order.customer.address.zipCode;
const zipCodeData = getZipCodeData(serviceZipCode); const zipCodeData = getZipCodeData(serviceZipCode);
const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode); const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode);
@ -219,9 +219,7 @@ export default {
resultMap.mobileFeePart, resultMap.mobileFeePart,
resultMap.shopQuestionInitialData?.mobileProviderNumber resultMap.shopQuestionInitialData?.mobileProviderNumber
); );
vm.$refs.shopQuestion.initializeComponent( vm.$refs.shopQuestion.initializeComponent(resultMap.shopQuestionInitialData);
resultMap.shopQuestionInitialData
);
}); });
}, },
setup() { setup() {
@ -303,10 +301,10 @@ export default {
if (newValue.zipCode !== this.zipCode) { if (newValue.zipCode !== this.zipCode) {
if ( if (
!( !(
this.selectedAppointmentType === this.selectedAppointmentType
AppointmentTypeStrings.MOBILE || === AppointmentTypeStrings.MOBILE
this.selectedAppointmentType === || this.selectedAppointmentType
AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP
) )
) { ) {
this.selectedAppointmentType = null; this.selectedAppointmentType = null;
@ -318,8 +316,8 @@ export default {
isServiceableMobile() { isServiceableMobile() {
if (this.isRecalibrationServiceableMobile !== null) { if (this.isRecalibrationServiceableMobile !== null) {
return ( return (
this.isGlassServiceableMobile && this.isGlassServiceableMobile
this.isRecalibrationServiceableMobile && this.isRecalibrationServiceableMobile
); );
} }
return this.isGlassServiceableMobile; return this.isGlassServiceableMobile;
@ -327,8 +325,8 @@ export default {
isServiceableInshop() { isServiceableInshop() {
if (this.isRecalibrationServiceableInshop !== null) { if (this.isRecalibrationServiceableInshop !== null) {
return ( return (
this.isGlassServiceableInshop && this.isGlassServiceableInshop
this.isRecalibrationServiceableInshop && this.isRecalibrationServiceableInshop
); );
} }
@ -336,8 +334,8 @@ export default {
}, },
isShopQuestionDisplayed() { isShopQuestionDisplayed() {
return ( return (
this.selectedAppointmentType === 'Inshop' || this.selectedAppointmentType === 'Inshop'
this.selectedAppointmentType === 'Dropoff' || this.selectedAppointmentType === 'Dropoff'
); );
}, },
isAppointmentTypeDisplayed() { isAppointmentTypeDisplayed() {
@ -345,18 +343,18 @@ export default {
}, },
isMobileLocationDisplayed() { isMobileLocationDisplayed() {
return ( return (
this.selectedAppointmentType === this.selectedAppointmentType
AppointmentTypeStrings.MOBILE || === AppointmentTypeStrings.MOBILE
this.selectedAppointmentType === || this.selectedAppointmentType
AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP
); );
}, },
requiresInshopRecalibration() { requiresInshopRecalibration() {
// Specifically check for isRecalibrationServiceableMobile === false, not null or true. // Specifically check for isRecalibrationServiceableMobile === false, not null or true.
return ( return (
this.isServiceableInshop && this.isServiceableInshop
this.isGlassServiceableMobile && && this.isGlassServiceableMobile
this.isRecalibrationServiceableMobile === false && this.isRecalibrationServiceableMobile === false
); );
}, },
displayMilitaryZipAlert() { displayMilitaryZipAlert() {
@ -370,9 +368,9 @@ export default {
}, },
displayServiceableInshopOnly() { displayServiceableInshopOnly() {
return ( return (
!this.displayRecalibrationWarning && !this.displayRecalibrationWarning
this.isServiceableInshop && && this.isServiceableInshop
!this.isServiceableMobile && !this.isServiceableMobile
); );
}, },
displayServiceableMobileOnly() { displayServiceableMobileOnly() {
@ -388,8 +386,8 @@ export default {
methods: { methods: {
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
return ( return (
useMainStore().lineItems.supportingItems !== null && useMainStore().lineItems.supportingItems !== null
useMainStore().order.serviceLocation.zipCode !== null && useMainStore().order.serviceLocation.zipCode !== null
); );
}, },
async reloadShopData(zipCode) { async reloadShopData(zipCode) {
@ -447,14 +445,14 @@ export default {
}, },
getServiceStateFromStore() { getServiceStateFromStore() {
return ( return (
useMainStore().order.serviceLocation.state || useMainStore().order.serviceLocation.state
useMainStore().order.customer.address.state || useMainStore().order.customer.address.state
); );
}, },
getServiceZipCodeFromStore() { getServiceZipCodeFromStore() {
return ( return (
useMainStore().order.serviceLocation.zipCode || useMainStore().order.serviceLocation.zipCode
useMainStore().order.customer.address.zipCode || useMainStore().order.customer.address.zipCode
); );
}, },
getIsVehicleProtectedFromStore() { getIsVehicleProtectedFromStore() {