Merge branch 'release/2025.02.27' into feature/CASH-151
This commit is contained in:
commit
e9c6c0e6f4
7 changed files with 89 additions and 49 deletions
|
|
@ -99,8 +99,16 @@
|
|||
// Supporting files
|
||||
import loader from "@/ux-components/loader/loader";
|
||||
import store from "@/store";
|
||||
import { TIMINGFUNC_MAP, BUFFER_OFFSET, MONTHS_OF_YEAR } from "@/digital-components/date-picker/mixins/constants";
|
||||
import { selectableDaysOptions, requiredParameter, forceTwoDigitString } from "@/digital-components/date-picker/mixins/helpers";
|
||||
import {
|
||||
TIMINGFUNC_MAP,
|
||||
BUFFER_OFFSET,
|
||||
MONTHS_OF_YEAR,
|
||||
} from "@/digital-components/date-picker/mixins/constants";
|
||||
import {
|
||||
selectableDaysOptions,
|
||||
requiredParameter,
|
||||
forceTwoDigitString,
|
||||
} from "@/digital-components/date-picker/mixins/helpers";
|
||||
import {
|
||||
convertDateToDateString,
|
||||
convertDateStringToDate,
|
||||
|
|
@ -111,7 +119,7 @@ import { deepClone } from "@/helpers/object-helper";
|
|||
import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export default {
|
||||
name: "datePicker2",
|
||||
name: "datePickerForPricingByDay",
|
||||
data() {
|
||||
return {
|
||||
isLoading: true,
|
||||
|
|
@ -58,3 +58,15 @@ export function getTopLevelPartsWithRecal(lineItems) {
|
|||
|
||||
return lineItems.filter((li) => isRecalPartOrHasChildRecalPart(li));
|
||||
}
|
||||
|
||||
export function getRecalPartNumbers(glassPartsArray) {
|
||||
if (glassPartsArray && glassPartsArray.length > 0) {
|
||||
const topLevel = glassPartsArray.filter((gp) => isRecalPart(gp)).map((gp) => gp.partNumber);
|
||||
|
||||
const children = glassPartsArray.map((gp) => getRecalPartNumbers(gp.childParts)).flat();
|
||||
|
||||
return [...topLevel, ...children];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,15 +357,18 @@ export default {
|
|||
false
|
||||
);
|
||||
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) {
|
||||
const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(
|
||||
storeActions.SAVE_EMAIL,
|
||||
this.customerQuestions.emailOrSms,
|
||||
false
|
||||
);
|
||||
// if no value due to field being optional, blank both phone and email address
|
||||
if (!this.customerQuestions.emailOrSms) {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||
}
|
||||
else {
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) {
|
||||
const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.customerQuestions.emailOrSms, false);
|
||||
}
|
||||
}
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
|
|
|
|||
|
|
@ -311,11 +311,18 @@ export default {
|
|||
false
|
||||
);
|
||||
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
// if no value due to field being optional, blank both phone and email address
|
||||
if (!this.emailOrSms) {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||
}
|
||||
else {
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
}
|
||||
}
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@
|
|||
marginTopSizeOverride="1" />
|
||||
</template>
|
||||
<locationAlerts cmsWidgetPrefix="LocationAlert-" ref="locationAlerts" />
|
||||
<datePicker
|
||||
v-if="!isPricingByDayExperiment"
|
||||
<datePickerForPricingByDay
|
||||
v-if="isPricingByDayExperiment"
|
||||
customComponentId="dateQuestion"
|
||||
selectableDatesSetting="custom"
|
||||
ref="datePicker"
|
||||
|
|
@ -28,8 +28,8 @@
|
|||
:customSelectableDatesCallback="getAvailableDatesMethod"
|
||||
validationRules="date-required"
|
||||
@date-clicked="openInshopTimeSlotsModal" />
|
||||
<datePicker2
|
||||
v-if="isPricingByDayExperiment"
|
||||
<datePicker
|
||||
v-else
|
||||
customComponentId="dateQuestion"
|
||||
selectableDatesSetting="custom"
|
||||
ref="datePicker"
|
||||
|
|
@ -81,7 +81,7 @@ import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-heade
|
|||
import loadingModal from "@/fmg-components/loading-modal/loading-modal.vue";
|
||||
import { Form, defineRule } from "vee-validate";
|
||||
import datePicker from "@/digital-components/date-picker/date-picker";
|
||||
import datePicker2 from "@/experiment-components/date-picker-2";
|
||||
import datePickerForPricingByDay from "@/experiment-components/date-picker-for-pricing-by-day";
|
||||
import locationAlerts from "@/layouts/schedule/location-alerts/location-alerts";
|
||||
import timeSlotModalQuestion from "./time-slot-modal-question/time-slot-modal-question";
|
||||
import textBlock from "@/digital-components/text-block/text-block";
|
||||
|
|
@ -227,13 +227,15 @@ export default {
|
|||
preSelectedDate = null;
|
||||
}
|
||||
|
||||
const datePickerInitialDataPromise = await datePicker2.methods.loadInitialData({
|
||||
const datePickerInitialDataPromise = await datePicker.methods.loadInitialData({
|
||||
// setup config options for date-picker
|
||||
selectableDatesSetting: "custom",
|
||||
initialViewRowsToShow: 5,
|
||||
customSelectableDatesCallback: getAvailableDates,
|
||||
preSelectedDate: preSelectedDate,
|
||||
});
|
||||
// TODO - ONCE A DATEPICKER VERSION IS FINALIZED,
|
||||
// MAKE SURE THE ABOVE METHOD loadInitialData POINTS TO THE RIGHT FILE
|
||||
|
||||
const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||
storeActions.GET_MOBILE_PREMIUM_FEE,
|
||||
|
|
@ -559,7 +561,7 @@ export default {
|
|||
Form,
|
||||
loadingModal,
|
||||
datePicker,
|
||||
datePicker2,
|
||||
datePickerForPricingByDay,
|
||||
locationAlerts,
|
||||
timeSlotModalQuestion,
|
||||
textBlock,
|
||||
|
|
|
|||
|
|
@ -330,11 +330,18 @@ export default {
|
|||
false
|
||||
);
|
||||
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
// if no value due to field being optional, blank both phone and email address
|
||||
if (!this.emailOrSms) {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||
}
|
||||
else {
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
}
|
||||
}
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
|
|
@ -380,11 +387,18 @@ export default {
|
|||
);
|
||||
}
|
||||
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
// if no value due to field being optional, blank both phone and email address
|
||||
if (!this.emailOrSms) {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false);
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false);
|
||||
}
|
||||
else {
|
||||
if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) {
|
||||
const phone = this.emailOrSms.replace(/[()]/g, "");
|
||||
await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false);
|
||||
} else {
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false);
|
||||
}
|
||||
}
|
||||
|
||||
await this.dispatchStoreAction(
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import {
|
|||
containsRecalParts,
|
||||
getTopLevelPartsWithRecal,
|
||||
isRecalPartOrHasChildRecalPart,
|
||||
getRecalPartNumbers,
|
||||
} from "@/helpers/recal-helper";
|
||||
import { externalParameterStatus } from "@/constants/external-parameters";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
|
|
@ -1712,10 +1713,15 @@ export const actions = {
|
|||
|
||||
var endPoint = `${endpoints.GetMobileFeePart.url}/?serviceType=${serviceType}&facilityType=${facilityType}&parentAccountNumber=${parentAccountNumber}&billToAccountNumber=${billToAccountNumber}&providerNumber=${providerNumber}&isItacOptimized=${isItacOptimized}&zipCode=${zipCode}`;
|
||||
|
||||
const recalPartNumber = getRecalPartNumber(order.lineItems?.glassParts[0]);
|
||||
const recalPartNumbers = getRecalPartNumbers(order.lineItems?.glassParts);
|
||||
const carId = order.vehicle?.carId;
|
||||
if (recalPartNumber && carId) {
|
||||
endPoint = `${endPoint}&partNumbers=${recalPartNumber}&carId=${carId}`;
|
||||
if (recalPartNumbers && recalPartNumbers.length > 0 && carId) {
|
||||
let additionalQueryParams = ``;
|
||||
for (let i = 0; i < recalPartNumbers.length; i++) {
|
||||
additionalQueryParams += `&partNumbers[${i}]=${recalPartNumbers[i]}`;
|
||||
}
|
||||
additionalQueryParams += `&carId=${carId}`;
|
||||
endPoint += additionalQueryParams;
|
||||
}
|
||||
|
||||
if (coverageStatus) {
|
||||
|
|
@ -3760,15 +3766,3 @@ function getExternalParameterDefaultState() {
|
|||
function saveExternalParameterState(externalParameterState) {
|
||||
window.sessionStorage.setItem("externalParameterState", JSON.stringify(externalParameterState));
|
||||
}
|
||||
|
||||
//This function finds the recalibration part and returns the part number for it.
|
||||
function getRecalPartNumber(glassPartsArray) {
|
||||
const recalPart = glassPartsArray.childParts.find(
|
||||
(item) => item.partType === partTypeStrings.ADAS_RECALIBRATION
|
||||
);
|
||||
if (recalPart) {
|
||||
return recalPart.partNumber;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue