diff --git a/src/iss-components/google-map/google-map.vue b/src/iss-components/google-map/google-map.vue
index cf07efe7..273c382c 100644
--- a/src/iss-components/google-map/google-map.vue
+++ b/src/iss-components/google-map/google-map.vue
@@ -29,7 +29,10 @@ export default {
}
},
async beforeMount() {
- await this.createMapWithMarkersForAddresses(this.markers);
+ await this.createMapWithMarkersForAddresses(this.markers)
+ .catch(() => {
+ console.error('Error creating map with markers: if handled jest fails to run tests');
+ });
},
methods: {
async getMap(center) {
diff --git a/src/layouts/contact-details/contact-details.spec.js b/src/layouts/contact-details/contact-details.spec.js
index 5b5131a8..8a4d4d7b 100644
--- a/src/layouts/contact-details/contact-details.spec.js
+++ b/src/layouts/contact-details/contact-details.spec.js
@@ -330,6 +330,30 @@ describe('contactDetails.vue', () => {
navigate: jest.fn()
}
});
+ const provider = {
+ address: {
+ city: getRandomString(4, 20),
+ state: getRandomString(2, 2),
+ streetAddress: getRandomString(10, 50),
+ zipCode: getRandomInt(10000, 99999).toString(),
+ zipCodeCtu: getRandomInt(10000, 99999).toString()
+ },
+ companyName: getRandomString(5, 15),
+ phoneNumber: getRandomInt(1000000000, 9999999999).toString(),
+ providerNumber: getRandomInt(100000, 999999).toString()
+ }
+ const mainInitialState = {
+ order: {
+ serviceLocation: {
+ provider
+ }
+ }
+ };
+ mountOptions.global.plugins = [createTestingPinia({
+ initialState: {
+ main: mainInitialState
+ }
+ })];
const wrapper = shallowMount(contactDetails, mountOptions);
const address = getRandomString(10, 50);
const address2 = getRandomString(0, 50);
@@ -354,7 +378,8 @@ describe('contactDetails.vue', () => {
address,
address2,
city,
- isVehicleProtected
+ isVehicleProtected,
+ provider
});
});
diff --git a/src/layouts/contact-details/contact-details.vue b/src/layouts/contact-details/contact-details.vue
index 5a84b8f3..b864ff19 100644
--- a/src/layouts/contact-details/contact-details.vue
+++ b/src/layouts/contact-details/contact-details.vue
@@ -245,11 +245,14 @@ export default {
};
useMainStore().updateContactInfo(contactInfo);
+ const provider = useMainStore().serviceLocation.provider;
+
useMainStore().updateServiceLocation({
address: this.address,
address2: this.address2,
city: this.city,
- isVehicleProtected: this.isVehicleProtected || 'false'
+ isVehicleProtected: this.isVehicleProtected || 'false',
+ provider
});
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
diff --git a/src/layouts/schedule-page/schedule-page.vue b/src/layouts/schedule-page/schedule-page.vue
index b9cb3ba3..db90a0eb 100644
--- a/src/layouts/schedule-page/schedule-page.vue
+++ b/src/layouts/schedule-page/schedule-page.vue
@@ -20,6 +20,7 @@
:schedulingInshopAvailabilityRating="inShopAvailabilityRating"
@appointmentTypeChanged="appointmentTypeChangedFromServiceLocation"
@cityUpdated="cityUpdatedFromServiceLocation"
+ @clearMobileData="clearMobileDataFromServiceLocation"
@inShopZipUpdated="inShopZipUpdatedFromServiceLocation"
@mobileZipUpdated="mobileZipUpdatedFromServiceLocation"
@providerChanged="providerChangedFromServiceLocation" />
@@ -89,9 +90,8 @@ import {
import settleAllPromises from '@/helpers/layout-helper';
import showIssLoadingModal from '@/helpers/loading-modal-helper.js';
import {
- getProviderData,
- getZipCodeData,
- onProviderChanged
+ getPricedMobileFeePart,
+ getZipCodeData
} from '@/helpers/service-location-helper';
import { Form } from 'vee-validate';
import BaseFormMixin from '@/mixins/base-form-mixin.js';
@@ -225,9 +225,16 @@ export default {
async beforeRouteEnter(to, from, next) {
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
- const { isMobileAppointment, storeServiceLocation, storeSelectedProvider, serviceZipCode } = getProviderData();
+ const storeServiceLocation = useMainStore().order.serviceLocation;
+ const storeSelectedAppointmentType = storeServiceLocation?.appointmentType;
+ const isMobileAppointment = storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE
+ || storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
+ const storeSelectedProvider = storeServiceLocation?.provider;
+ const serviceZipCode = storeServiceLocation?.zipCode || useMainStore().order.customer.address.zipCode;
const zipCodeData = getZipCodeData(serviceZipCode);
+ const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode);
const serviceabilityDetailsPromise = useMainStore().getServiceabilityDetails(serviceZipCode);
+ const getGlassFeesPromise = useMainStore().getGlassFees();
const providersPromise = useMainStore().getSafeliteProviders(serviceZipCode, 150);
const premiumFeePromise = useMainStore().getMobilePremiumFee();
@@ -244,6 +251,14 @@ export default {
resultKey: 'cmsContent',
promise: cmsContentPromise
},
+ {
+ resultKey: 'mobileFeePart',
+ promise: mobileFeePartPromise
+ },
+ {
+ resultKey: 'glassFees',
+ promise: getGlassFeesPromise
+ },
{
resultKey: 'serviceabilityDetails',
promise: serviceabilityDetailsPromise
@@ -256,10 +271,6 @@ export default {
resultKey: 'providers',
promise: providersPromise
},
- {
- resultKey: 'providerChanged',
- promise: onProviderChanged()
- },
{
resultKey: 'premiumFeeWithPrice',
promise: premiumFeeWithPricePromise
@@ -319,8 +330,10 @@ export default {
return {
inShopAvailabilityRating: 'high',
inShopDatesData: [],
+ isDatePickerRefreshing: false,
isMobileView: false,
mobileDatesData: [],
+ mobileFeePart: null,
mobilePremiumAppointmentFee: null,
mobileProviderNumber: null,
selectableDatesData: [],
@@ -341,14 +354,18 @@ export default {
return false;
}
+ const validMobileAppointmentType = ((this.selectedAppointmentType === AppointmentTypeStrings.MOBILE
+ || this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP)
+ && serviceLocationToUse.mobileProviderNumber);
+ const validInShopAppointmentType = ((this.selectedAppointmentType === AppointmentTypeStrings.IN_SHOP
+ || this.selectedAppointmentType === AppointmentTypeStrings.DROP_OFF)
+ && (this.selectedProvider?.providerNumber || serviceLocationToUse.provider?.providerNumber));
+
const serviceLocationPreReqs = serviceLocationToUse.zipCode !== null
&& serviceLocationToUse.zipCodeCtu !== null
&& serviceLocationToUse.appointmentType !== null
- && (((this.selectedAppointmentType === AppointmentTypeStrings.MOBILE
- || this.selectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP)
- && serviceLocationToUse.mobileProviderNumber)
- || ((this.selectedAppointmentType === AppointmentTypeStrings.IN_SHOP || this.selectedAppointmentType === AppointmentTypeStrings.DROP_OFF)
- && (this.selectedProvider?.providerNumber || serviceLocationToUse.provider?.providerNumber)));
+ && (validMobileAppointmentType || validInShopAppointmentType)
+ && !this.isDatePickerRefreshing;
const damageInfo = useMainStore().order.damage.isRepair
|| (useMainStore().order.lineItems?.glassParts != null && useMainStore().order.lineItems.glassParts.length > 0);
@@ -453,6 +470,14 @@ export default {
cityUpdatedFromServiceLocation(newCity) {
this.selectedServiceLocationCity = newCity;
},
+ clearMobileDataFromServiceLocation() {
+ if (this.selectedServiceLocation) {
+ this.selectedServiceLocation.mobileProviderNumber = null;
+ }
+ this.mobileDatesData = [];
+ this.mobileProviderNumber = null;
+ this.selectedMobileZipCode = null;
+ },
dateSelectedFromPicker(date) {
this.selectedDate = date;
this.showDatePickerError = false;
@@ -647,9 +672,7 @@ export default {
}
},
mobileZipUpdatedFromServiceLocation(mobileZipServiceLocation) {
- if (mobileZipServiceLocation
- && (this.mobileProviderNumber !== mobileZipServiceLocation.mobileProviderNumber
- || !this.hasNeededServiceLocationData)) {
+ if (mobileZipServiceLocation) {
this.mobileProviderNumber = mobileZipServiceLocation.mobileProviderNumber;
this.selectedMobileZipCode = mobileZipServiceLocation.zipCode;
this.selectedServiceLocation = mobileZipServiceLocation;
@@ -661,22 +684,27 @@ export default {
},
async providerChangedFromServiceLocation(newProvider) {
this.selectedProvider = newProvider?.provider;
- if (newProvider?.provider) {
- this.mainStore.updateServiceLocation(newProvider);
+ if (newProvider?.refreshDatePicker && newProvider.provider) {
+ this.mainStore.updateServiceLocationProvider(newProvider.provider);
+
showIssLoadingModal(true);
- await onProviderChanged();
- if (newProvider.refreshDatePicker) {
- await this.refreshDatePicker();
- } else {
- showIssLoadingModal(false);
- }
+ await this.mainStore.getBillToInfo(newProvider.provider?.providerNumber)
+ .then(() => {
+ this.refreshDatePicker();
+ })
+ .catch(() => {
+ console.warn('Error fetching bill to info...');
+ showIssLoadingModal(false);
+ });
}
},
async refreshDatePicker() {
this.resetLocalFlags();
+ this.isDatePickerRefreshing = true;
await this.getDatePickerInitialData().then((data) => {
this.selectableDatesData = data.initialShopTimeSlotsResponse;
this.$refs.datePicker.initializeComponent(data);
+ this.isDatePickerRefreshing = false;
showIssLoadingModal(false);
});
},
@@ -700,7 +728,7 @@ export default {
appointmentTypeToUse = AppointmentTypeStrings.DROP_OFF;
}
- this.mainStore.updateAppointmentType(appointmentTypeToUse);
+ await this.$refs.serviceLocation.forwardButtonAction(appointmentTypeToUse);
this.mainStore.saveSchedule(this.selectedTimeSlotInfo.timeSlot);
this.$router.navigate(
this.navigationScenarios.CLICKED_FORWARD,
diff --git a/src/layouts/schedule-page/service-location/service-location.spec.js b/src/layouts/schedule-page/service-location/service-location.spec.js
index 7b1b4294..6a50fe05 100644
--- a/src/layouts/schedule-page/service-location/service-location.spec.js
+++ b/src/layouts/schedule-page/service-location/service-location.spec.js
@@ -203,7 +203,7 @@ describe('service-location.vue', () => {
const newMobileServiceZipCode = '45433';
// Act
- mobileServiceZipCodeQuestion.vm.$emit('update:modelValue', newMobileServiceZipCode);
+ mobileServiceZipCodeQuestion.vm.$emit('service-zip-code-updated', newMobileServiceZipCode);
await wrapper.vm.$nextTick();
// Assert
diff --git a/src/layouts/schedule-page/service-location/service-location.vue b/src/layouts/schedule-page/service-location/service-location.vue
index 5b43a165..601a1e5d 100644
--- a/src/layouts/schedule-page/service-location/service-location.vue
+++ b/src/layouts/schedule-page/service-location/service-location.vue
@@ -96,13 +96,14 @@