Merge branch 'develop' into feature/CSR-1124
This commit is contained in:
commit
b54b6ed5f3
12 changed files with 100 additions and 57 deletions
|
|
@ -114,8 +114,8 @@ const endpoints = {
|
|||
url: "/schedule/api/v1/schedule/mobile-time-slots",
|
||||
method: "POST",
|
||||
},
|
||||
GetMobileEarlyBirdFee: {
|
||||
url: "/parts/api/v1/parts/mobile-early-bird-fee",
|
||||
GetMobilePremiumFee: {
|
||||
url: "/parts/api/v1/parts/mobile-premium-fee",
|
||||
method: "GET",
|
||||
},
|
||||
SaveSession: {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ const storeActions = {
|
|||
GET_SHOP_TIME_SLOTS: "getShopTimeSlots",
|
||||
GET_MOBILE_TIME_SLOTS: "getMobileTimeSlots",
|
||||
GET_PROVIDERS: "getProviders",
|
||||
GET_MOBILE_EARLY_BIRD_FEE: "getMobileEarlyBirdFee",
|
||||
GET_MOBILE_PREMIUM_FEE: "getMobilePremiumFee",
|
||||
SAVE_SESSION: "saveSession",
|
||||
LOAD_SESSION: "loadSession",
|
||||
UPDATE_STORE_WITH_SAVE_SESSION_RESPONSE: "updateStoreWithSaveSessionResponse",
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@
|
|||
<div class="grid-item caption"><span class="sr-only">Saturday</span>S</div>
|
||||
<div
|
||||
v-for="date in month.dates"
|
||||
:key="date.inputValue.dateString"
|
||||
:id="date.inputValue.dateString"
|
||||
:key="date.inputValue"
|
||||
:id="date.inputValue"
|
||||
class="grid-item radio-wrapper"
|
||||
:class="[
|
||||
date.dateNum === 1 ? 'first-day-' + month.startDateDayIndex : '',
|
||||
|
|
@ -193,6 +193,51 @@ export default {
|
|||
weekEndDate: weekEndDate,
|
||||
});
|
||||
}
|
||||
|
||||
// are any of these weeks split between two months?
|
||||
const hasSplitWeek = (week) => {
|
||||
return week.weekStartDate.getMonth() !== week.weekEndDate.getMonth() ? true : false;
|
||||
};
|
||||
const splitWeekIndex = weeks.findIndex(hasSplitWeek);
|
||||
|
||||
if (splitWeekIndex > -1) {
|
||||
const week1 = [];
|
||||
const week2 = [];
|
||||
let switchToWeek2 = false;
|
||||
|
||||
for (let j = 0; j < 7; j++) {
|
||||
const newDate = new Date(weeks[splitWeekIndex].weekStartDate);
|
||||
newDate.setDate(newDate.getDate() + j);
|
||||
if (newDate.getDate() === 1) switchToWeek2 = true;
|
||||
if (switchToWeek2) {
|
||||
week2.push(newDate);
|
||||
} else {
|
||||
week1.push(newDate);
|
||||
}
|
||||
}
|
||||
|
||||
const week1EndDate = week1[week1.length - 1];
|
||||
const week2StartDate = week2[0];
|
||||
|
||||
if (week1EndDate < today) {
|
||||
// replace week 1 with week 2
|
||||
weeks[splitWeekIndex].weekStartDate = week2StartDate;
|
||||
} else {
|
||||
const newWeek = {
|
||||
weekNum: weeks[splitWeekIndex].weekNum,
|
||||
weekStartDate: week2StartDate,
|
||||
weekEndDate: weeks[splitWeekIndex].weekEndDate,
|
||||
};
|
||||
weeks[splitWeekIndex].weekEndDate = week1EndDate;
|
||||
weeks.splice(splitWeekIndex + 1, 0, newWeek);
|
||||
weeks.pop();
|
||||
weeks.forEach((item, index) => {
|
||||
if (index > splitWeekIndex) {
|
||||
item.weekNum = item.weekNum + 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
return weeks;
|
||||
},
|
||||
async loadInitialData(config) {
|
||||
|
|
@ -209,7 +254,7 @@ export default {
|
|||
const todayYearNum = todayDate.getFullYear();
|
||||
// TODO - set up currentMonthStart if direction is PAST:
|
||||
// let currentMonthStart = new Date(todayYearNum, todayMonthIndex - 1, 1);
|
||||
let currentMonthEnd = new Date(todayYearNum, todayMonthIndex, 0);
|
||||
const currentMonthEnd = new Date(todayYearNum, todayMonthIndex, 0);
|
||||
|
||||
let calendarViewDirection = "none";
|
||||
if (config.selectableDatesSetting === "past") calendarViewDirection = "past";
|
||||
|
|
@ -222,8 +267,8 @@ export default {
|
|||
|
||||
const initialViewStartDate = todayDate;
|
||||
const initialViewEndDate = initialViewWeeks[initialViewWeeks.length - 1].weekEndDate;
|
||||
const saturday1month = initialViewWeeks[0].weekEndDate.getMonth();
|
||||
const sunday5month =
|
||||
const firstSaturdayMonth = initialViewWeeks[0].weekEndDate.getMonth();
|
||||
const lastSundayMonth =
|
||||
initialViewWeeks[initialViewWeeks.length - 1].weekStartDate.getMonth();
|
||||
|
||||
let hideSomeDaysForInitialView = false;
|
||||
|
|
@ -231,10 +276,10 @@ export default {
|
|||
|
||||
// TODO - NEED TO CREATE OPPOSITE LOGIC FOR "past" DIRECTION LIKE BELOW vvvvv
|
||||
if (calendarViewDirection === "future") {
|
||||
if (saturday1month !== sunday5month) {
|
||||
if (firstSaturdayMonth !== lastSundayMonth) {
|
||||
hideSomeDaysForInitialView = true;
|
||||
}
|
||||
if (initialViewStartDate.getMonth() === sunday5month) {
|
||||
if (initialViewStartDate.getMonth() === lastSundayMonth) {
|
||||
hideSecondMonth = true;
|
||||
if (currentMonthEnd > initialViewEndDate) {
|
||||
// should part of 1st month be hidden?
|
||||
|
|
@ -243,7 +288,7 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
let myPromise = new Promise((resolve, reject) => {
|
||||
const myPromise = new Promise((resolve, reject) => {
|
||||
const response = config.customSelectableDatesCallback(
|
||||
initialViewStartDate.toISOString().split("T")[0],
|
||||
initialViewEndDate.toISOString().split("T")[0],
|
||||
|
|
@ -431,12 +476,6 @@ export default {
|
|||
"-" +
|
||||
forceTwoDigitString(i);
|
||||
|
||||
const thisDate = {
|
||||
year: yearNum,
|
||||
month: monthIndex,
|
||||
date: i,
|
||||
dateString: dateString,
|
||||
};
|
||||
if (offset === 0 && i === this.todayDateNum) {
|
||||
dayClasses += "current-day";
|
||||
}
|
||||
|
|
@ -457,11 +496,9 @@ export default {
|
|||
const dateObject = {
|
||||
dateNum: i,
|
||||
dayClasses: dayClasses,
|
||||
inputValue: thisDate,
|
||||
inputValue: dateString,
|
||||
isSelectable:
|
||||
this.selectableDatesData.findIndex(
|
||||
(date) => date.dateString === dateString
|
||||
) > -1
|
||||
this.selectableDatesData.findIndex((date) => date.date === dateString) > -1
|
||||
? true
|
||||
: false,
|
||||
};
|
||||
|
|
@ -510,8 +547,8 @@ export default {
|
|||
if (monthToShow) {
|
||||
// make new API call with this month's start and end dates
|
||||
await this.updateSelectableDates(
|
||||
monthToShow.dates[monthStartDateNum].inputValue.dateString,
|
||||
monthToShow.dates[monthToShow.dates.length - 1].inputValue.dateString
|
||||
monthToShow.dates[monthStartDateNum].inputValue,
|
||||
monthToShow.dates[monthToShow.dates.length - 1].inputValue
|
||||
);
|
||||
this.isLoading = false;
|
||||
this.hideSomeDaysForInitialView = false; // if hid days on initial partial view, this will reveal those days
|
||||
|
|
@ -531,13 +568,13 @@ export default {
|
|||
);
|
||||
moreSelectableDates.days.forEach((selectableDate) => {
|
||||
const index = this.selectableDatesData.findIndex(
|
||||
(obj) => obj.dateString === selectableDate.dateString
|
||||
(dateObj) => dateObj.date === selectableDate.date
|
||||
);
|
||||
if (index === -1) this.selectableDatesData.push(selectableDate);
|
||||
if (index === -1) this.selectableDatesData.push(selectableDate.date);
|
||||
this.months.forEach((month) => {
|
||||
// TODO: avoid checking all calendar date; maybe only ones between monthStart and monthEnd as defined above?
|
||||
// TODO: avoid checking all calendar dates; maybe only ones between monthStart and monthEnd as defined above?
|
||||
month.dates.forEach((date) => {
|
||||
if (date.inputValue.dateString === selectableDate.dateString) {
|
||||
if (date.inputValue === selectableDate.date) {
|
||||
date["isSelectable"] = true;
|
||||
}
|
||||
});
|
||||
|
|
@ -808,7 +845,6 @@ export default {
|
|||
.btn-link {
|
||||
font-weight: 500;
|
||||
text-underline-offset: 4px;
|
||||
box-shadow: none !important; // TODO: FIX THIS
|
||||
position: absolute;
|
||||
top: 90%;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
<time-slot-modal-question
|
||||
ref="timeSlotModalQuestion"
|
||||
cmsWidgetName="TimeSlotModalQuestion"
|
||||
mobilePremiumCmsWidgetName="EarlyBirdTimeSlotModal"
|
||||
mobilePremiumCmsWidgetName="MobilePremiumTimeSlotModal"
|
||||
mobileCmsWidgetName="MobileTimeSlotModal"
|
||||
dropoffCmsWidgetName="DropOffTimeSlotModal"
|
||||
sameDayDropOffCmsWidgetName="SameDayDropOffTimeSlotModal"
|
||||
|
|
@ -107,20 +107,7 @@ const getAvailableDates = async (startDate, endDate, appointmentType, providerNu
|
|||
);
|
||||
}
|
||||
|
||||
const newShopTimeSlots = newTimeSlotsResponse.data;
|
||||
return convertApiResponse(newShopTimeSlots);
|
||||
};
|
||||
const convertApiResponse = (responseData) => {
|
||||
// DATA CONVERSION
|
||||
responseData?.days.forEach((date) => {
|
||||
const dateString = date.date;
|
||||
date.dateString = dateString;
|
||||
const dateStringPieces = dateString.split("-");
|
||||
date.year = Number(dateStringPieces[0]);
|
||||
date.month = Number(dateStringPieces[1]);
|
||||
date.date = Number(dateStringPieces[2]);
|
||||
});
|
||||
return responseData;
|
||||
return newTimeSlotsResponse.data;
|
||||
};
|
||||
|
||||
export default {
|
||||
|
|
@ -162,7 +149,7 @@ export default {
|
|||
);
|
||||
|
||||
const premiumFeePromise = baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.GET_MOBILE_EARLY_BIRD_FEE
|
||||
storeActions.GET_MOBILE_PREMIUM_FEE
|
||||
);
|
||||
const alertReasonsPromise = locationAlerts.methods.loadInitialData(
|
||||
store.getters.order.serviceLocation.zipCodeCtu
|
||||
|
|
@ -237,7 +224,8 @@ export default {
|
|||
startTime: timeSlotSelectedObject.startTime,
|
||||
endTime: timeSlotSelectedObject.endTime,
|
||||
routeCode: this.selectedTimeSlotData.id,
|
||||
jobMaxMinutes: this.selectableDatesData.estimatedServiceMinutesMaximum,
|
||||
jobMaxMinutes:
|
||||
this.selectableDatesData.estimatedServiceMinutesMaximum.toString(),
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
|
|
@ -346,7 +334,7 @@ export default {
|
|||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
await this.dispatchStoreAction(
|
||||
this.dispatchStoreAction(
|
||||
this.storeActions.SAVE_SCHEDULE,
|
||||
this.appointmentDateAndTime,
|
||||
false
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ export default {
|
|||
city: this.getServiceCityFromStore(),
|
||||
state: this.getServiceStateFromStore(),
|
||||
zipCode: this.getServiceZipCodeFromStore(),
|
||||
isVehicleProtected: null,
|
||||
isVehicleProtected: this.getIsVehicleProtectedFromStore(),
|
||||
isGlassServiceableInshop: null,
|
||||
isRecalibrationServiceableInshop: null,
|
||||
isGlassServiceableMobile: null,
|
||||
|
|
@ -348,6 +348,9 @@ export default {
|
|||
getServiceZipCodeFromStore() {
|
||||
return store.getters.order.serviceLocation.zipCode;
|
||||
},
|
||||
getIsVehicleProtectedFromStore() {
|
||||
return store.getters.order.serviceLocation.isVehicleProtected;
|
||||
},
|
||||
getSelectedAppointmentType() {
|
||||
return store.getters.order.serviceLocation.appointmentType;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ export default {
|
|||
.button-auxillary-copy {
|
||||
box-sizing: border-box;
|
||||
justify-content: right;
|
||||
line-height: 1.25rem !important;
|
||||
line-height: 1.25rem;
|
||||
font-weight: 500;
|
||||
font-size: 0.75rem;
|
||||
align-items: center;
|
||||
|
|
@ -205,7 +205,7 @@ export default {
|
|||
}
|
||||
|
||||
.loader:after {
|
||||
background-color: $gray-300 !important;
|
||||
background-color: $gray-300;
|
||||
height: 1rem;
|
||||
width: 1rem;
|
||||
}
|
||||
|
|
@ -221,7 +221,7 @@ export default {
|
|||
}
|
||||
|
||||
&.gray {
|
||||
color: $gray-600 !important;
|
||||
color: $gray-600;
|
||||
background-color: $gray-100;
|
||||
padding-left: 0.125rem;
|
||||
padding-right: 0.125rem;
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ export default {
|
|||
border-radius: 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding: 0.5rem 0.5rem 0.5rem 1.5rem !important;
|
||||
padding: 0.5rem 0.5rem 0.5rem 1.5rem;
|
||||
gap: 0.25rem;
|
||||
|
||||
.alert-heading {
|
||||
|
|
|
|||
|
|
@ -39,11 +39,13 @@ const getDefaultState = () => {
|
|||
},
|
||||
serviceLocation: {
|
||||
address: null,
|
||||
address2: null,
|
||||
city: null,
|
||||
state: null,
|
||||
zipCode: null,
|
||||
zipCodeCtu: null,
|
||||
appointmentType: null,
|
||||
isVehicleProtected: null,
|
||||
provider: {
|
||||
providerNumber: null,
|
||||
address: {
|
||||
|
|
@ -84,6 +86,7 @@ const getDefaultState = () => {
|
|||
startTime: null,
|
||||
endTime: null,
|
||||
routeCode: null,
|
||||
jobMaxMinutes: null,
|
||||
},
|
||||
referralNumber: null,
|
||||
referralDate: null,
|
||||
|
|
@ -268,6 +271,7 @@ export const mutations = {
|
|||
state.order.schedule.startTime = scheduleInfo.startTime;
|
||||
state.order.schedule.endTime = scheduleInfo.endTime;
|
||||
state.order.schedule.routeCode = scheduleInfo.routeCode;
|
||||
state.order.schedule.jobMaxMinutes = scheduleInfo.jobMaxMinutes;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -446,6 +450,7 @@ export const mutations = {
|
|||
state.order.schedule.startTime = sessionInformation.order.schedule?.startTime;
|
||||
state.order.schedule.endTime = sessionInformation.order.schedule?.endTime;
|
||||
state.order.schedule.routeCode = sessionInformation.order.schedule?.routeCode;
|
||||
state.order.schedule.jobMaxMinutes = sessionInformation.order.schedule?.jobMaxMinutes;
|
||||
},
|
||||
updateExperiments(state, experiments) {
|
||||
state.applicationUser.experiments = experiments;
|
||||
|
|
@ -1162,7 +1167,7 @@ export const actions = {
|
|||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
shopAppointmentType: shopAppointmentType,
|
||||
applicationName: "Safelite.com funnel",
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
parentAccountNumber: context.getters.payment.parentAccountNumber,
|
||||
carId: vehicle.carId,
|
||||
partNumbers: partNumbers,
|
||||
|
|
@ -1214,7 +1219,7 @@ export const actions = {
|
|||
var payload = {
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
applicationName: "Safelite.com funnel",
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
parentAccountNumber: context.getters.payment.parentAccountNumber,
|
||||
carId: vehicle.carId,
|
||||
partNumbers: partNumbers,
|
||||
|
|
@ -1249,13 +1254,13 @@ export const actions = {
|
|||
});
|
||||
},
|
||||
|
||||
getMobileEarlyBirdFee(context) {
|
||||
getMobilePremiumFee(context) {
|
||||
const damageType = context.getters.damage.isRepair ? "Repair" : "Replace";
|
||||
const paymentType = context.getters.order.payment.isInsurance ? "Insurance" : "Cash";
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.GetMobileEarlyBirdFee.method,
|
||||
endpoint: `${endpoints.GetMobileEarlyBirdFee.url}/${paymentType}/${damageType}`,
|
||||
method: endpoints.GetMobilePremiumFee.method,
|
||||
endpoint: `${endpoints.GetMobilePremiumFee.url}/${paymentType}/${damageType}`,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -1348,6 +1353,7 @@ export const actions = {
|
|||
startTime: order.schedule?.startTime,
|
||||
endTime: order.schedule?.endTime,
|
||||
routeCode: order.schedule?.routeCode,
|
||||
jobMaxMinutes: order.schedule?.jobMaxMinutes,
|
||||
},
|
||||
existingPromoCode: null,
|
||||
referralCorrelationId: order.referralCorrelationId,
|
||||
|
|
|
|||
|
|
@ -56,3 +56,9 @@ body {
|
|||
height: calc(100% - 72px);
|
||||
}
|
||||
}
|
||||
//Disable scroll of main container when modal is open
|
||||
.modal-open {
|
||||
.page-container-grouped-styles {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
position: relative;
|
||||
z-index: 5;
|
||||
@include box-shadow-hover($blue-300);
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,3 +190,6 @@ $alert-color-scale: 40%;
|
|||
// This affects all [Bootstrap] modals
|
||||
$modal-fade-transform: translate(0, 100%);
|
||||
$modal-backdrop-opacity: 0;
|
||||
|
||||
//Disable default !important behavior
|
||||
$enable-important-utilities: false;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ export default {
|
|||
|
||||
+ .list-card-content {
|
||||
outline: none;
|
||||
display: block;
|
||||
display: flex;
|
||||
position: relative;
|
||||
|
||||
p {
|
||||
|
|
|
|||
Loading…
Reference in a new issue