Merge pull request #2625 from Safelite/feature/CASH-845-stage-2
CASH-845 more updates & fixes
This commit is contained in:
commit
785224c972
4 changed files with 96 additions and 64 deletions
|
|
@ -142,7 +142,7 @@
|
||||||
overnightDropOffCmsWidgetName="OvernightDropOffTimeSlotModal"
|
overnightDropOffCmsWidgetName="OvernightDropOffTimeSlotModal"
|
||||||
dropOffOrPickATimeQuestionCmsWidgetName="DropOffOrPickATimeQuestionWidget"
|
dropOffOrPickATimeQuestionCmsWidgetName="DropOffOrPickATimeQuestionWidget"
|
||||||
:selectedDate="selectedDate"
|
:selectedDate="selectedDate"
|
||||||
:appointmentType="appointmentType"
|
:appointmentType="appointmentTypeForTimeSlotQuestion"
|
||||||
:premiumAppointmentFee="premiumAppointmentFee"
|
:premiumAppointmentFee="premiumAppointmentFee"
|
||||||
:displayWaitList="displayWaitList"
|
:displayWaitList="displayWaitList"
|
||||||
:timeSlotsForSelectedDate="timeSlotsForSelectedDate"
|
:timeSlotsForSelectedDate="timeSlotsForSelectedDate"
|
||||||
|
|
@ -166,7 +166,7 @@ import {
|
||||||
MONTHS_OF_YEAR,
|
MONTHS_OF_YEAR,
|
||||||
DAYS_OF_WEEK,
|
DAYS_OF_WEEK,
|
||||||
} from "@/digital-components/date-picker/mixins/constants";
|
} from "@/digital-components/date-picker/mixins/constants";
|
||||||
import { PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings, PREMIUM_FEE_PART_TYPE } from "@/constants/schedule-constants";
|
||||||
import {
|
import {
|
||||||
selectableDaysOptions,
|
selectableDaysOptions,
|
||||||
requiredParameter,
|
requiredParameter,
|
||||||
|
|
@ -224,7 +224,7 @@ export default {
|
||||||
pricingByDayUpcharge: Number,
|
pricingByDayUpcharge: Number,
|
||||||
isPricingByDayExperiment: Boolean,
|
isPricingByDayExperiment: Boolean,
|
||||||
timeSlotsForSelectedDate: Object,
|
timeSlotsForSelectedDate: Object,
|
||||||
appointmentType: String,
|
appointmentTypeForTimeSlotQuestion: String,
|
||||||
premiumAppointmentFee: Object,
|
premiumAppointmentFee: Object,
|
||||||
estimatedServiceMinutesMinimum: Number,
|
estimatedServiceMinutesMinimum: Number,
|
||||||
estimatedServiceMinutesMaximum: Number,
|
estimatedServiceMinutesMaximum: Number,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { RouteCodeFlags } from "@/constants/schedule-constants";
|
||||||
|
|
||||||
export async function getAlertReasons(ctu) {
|
export async function getAlertReasons(ctu) {
|
||||||
const alertReasons = await baseMixin.methods.dispatchStoreActionWithLogging(
|
const alertReasons = await baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
|
|
@ -60,3 +61,13 @@ export function militaryToTwelveHourTime(timeString) {
|
||||||
|
|
||||||
return `${hours}:${minutes} ${meridianNotation}`;
|
return `${hours}:${minutes} ${meridianNotation}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function isDropOffRouteCode(routeCode) {
|
||||||
|
if (!routeCode) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF) ||
|
||||||
|
routeCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
<div class="row justify-content-center appointment-type">
|
<div class="row justify-content-center appointment-type">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<appointmentTypeQuestion
|
<appointmentTypeQuestion
|
||||||
v-model="selectedAppointmentType"
|
v-model="appointmentTypeFromAppointmentTypeQuestion"
|
||||||
v-show="isAppointmentTypeDisplayed"
|
v-show="isAppointmentTypeDisplayed"
|
||||||
:isServiceableMobile="isServiceableMobile"
|
:isServiceableMobile="isServiceableMobile"
|
||||||
:isServiceableInshop="isServiceableInshop"
|
:isServiceableInshop="isServiceableInshop"
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
<div class="row justify-content-center your-shop-location">
|
<div class="row justify-content-center your-shop-location">
|
||||||
<div class="col-md-6 col-xl-4">
|
<div class="col-md-6 col-xl-4">
|
||||||
<button-question
|
<button-question
|
||||||
v-if="selectedAppointmentType == appointmentTypeStrings.IN_SHOP"
|
v-if="appointmentType == appointmentTypeStrings.IN_SHOP"
|
||||||
class="shop-question-button"
|
class="shop-question-button"
|
||||||
ref="buttonQuestion"
|
ref="buttonQuestion"
|
||||||
:answers="selectedShopAnswer"
|
:answers="selectedShopAnswer"
|
||||||
|
|
@ -105,7 +105,7 @@
|
||||||
</div>
|
</div>
|
||||||
<shopQuestionPopup
|
<shopQuestionPopup
|
||||||
modalWidgetName="ShopQuestionPopupWidget"
|
modalWidgetName="ShopQuestionPopupWidget"
|
||||||
:selectedAppointmentType="selectedAppointmentType"
|
:appointmentType="appointmentType"
|
||||||
:modelValue="{
|
:modelValue="{
|
||||||
zipCode: zipCode,
|
zipCode: zipCode,
|
||||||
providerNumber: selectedProvider?.providerNumber,
|
providerNumber: selectedProvider?.providerNumber,
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
<locationAlerts cmsWidgetPrefix="LocationAlert-" ref="locationAlerts" />
|
<locationAlerts cmsWidgetPrefix="LocationAlert-" ref="locationAlerts" />
|
||||||
|
|
||||||
<datePicker
|
<datePicker
|
||||||
v-show="selectedAppointmentType"
|
v-show="appointmentType"
|
||||||
customComponentId="dateQuestion"
|
customComponentId="dateQuestion"
|
||||||
selectableDatesSetting="custom"
|
selectableDatesSetting="custom"
|
||||||
ref="datePicker"
|
ref="datePicker"
|
||||||
|
|
@ -145,11 +145,11 @@
|
||||||
:showPricingByDay="showPricingByDay"
|
:showPricingByDay="showPricingByDay"
|
||||||
:isPricingByDayExperiment="isPricingByDayExperiment"
|
:isPricingByDayExperiment="isPricingByDayExperiment"
|
||||||
:timeSlotsForSelectedDate="timeSlotsForSelectedDate"
|
:timeSlotsForSelectedDate="timeSlotsForSelectedDate"
|
||||||
:appointmentType="selectedAppointmentType"
|
:appointmentTypeForTimeSlotQuestion="appointmentType"
|
||||||
:premiumAppointmentFee="mobilePremiumAppointmentFee"
|
:premiumAppointmentFee="mobilePremiumAppointmentFee"
|
||||||
:estimatedServiceMinutesMinimum="getServiceMinutesMin"
|
:estimatedServiceMinutesMinimum="getServiceMinutesMin"
|
||||||
:estimatedServiceMinutesMaximum="getServiceMinutesMax"
|
:estimatedServiceMinutesMaximum="getServiceMinutesMax"
|
||||||
@TimeSlotSelected="updateTimeSlot"
|
@timeSlotSelected="updateTimeSlot"
|
||||||
:displayWaitList="displayWaitList"
|
:displayWaitList="displayWaitList"
|
||||||
@waitListRequested="handleWaitListRequested" />
|
@waitListRequested="handleWaitListRequested" />
|
||||||
<navbar
|
<navbar
|
||||||
|
|
@ -218,6 +218,7 @@ import {
|
||||||
calcDaysBetweenDates,
|
calcDaysBetweenDates,
|
||||||
convertDateStringToDate,
|
convertDateStringToDate,
|
||||||
sumDateString,
|
sumDateString,
|
||||||
|
isDropOffRouteCode,
|
||||||
} from "@/layouts/schedule/helpers/schedule-helper";
|
} from "@/layouts/schedule/helpers/schedule-helper";
|
||||||
|
|
||||||
import { DAYS_OF_WEEK } from "@/digital-components/date-picker/mixins/constants";
|
import { DAYS_OF_WEEK } from "@/digital-components/date-picker/mixins/constants";
|
||||||
|
|
@ -408,7 +409,8 @@ export default {
|
||||||
isRecalibrationServiceableDropoff: null,
|
isRecalibrationServiceableDropoff: null,
|
||||||
isGlassServiceableMobile: null,
|
isGlassServiceableMobile: null,
|
||||||
isRecalibrationServiceableMobile: null,
|
isRecalibrationServiceableMobile: null,
|
||||||
selectedAppointmentType: this.getSelectedAppointmentType(),
|
appointmentType: this.getAppointmentType(),
|
||||||
|
appointmentTypeFromAppointmentTypeQuestion: this.getAppointmentType(),
|
||||||
selectedProvider: this.getSelectedProvider(),
|
selectedProvider: this.getSelectedProvider(),
|
||||||
mobileFeePart: null,
|
mobileFeePart: null,
|
||||||
recycleFeePart: null,
|
recycleFeePart: null,
|
||||||
|
|
@ -459,7 +461,7 @@ export default {
|
||||||
const priceStringIntegerRoundedDown = priceString?.split(".")[0]; // same method used as getDisplayPrice() in service-package-radio used on /quote
|
const priceStringIntegerRoundedDown = priceString?.split(".")[0]; // same method used as getDisplayPrice() in service-package-radio used on /quote
|
||||||
const pricingByDayBasePrice = parseInt(priceStringIntegerRoundedDown);
|
const pricingByDayBasePrice = parseInt(priceStringIntegerRoundedDown);
|
||||||
let includePricingByDayUpcharge = false;
|
let includePricingByDayUpcharge = false;
|
||||||
let selectedAppointmentType = store.getters.order.serviceLocation.appointmentType;
|
let appointmentType = store.getters.order.serviceLocation.appointmentType;
|
||||||
|
|
||||||
// Check to see if date should be pre-selected
|
// Check to see if date should be pre-selected
|
||||||
let preSelectedSlot = await store.getters.order.schedule;
|
let preSelectedSlot = await store.getters.order.schedule;
|
||||||
|
|
@ -468,7 +470,7 @@ export default {
|
||||||
if (preSelectedSlot.date && preSelectedSlot.date.length > 0) {
|
if (preSelectedSlot.date && preSelectedSlot.date.length > 0) {
|
||||||
preSelectedDate = preSelectedSlot.date;
|
preSelectedDate = preSelectedSlot.date;
|
||||||
|
|
||||||
if (selectedAppointmentType === AppointmentTypeStrings.MOBILE) {
|
if (appointmentType === AppointmentTypeStrings.MOBILE) {
|
||||||
preSelectedDate += "-mobile";
|
preSelectedDate += "-mobile";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -607,7 +609,7 @@ export default {
|
||||||
vm.pricingByDayUpcharge = pricingByDayUpcharge;
|
vm.pricingByDayUpcharge = pricingByDayUpcharge;
|
||||||
vm.showPricingByDay = showPricingByDay;
|
vm.showPricingByDay = showPricingByDay;
|
||||||
|
|
||||||
vm.selectedAppointmentType = selectedAppointmentType;
|
vm.appointmentType = appointmentType;
|
||||||
vm.setData(
|
vm.setData(
|
||||||
resultMap.zipCodeData,
|
resultMap.zipCodeData,
|
||||||
resultMap.serviceabilityDetails,
|
resultMap.serviceabilityDetails,
|
||||||
|
|
@ -661,7 +663,7 @@ export default {
|
||||||
set: function (newValue) {
|
set: function (newValue) {
|
||||||
if (newValue.zipCode !== this.zipCode) {
|
if (newValue.zipCode !== this.zipCode) {
|
||||||
this.resetMobileLocation();
|
this.resetMobileLocation();
|
||||||
this.selectedAppointmentType = null;
|
this.appointmentType = null;
|
||||||
this.selectedProvider = new Provider();
|
this.selectedProvider = new Provider();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -673,7 +675,7 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
isMobileSelected() {
|
isMobileSelected() {
|
||||||
return this.selectedAppointmentType == AppointmentTypeStrings.MOBILE;
|
return this.appointmentType == AppointmentTypeStrings.MOBILE;
|
||||||
},
|
},
|
||||||
isServiceableMobile() {
|
isServiceableMobile() {
|
||||||
if (this.isRecalibrationServiceableMobile !== null) {
|
if (this.isRecalibrationServiceableMobile !== null) {
|
||||||
|
|
@ -751,10 +753,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isShopQuestionDisplayed() {
|
isShopQuestionDisplayed() {
|
||||||
return (
|
return this.appointmentType === "Inshop" || this.appointmentType === "Dropoff";
|
||||||
this.selectedAppointmentType === "Inshop" ||
|
|
||||||
this.selectedAppointmentType === "Dropoff"
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
isAppointmentTypeDisplayed() {
|
isAppointmentTypeDisplayed() {
|
||||||
// temporary adjustment
|
// temporary adjustment
|
||||||
|
|
@ -816,7 +815,7 @@ export default {
|
||||||
availabilityRatingCallback: getAvailabilityRating,
|
availabilityRatingCallback: getAvailabilityRating,
|
||||||
startDate: formattedStartDate,
|
startDate: formattedStartDate,
|
||||||
endDate: formattedEndDate,
|
endDate: formattedEndDate,
|
||||||
shopAppointmentType: this.selectedAppointmentType,
|
shopAppointmentType: this.appointmentType,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
selectedShopAnswer() {
|
selectedShopAnswer() {
|
||||||
|
|
@ -1035,7 +1034,7 @@ export default {
|
||||||
getIsVehicleProtectedFromStore() {
|
getIsVehicleProtectedFromStore() {
|
||||||
return store.getters.order.serviceLocation.isVehicleProtected;
|
return store.getters.order.serviceLocation.isVehicleProtected;
|
||||||
},
|
},
|
||||||
getSelectedAppointmentType() {
|
getAppointmentType() {
|
||||||
return store.getters.order.serviceLocation.appointmentType;
|
return store.getters.order.serviceLocation.appointmentType;
|
||||||
},
|
},
|
||||||
getSelectedProvider() {
|
getSelectedProvider() {
|
||||||
|
|
@ -1067,8 +1066,7 @@ export default {
|
||||||
},
|
},
|
||||||
updateAndSaveIsMSRFeeApplicable() {
|
updateAndSaveIsMSRFeeApplicable() {
|
||||||
const isMSRFeeApplicable =
|
const isMSRFeeApplicable =
|
||||||
this.isMobileStaticRecalibrationApplicable &&
|
this.isMobileStaticRecalibrationApplicable && this.appointmentType == "Mobile";
|
||||||
this.selectedAppointmentType == "Mobile";
|
|
||||||
this.dispatchStoreAction(
|
this.dispatchStoreAction(
|
||||||
this.storeActions.SAVE_IS_MSR_FEE_APPLICABLE,
|
this.storeActions.SAVE_IS_MSR_FEE_APPLICABLE,
|
||||||
isMSRFeeApplicable
|
isMSRFeeApplicable
|
||||||
|
|
@ -1104,7 +1102,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we have a mobile fee, then save/update supporting items
|
// if we have a mobile fee, then save/update supporting items
|
||||||
if (this.selectedAppointmentType == "Mobile") {
|
if (this.appointmentType == "Mobile") {
|
||||||
const mobileFeeIndex = supportingItems.findIndex(
|
const mobileFeeIndex = supportingItems.findIndex(
|
||||||
(item) => item.partType == MOBILE_FEE_PART_TYPE
|
(item) => item.partType == MOBILE_FEE_PART_TYPE
|
||||||
);
|
);
|
||||||
|
|
@ -1241,7 +1239,7 @@ export default {
|
||||||
getSelectedDate() {
|
getSelectedDate() {
|
||||||
let isMobileSelected = this.isMobileSelected;
|
let isMobileSelected = this.isMobileSelected;
|
||||||
if (isMobileSelected === undefined) {
|
if (isMobileSelected === undefined) {
|
||||||
isMobileSelected = this.selectedAppointmentType === AppointmentTypeStrings.MOBILE;
|
isMobileSelected = this.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||||
}
|
}
|
||||||
let storedDate = store.getters.order.schedule.date;
|
let storedDate = store.getters.order.schedule.date;
|
||||||
if (isMobileSelected) storedDate += "-mobile";
|
if (isMobileSelected) storedDate += "-mobile";
|
||||||
|
|
@ -1277,7 +1275,10 @@ export default {
|
||||||
timeSlotInfo.timeSlot.date
|
timeSlotInfo.timeSlot.date
|
||||||
)}`;
|
)}`;
|
||||||
|
|
||||||
if (this.selectedAppointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF) {
|
if (
|
||||||
|
this.appointmentType === AppointmentTypeStrings.IN_SHOP ||
|
||||||
|
this.appointmentType === AppointmentTypeStrings.DROP_OFF
|
||||||
|
) {
|
||||||
if (
|
if (
|
||||||
!timeSlotInfo.timeSlot.routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)
|
!timeSlotInfo.timeSlot.routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF)
|
||||||
) {
|
) {
|
||||||
|
|
@ -1286,7 +1287,7 @@ export default {
|
||||||
)}`;
|
)}`;
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
this.selectedAppointmentType === AppointmentTypeStrings.MOBILE &&
|
this.appointmentType === AppointmentTypeStrings.MOBILE &&
|
||||||
!timeSlotInfo.isPremiumAppointment
|
!timeSlotInfo.isPremiumAppointment
|
||||||
) {
|
) {
|
||||||
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
|
navbarButtonText += ` at ${this.getDisplayTextForMilitaryTime(
|
||||||
|
|
@ -1341,7 +1342,7 @@ export default {
|
||||||
this.navigatingForward = true;
|
this.navigatingForward = true;
|
||||||
var ctu = this.zipCodeCtu;
|
var ctu = this.zipCodeCtu;
|
||||||
if (
|
if (
|
||||||
this.selectedAppointmentType == AppointmentTypeStrings.MOBILE &&
|
this.appointmentType == AppointmentTypeStrings.MOBILE &&
|
||||||
this.selectedProvider &&
|
this.selectedProvider &&
|
||||||
this.selectedProvider.address
|
this.selectedProvider.address
|
||||||
) {
|
) {
|
||||||
|
|
@ -1366,7 +1367,7 @@ export default {
|
||||||
state: this.state,
|
state: this.state,
|
||||||
zipCode: this.zipCode,
|
zipCode: this.zipCode,
|
||||||
zipCodeCtu: ctu,
|
zipCodeCtu: ctu,
|
||||||
appointmentType: this.selectedAppointmentType,
|
appointmentType: this.appointmentType,
|
||||||
isVehicleProtected: this.isVehicleProtected,
|
isVehicleProtected: this.isVehicleProtected,
|
||||||
provider: {
|
provider: {
|
||||||
providerNumber: this.selectedProvider?.providerNumber,
|
providerNumber: this.selectedProvider?.providerNumber,
|
||||||
|
|
@ -1451,7 +1452,7 @@ export default {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.selectedAppointmentType == AppointmentTypeStrings.MOBILE) {
|
if (this.appointmentType == AppointmentTypeStrings.MOBILE) {
|
||||||
//navigate to mobile details page
|
//navigate to mobile details page
|
||||||
this.$router.navigateWithSaving(
|
this.$router.navigateWithSaving(
|
||||||
this.navigationScenarios.CLICKED_FORWARD_WITH_MOBILE_SERVICE,
|
this.navigationScenarios.CLICKED_FORWARD_WITH_MOBILE_SERVICE,
|
||||||
|
|
@ -1526,7 +1527,7 @@ export default {
|
||||||
|
|
||||||
// if we have a premium fee(early bird), then save/update supporting items
|
// if we have a premium fee(early bird), then save/update supporting items
|
||||||
if (
|
if (
|
||||||
this.selectedAppointmentType === AppointmentTypeStrings.MOBILE &&
|
this.appointmentType === AppointmentTypeStrings.MOBILE &&
|
||||||
this.selectedTimeSlotInfo?.isPremiumAppointment
|
this.selectedTimeSlotInfo?.isPremiumAppointment
|
||||||
) {
|
) {
|
||||||
const premiumFeeIndex = supportingItems.findIndex(
|
const premiumFeeIndex = supportingItems.findIndex(
|
||||||
|
|
@ -1575,8 +1576,19 @@ export default {
|
||||||
this.includePricingByDayUpcharge = false;
|
this.includePricingByDayUpcharge = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateTimeSlot(timeSlot) {
|
updateTimeSlot(timeSlotObj) {
|
||||||
this.selectedTimeSlotInfo = timeSlot;
|
this.selectedTimeSlotInfo = timeSlotObj;
|
||||||
|
if (this.appointmentType !== AppointmentTypeStrings.MOBILE) {
|
||||||
|
// update apptType based on routeCode to determine if it should be dropoff or inshop
|
||||||
|
this.appointmentType = this.getInShopOrDropOffApptType(
|
||||||
|
timeSlotObj.timeSlot.routeCode
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getInShopOrDropOffApptType(routeCode) {
|
||||||
|
return isDropOffRouteCode(routeCode)
|
||||||
|
? AppointmentTypeStrings.DROP_OFF
|
||||||
|
: AppointmentTypeStrings.IN_SHOP;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -1585,7 +1597,7 @@ export default {
|
||||||
if (!this.navigatingForward) {
|
if (!this.navigatingForward) {
|
||||||
getShopProviderData(this.zipCode).then(async (result) => {
|
getShopProviderData(this.zipCode).then(async (result) => {
|
||||||
this.shopProviderData = result.data;
|
this.shopProviderData = result.data;
|
||||||
if (this.selectedAppointmentType === "Mobile") {
|
if (this.appointmentType === "Mobile") {
|
||||||
this.selectedProvider = new Provider(
|
this.selectedProvider = new Provider(
|
||||||
this.shopProviderData.mobileProviderNumber
|
this.shopProviderData.mobileProviderNumber
|
||||||
);
|
);
|
||||||
|
|
@ -1596,9 +1608,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
selectedAppointmentType: {
|
appointmentType: {
|
||||||
handler(newValue, oldValue) {
|
handler(newValue, oldValue) {
|
||||||
if (newValue === "Mobile") {
|
if (newValue === AppointmentTypeStrings.MOBILE) {
|
||||||
this.selectedProvider = new Provider(
|
this.selectedProvider = new Provider(
|
||||||
this.shopProviderData.mobileProviderNumber
|
this.shopProviderData.mobileProviderNumber
|
||||||
);
|
);
|
||||||
|
|
@ -1609,6 +1621,23 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
appointmentTypeFromAppointmentTypeQuestion: {
|
||||||
|
handler(newValue, oldValue) {
|
||||||
|
if (newValue === AppointmentTypeStrings.MOBILE) {
|
||||||
|
this.appointmentType = AppointmentTypeStrings.MOBILE;
|
||||||
|
} else {
|
||||||
|
if (this.selectedTimeSlotInfo?.timeSlot?.routeCode) {
|
||||||
|
// update appointmentType based on routeCode to determine if it should be dropoff or inshop
|
||||||
|
this.appointmentType = this.getInShopOrDropOffApptType(
|
||||||
|
this.selectedTimeSlotInfo.timeSlot.routeCode
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
this.appointmentType = AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
selectedDate(newValue, oldValue) {
|
selectedDate(newValue, oldValue) {
|
||||||
// Clear time slot selection if date selected changes
|
// Clear time slot selection if date selected changes
|
||||||
if (newValue !== oldValue) {
|
if (newValue !== oldValue) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="time-slots-question">
|
<div class="time-slots-question">
|
||||||
<textBlock customText="Select a time:" justifyText="center" class="time-slot-header" />
|
|
||||||
<textBlock
|
<textBlock
|
||||||
v-show="durationTextBlockCopy"
|
v-show="durationTextBlockCopy"
|
||||||
:customText="durationTextBlockCopy"
|
:customText="durationTextBlockCopy"
|
||||||
|
|
@ -9,12 +8,12 @@
|
||||||
class="duration-text-block" />
|
class="duration-text-block" />
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
v-if="isDropOffAppointmentAvailable"
|
v-if="isDropOffAppointmentAvailable"
|
||||||
v-model="selectedAnswerForDropOff"
|
v-model="selectedAnswerForDropOffOrInshop"
|
||||||
:questionText="dropOffOrPickATimeQuestionLabelText"
|
:questionText="dropOffOrPickATimeQuestionLabelText"
|
||||||
:answers="answersForDropOffQuestion"
|
:answers="answersForDropOffQuestion"
|
||||||
isRequired
|
isRequired
|
||||||
insertOrLabelBeforeFinalOption
|
insertOrLabelBeforeFinalOption
|
||||||
groupName="chooseDropOffOrPickATime">
|
groupName="chooseDropOffOrInshop">
|
||||||
<div>
|
<div>
|
||||||
<alert
|
<alert
|
||||||
v-if="shouldDisplayDropOffAlert"
|
v-if="shouldDisplayDropOffAlert"
|
||||||
|
|
@ -86,7 +85,7 @@ import store from "@/store";
|
||||||
// Helpers
|
// Helpers
|
||||||
import { deepClone } from "@/helpers/object-helper";
|
import { deepClone } from "@/helpers/object-helper";
|
||||||
import {
|
import {
|
||||||
convertDateStringToDate,
|
isDropOffRouteCode,
|
||||||
militaryToTwelveHourTime,
|
militaryToTwelveHourTime,
|
||||||
} from "@/layouts/schedule/helpers/schedule-helper";
|
} from "@/layouts/schedule/helpers/schedule-helper";
|
||||||
import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helper";
|
import { getDisplayTextForDurationLength } from "@/helpers/duration-length-helper";
|
||||||
|
|
@ -158,7 +157,7 @@ export default {
|
||||||
selectedRouteCode: null,
|
selectedRouteCode: null,
|
||||||
timeSlotModalListButton: timeSlotModalListButton,
|
timeSlotModalListButton: timeSlotModalListButton,
|
||||||
waitListRequested: this.getWaitListRequestedFromStore(),
|
waitListRequested: this.getWaitListRequestedFromStore(),
|
||||||
selectedAnswerForDropOff: null,
|
selectedAnswerForDropOffOrInshop: null,
|
||||||
selectedAnswerForTimeSlots: null,
|
selectedAnswerForTimeSlots: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
@ -200,7 +199,7 @@ export default {
|
||||||
// This is planned to be used again for drop-off
|
// This is planned to be used again for drop-off
|
||||||
// Wrote this to be ready for that eventuality, is untested and no HTML work done yet
|
// Wrote this to be ready for that eventuality, is untested and no HTML work done yet
|
||||||
|
|
||||||
// if (this.selectedRouteCode == null || !this.isDropOffRouteCode(this.selectedRouteCode)) {
|
// if (this.selectedRouteCode == null || !isDropOffRouteCode(this.selectedRouteCode)) {
|
||||||
// return null;
|
// return null;
|
||||||
// } else {
|
// } else {
|
||||||
// appointmentTypeCmsWidgetName =
|
// appointmentTypeCmsWidgetName =
|
||||||
|
|
@ -356,7 +355,7 @@ export default {
|
||||||
}
|
}
|
||||||
const dropOffQuestionAnswers = this.timeSlotsForSelectedDate.timeSlots
|
const dropOffQuestionAnswers = this.timeSlotsForSelectedDate.timeSlots
|
||||||
.filter((timeSlot) => {
|
.filter((timeSlot) => {
|
||||||
return this.isDropOffRouteCode(timeSlot.id);
|
return isDropOffRouteCode(timeSlot.id);
|
||||||
})
|
})
|
||||||
.map((timeSlot) => {
|
.map((timeSlot) => {
|
||||||
let buttonLabelValue;
|
let buttonLabelValue;
|
||||||
|
|
@ -406,10 +405,10 @@ export default {
|
||||||
return this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF;
|
return this.appointmentType === AppointmentTypeStrings.IN_SHOP_OR_DROP_OFF;
|
||||||
},
|
},
|
||||||
shouldDisplayDropOffAlert() {
|
shouldDisplayDropOffAlert() {
|
||||||
return this.isDropOffRouteCode(this.selectedAnswerForDropOff);
|
return isDropOffRouteCode(this.selectedAnswerForDropOffOrInshop);
|
||||||
},
|
},
|
||||||
dropOffTimeSlotAlertCMSWidgetName() {
|
dropOffTimeSlotAlertCMSWidgetName() {
|
||||||
if (this.selectedAnswerForDropOff.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
if (this.selectedAnswerForDropOffOrInshop.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)) {
|
||||||
return "OvernightDropOffTimeSlotAlert";
|
return "OvernightDropOffTimeSlotAlert";
|
||||||
} else if (this.isSameDay) {
|
} else if (this.isSameDay) {
|
||||||
return "SameDayDropOffTimeSlotAlert";
|
return "SameDayDropOffTimeSlotAlert";
|
||||||
|
|
@ -426,7 +425,7 @@ export default {
|
||||||
},
|
},
|
||||||
shouldDisplayTimeSlotQuestion() {
|
shouldDisplayTimeSlotQuestion() {
|
||||||
return (
|
return (
|
||||||
this.selectedAnswerForDropOff == PICK_A_TIME_BUTTON_VALUE ||
|
this.selectedAnswerForDropOffOrInshop == PICK_A_TIME_BUTTON_VALUE ||
|
||||||
!this.isDropOffAppointmentAvailable
|
!this.isDropOffAppointmentAvailable
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
@ -456,7 +455,7 @@ export default {
|
||||||
getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) {
|
getAvailableTimeSlotsForInshop(timeSlotsForSelectedDate) {
|
||||||
return timeSlotsForSelectedDate
|
return timeSlotsForSelectedDate
|
||||||
.filter((timeSlot) => {
|
.filter((timeSlot) => {
|
||||||
return !this.isDropOffRouteCode(timeSlot.id);
|
return !isDropOffRouteCode(timeSlot.id);
|
||||||
})
|
})
|
||||||
.map((timeSlot) => {
|
.map((timeSlot) => {
|
||||||
const readableTime = militaryToTwelveHourTime(timeSlot.startTime);
|
const readableTime = militaryToTwelveHourTime(timeSlot.startTime);
|
||||||
|
|
@ -510,10 +509,10 @@ export default {
|
||||||
// Mobile Only
|
// Mobile Only
|
||||||
this.selectedAnswerForTimeSlots = this.addPremiumFlagToInput(routeCodeFromParent);
|
this.selectedAnswerForTimeSlots = this.addPremiumFlagToInput(routeCodeFromParent);
|
||||||
} else {
|
} else {
|
||||||
if (this.isDropOffRouteCode(routeCodeFromParent)) {
|
if (isDropOffRouteCode(routeCodeFromParent)) {
|
||||||
this.selectedAnswerForDropOff = routeCodeFromParent;
|
this.selectedAnswerForDropOffOrInshop = routeCodeFromParent;
|
||||||
} else {
|
} else {
|
||||||
this.selectedAnswerForDropOff = PICK_A_TIME_BUTTON_VALUE;
|
this.selectedAnswerForDropOffOrInshop = PICK_A_TIME_BUTTON_VALUE;
|
||||||
this.selectedAnswerForTimeSlots = routeCodeFromParent;
|
this.selectedAnswerForTimeSlots = routeCodeFromParent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -527,7 +526,7 @@ export default {
|
||||||
if (this.availableTimeSlots.length > 0) {
|
if (this.availableTimeSlots.length > 0) {
|
||||||
this.selectedAnswerForTimeSlots = this.availableTimeSlots[0].value;
|
this.selectedAnswerForTimeSlots = this.availableTimeSlots[0].value;
|
||||||
} else {
|
} else {
|
||||||
this.selectedAnswerForDropOff = this.answersForDropOffQuestion[0].value;
|
this.selectedAnswerForDropOffOrInshop = this.answersForDropOffQuestion[0].value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -581,15 +580,6 @@ export default {
|
||||||
successMessageElement.scrollIntoView({ behavior: "smooth" });
|
successMessageElement.scrollIntoView({ behavior: "smooth" });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isDropOffRouteCode(routeCode) {
|
|
||||||
if (!routeCode) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return (
|
|
||||||
routeCode.includes(RouteCodeFlags.ALL_DAY_DROP_OFF) ||
|
|
||||||
routeCode.includes(RouteCodeFlags.OVERNIGHT_DROP_OFF)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
waitListRequested(newVal) {
|
waitListRequested(newVal) {
|
||||||
|
|
@ -611,12 +601,12 @@ export default {
|
||||||
this.autoSelectTimeSlotIfOnlyOneIsAvailable();
|
this.autoSelectTimeSlotIfOnlyOneIsAvailable();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
selectedRouteCode(newVal) {
|
selectedRouteCode(newValue) {
|
||||||
if (newVal) {
|
if (newValue) {
|
||||||
this.setSelectedTimeSlot();
|
this.setSelectedTimeSlot();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedAnswerForDropOff(newValue) {
|
selectedAnswerForDropOffOrInshop(newValue) {
|
||||||
if (newValue == PICK_A_TIME_BUTTON_VALUE) {
|
if (newValue == PICK_A_TIME_BUTTON_VALUE) {
|
||||||
this.selectedRouteCode = null;
|
this.selectedRouteCode = null;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -625,7 +615,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedAnswerForTimeSlots(newValue) {
|
selectedAnswerForTimeSlots(newValue) {
|
||||||
if (newValue) this.selectedRouteCode = newValue;
|
if (newValue) {
|
||||||
|
this.selectedRouteCode = newValue;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue