cleaning up for another cursorbot run
This commit is contained in:
parent
1b42b423b9
commit
5e60d3ab43
4 changed files with 22 additions and 27 deletions
|
|
@ -319,7 +319,6 @@ export default {
|
||||||
this.setCalendarData(initialData);
|
this.setCalendarData(initialData);
|
||||||
},
|
},
|
||||||
resetComponent() {
|
resetComponent() {
|
||||||
console.log('Resetting Date Picker Component');
|
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
this.selectableDatesData = []; // NOTE: uses monthNum (1-based), NOT monthIndex (0-based)
|
this.selectableDatesData = []; // NOTE: uses monthNum (1-based), NOT monthIndex (0-based)
|
||||||
this.selectableTimeSlotsData = [];
|
this.selectableTimeSlotsData = [];
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ export default {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('Prefixed Alert Reasons:', this.alertReasons);
|
|
||||||
return this.alertReasons.reduce((newObj, alertReason) => {
|
return this.alertReasons.reduce((newObj, alertReason) => {
|
||||||
newObj.push({
|
newObj.push({
|
||||||
cmsWidgetName: `${this.cmsWidgetPrefix}${alertReason}`,
|
cmsWidgetName: `${this.cmsWidgetPrefix}${alertReason}`,
|
||||||
|
|
@ -62,9 +61,6 @@ export default {
|
||||||
initializeComponent(initialData) {
|
initializeComponent(initialData) {
|
||||||
this.alertReasons = initialData;
|
this.alertReasons = initialData;
|
||||||
},
|
},
|
||||||
cmsHeadlineTextFound(widgetName) {
|
|
||||||
return this.getCmsContent(widgetName, 'HeadlineText') !== '';
|
|
||||||
},
|
|
||||||
getCmsCopyForAlertReason(alertReason) {
|
getCmsCopyForAlertReason(alertReason) {
|
||||||
const widgetName = `${this.cmsWidgetPrefix}${alertReason}`;
|
const widgetName = `${this.cmsWidgetPrefix}${alertReason}`;
|
||||||
let content = this.getCmsContent(widgetName, widgetFields.ALERT_WIDGET.HEADLINE_TEXT);
|
let content = this.getCmsContent(widgetName, widgetFields.ALERT_WIDGET.HEADLINE_TEXT);
|
||||||
|
|
|
||||||
|
|
@ -217,13 +217,11 @@ export default {
|
||||||
mixins: [BaseFormMixin],
|
mixins: [BaseFormMixin],
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
// Call APIs
|
// Call APIs
|
||||||
let preSelectedDate = await useMainStore().order.schedule.date;
|
|
||||||
if (!preSelectedDate || preSelectedDate.startTime === null) {
|
|
||||||
preSelectedDate = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||||
const serviceZipCode = useMainStore().order.serviceLocation.zipCode || useMainStore().order.customer.address.zipCode;
|
const storeServiceLocation = useMainStore().order.serviceLocation;
|
||||||
|
const storeSelectedAppointmentType = storeServiceLocation?.appointmentType;
|
||||||
|
const storeSelectedProvider = storeServiceLocation?.provider;
|
||||||
|
const serviceZipCode = storeServiceLocation?.zipCode || useMainStore().order.customer.address.zipCode;
|
||||||
const zipCodeData = getZipCodeData(serviceZipCode);
|
const zipCodeData = getZipCodeData(serviceZipCode);
|
||||||
const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode);
|
const mobileFeePartPromise = getPricedMobileFeePart(serviceZipCode);
|
||||||
const serviceabilityDetailsPromise = getServiceabilityDetails(serviceZipCode);
|
const serviceabilityDetailsPromise = getServiceabilityDetails(serviceZipCode);
|
||||||
|
|
@ -281,8 +279,15 @@ export default {
|
||||||
};
|
};
|
||||||
useMainStore().updateIsSafeliteProvider(true);
|
useMainStore().updateIsSafeliteProvider(true);
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
|
const providerToUse = resultMap.providers?.shopProviders
|
||||||
|
.find((provider) => provider.providerNumber === storeSelectedProvider?.providerNumber) || resultMap.providers?.shopProviders[0];
|
||||||
|
const isMobileAppointment = storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE
|
||||||
|
|| storeSelectedAppointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP;
|
||||||
const initialServiceLocationObj = {
|
const initialServiceLocationObj = {
|
||||||
provider: resultMap.providers?.shopProviders[0],
|
mobileProviderNumber: isMobileAppointment
|
||||||
|
? storeSelectedProvider?.providerNumber
|
||||||
|
: null,
|
||||||
|
provider: isMobileAppointment ? null : providerToUse,
|
||||||
zipCode: useMainStore().order.serviceLocation.zipCode || useMainStore().order.customer.address.zipCode,
|
zipCode: useMainStore().order.serviceLocation.zipCode || useMainStore().order.customer.address.zipCode,
|
||||||
zipCodeCtu: resultMap.zipCodeData?.zipCodeCtu
|
zipCodeCtu: resultMap.zipCodeData?.zipCodeCtu
|
||||||
};
|
};
|
||||||
|
|
@ -302,6 +307,7 @@ export default {
|
||||||
inShopDatesData: [],
|
inShopDatesData: [],
|
||||||
isMobileView: false,
|
isMobileView: false,
|
||||||
mobileDatesData: [],
|
mobileDatesData: [],
|
||||||
|
mobileFeePart: null,
|
||||||
mobilePremiumAppointmentFee: null,
|
mobilePremiumAppointmentFee: null,
|
||||||
mobileProviderNumber: null,
|
mobileProviderNumber: null,
|
||||||
mobileZipCodeOverride: null,
|
mobileZipCodeOverride: null,
|
||||||
|
|
@ -389,6 +395,12 @@ export default {
|
||||||
this.selectableDatesData = initialData.initialShopTimeSlotsResponse;
|
this.selectableDatesData = initialData.initialShopTimeSlotsResponse;
|
||||||
this.$refs.datePicker.setCalendarData(initialData);
|
this.$refs.datePicker.setCalendarData(initialData);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.mobileProviderNumber = initialServiceLocationObj.mobileProviderNumber;
|
||||||
|
await this.getDatePickerInitialData().then((initialData) => {
|
||||||
|
this.selectableDatesData = initialData.initialShopTimeSlotsResponse;
|
||||||
|
this.$refs.datePicker.setCalendarData(initialData);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
appointmentTypeChangedFromServiceLocation(newAppointmentType) {
|
appointmentTypeChangedFromServiceLocation(newAppointmentType) {
|
||||||
|
|
@ -605,12 +617,14 @@ export default {
|
||||||
this.selectedTimeSlotInfo = timeSlot;
|
this.selectedTimeSlotInfo = timeSlot;
|
||||||
this.showDatePickerError = false;
|
this.showDatePickerError = false;
|
||||||
},
|
},
|
||||||
forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
if (!this.isFormValid) {
|
if (!this.isFormValid) {
|
||||||
this.showDatePickerError = true;
|
this.showDatePickerError = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save service location then schedule and navigate forward
|
||||||
|
await this.$refs.serviceLocation.forwardButtonAction();
|
||||||
this.mainStore.saveSchedule(this.selectedTimeSlotInfo.timeSlot);
|
this.mainStore.saveSchedule(this.selectedTimeSlotInfo.timeSlot);
|
||||||
this.$router.navigate(
|
this.$router.navigate(
|
||||||
this.navigationScenarios.CLICKED_FORWARD,
|
this.navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
|
||||||
|
|
@ -876,7 +876,6 @@ export const useMainStore = defineStore({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getMobileTimeSlots(startDate, endDate, zipCodeOverride = null) {
|
getMobileTimeSlots(startDate, endDate, zipCodeOverride = null) {
|
||||||
console.log('Getting mobile time slots with zip code override:', zipCodeOverride);
|
|
||||||
const { order } = this;
|
const { order } = this;
|
||||||
const { vehicle } = this.order;
|
const { vehicle } = this.order;
|
||||||
let lineItems = [
|
let lineItems = [
|
||||||
|
|
@ -2718,19 +2717,6 @@ export const useMainStore = defineStore({
|
||||||
},
|
},
|
||||||
|
|
||||||
saveServiceLocation(serviceLocationInfo) {
|
saveServiceLocation(serviceLocationInfo) {
|
||||||
if (this.order.serviceLocation) {
|
|
||||||
if (
|
|
||||||
serviceLocationInfo.zipCode !== this.order.serviceLocation.zipCode
|
|
||||||
|| !providersEqual(
|
|
||||||
serviceLocationInfo.provider,
|
|
||||||
this.order.serviceLocation.provider
|
|
||||||
)
|
|
||||||
|| serviceLocationInfo.appointmentType
|
|
||||||
!== this.order.serviceLocation.appointmentType
|
|
||||||
) {
|
|
||||||
this.resetSchedule();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.updateServiceLocation(serviceLocationInfo);
|
this.updateServiceLocation(serviceLocationInfo);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue