Merge pull request #3034 from Safelite/nation/CASH-2098
Nation/cash 2098
This commit is contained in:
commit
71669a125e
2 changed files with 71 additions and 3 deletions
|
|
@ -36,6 +36,9 @@ const experimentSettings = {
|
||||||
SHOW_PM_MOBILE_DAYS: "Show_PMmobileDays",
|
SHOW_PM_MOBILE_DAYS: "Show_PMmobileDays",
|
||||||
SHOW_NO_PM_MOBILE_DAYS: "Show_NoPMmobileDays",
|
SHOW_NO_PM_MOBILE_DAYS: "Show_NoPMmobileDays",
|
||||||
SHOW_NO_MOBILE_AVAILABLE_DAYS: "Show_NoMobileAvailableDays",
|
SHOW_NO_MOBILE_AVAILABLE_DAYS: "Show_NoMobileAvailableDays",
|
||||||
|
SHOW_MOBILE_FIRST_POPUP_REPAIR: "Show_Mobile_First_Popup_Repair",
|
||||||
|
SHOW_MOBILE_FIRST_POPUP_REPLACE_WITHOUT_MSR: "Show_Mobile_First_Popup_Replace_Without_MSR",
|
||||||
|
SHOW_MOBILE_FIRST_POPUP_REPLACE_WITH_MSR: "Show_Mobile_First_Popup_Replace_With_MSR",
|
||||||
OFFER_OEM: "OfferOem",
|
OFFER_OEM: "OfferOem",
|
||||||
USE_ADYEN_PAYMENT: "UseAdyenPayment",
|
USE_ADYEN_PAYMENT: "UseAdyenPayment",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1840,6 +1840,20 @@ export default {
|
||||||
const noMobileAvailableDays = experimentMixin.methods.getSettingValue(
|
const noMobileAvailableDays = experimentMixin.methods.getSettingValue(
|
||||||
experimentSettings.SHOW_NO_MOBILE_AVAILABLE_DAYS
|
experimentSettings.SHOW_NO_MOBILE_AVAILABLE_DAYS
|
||||||
);
|
);
|
||||||
|
const mobileFirstPopupRepairSetting = experimentMixin.methods.getSettingValue(
|
||||||
|
experimentSettings.SHOW_MOBILE_FIRST_POPUP_REPAIR
|
||||||
|
);
|
||||||
|
const mobileFirstPopupReplaceWithoutMsrSetting =
|
||||||
|
experimentMixin.methods.getSettingValue(
|
||||||
|
experimentSettings.SHOW_MOBILE_FIRST_POPUP_REPLACE_WITHOUT_MSR
|
||||||
|
);
|
||||||
|
const mobileFirstPopupReplaceWithMsrSetting =
|
||||||
|
experimentMixin.methods.getSettingValue(
|
||||||
|
experimentSettings.SHOW_MOBILE_FIRST_POPUP_REPLACE_WITH_MSR
|
||||||
|
);
|
||||||
|
|
||||||
|
const order = this.$store.getters.order;
|
||||||
|
const isRepair = order.damage.isRepair;
|
||||||
|
|
||||||
let preSelectedMobileAppointment = null;
|
let preSelectedMobileAppointment = null;
|
||||||
const todaysDate = getTodayDate();
|
const todaysDate = getTodayDate();
|
||||||
|
|
@ -1856,12 +1870,63 @@ export default {
|
||||||
(new Date(firstMobilePMDate) - todaysDate) / (1000 * 60 * 60 * 24);
|
(new Date(firstMobilePMDate) - todaysDate) / (1000 * 60 * 60 * 24);
|
||||||
|
|
||||||
const shouldExposeMobileFirstAppointment = () => {
|
const shouldExposeMobileFirstAppointment = () => {
|
||||||
return (
|
const mobileFirstDaysCheck =
|
||||||
(firstMobileAMDate &&
|
(firstMobileAMDate &&
|
||||||
numberOfDaysToFirstMobileAMDate <= noMobileAvailableDays) ||
|
numberOfDaysToFirstMobileAMDate <= noMobileAvailableDays) ||
|
||||||
(firstMobilePMDate &&
|
(firstMobilePMDate &&
|
||||||
numberOfDaysToFirstMobilePMDate <= noMobileAvailableDays)
|
numberOfDaysToFirstMobilePMDate <= noMobileAvailableDays);
|
||||||
);
|
debugLog("::: Mobile First Days Check:", mobileFirstDaysCheck);
|
||||||
|
|
||||||
|
if (
|
||||||
|
mobileFirstPopupRepairSetting === "false" &&
|
||||||
|
mobileFirstPopupReplaceWithoutMsrSetting === "false" &&
|
||||||
|
mobileFirstPopupReplaceWithMsrSetting === "false"
|
||||||
|
) {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Damage Popup settings are all false, using default check."
|
||||||
|
);
|
||||||
|
return mobileFirstDaysCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isRepair) {
|
||||||
|
if (mobileFirstPopupRepairSetting === "true") {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Popup Repair setting is true, showing mobile first appointment for repair."
|
||||||
|
);
|
||||||
|
return mobileFirstDaysCheck;
|
||||||
|
} else {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Popup Repair setting is false, not showing mobile first appointment for repair."
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.isMobileStaticRecalibrationApplicable) {
|
||||||
|
if (mobileFirstPopupReplaceWithMsrSetting === "true") {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Popup Replace with MSR setting is true, showing mobile first appointment for replace with MSR."
|
||||||
|
);
|
||||||
|
return mobileFirstDaysCheck;
|
||||||
|
} else {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Popup Replace with MSR setting is false, not showing mobile first appointment for replace with MSR."
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mobileFirstPopupReplaceWithoutMsrSetting === "true") {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Popup Replace without MSR setting is true, showing mobile first appointment for replace without MSR."
|
||||||
|
);
|
||||||
|
return mobileFirstDaysCheck;
|
||||||
|
} else {
|
||||||
|
debugLog(
|
||||||
|
"::: Mobile First Popup Replace without MSR setting is false, not showing mobile first appointment for replace without MSR."
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (shouldExposeMobileFirstAppointment()) {
|
if (shouldExposeMobileFirstAppointment()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue