Merge pull request #1627 from Safelite/rlsmerge/2023.12.14-to-develop

Rlsmerge/2023.12.14 to develop
This commit is contained in:
CarlNation 2023-12-08 11:05:43 -05:00 committed by GitHub
commit 1d7dc6c2c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 74 additions and 3 deletions

View file

@ -55,6 +55,7 @@ const storeMutations = {
WORK_ORDER_NUMBER: "updateWorkOrderNumber",
Customer_Portal_Login_Token: "updateCustomerPortalLoginToken",
LOCK_TOKEN: "updateLockToken",
UPDATE_SETTLED_TENDER_AMOUNT: "updateSettledTenderAmount",
// EVENT BUS MUTATIONS
ADD_EVENT_TO_BUS: "addEventToBus",

View file

@ -164,6 +164,7 @@ async function saveSessionHelper(
workOrderNumber: savedSessionInfo.data.workOrderNumber,
customerPortalLoginToken: savedSessionInfo.data.customerPortalLoginToken,
lockToken: savedSessionInfo.data.lockToken,
settledTenderAmount: savedSessionInfo.data.settledTenderAmount,
},
false
);

View file

@ -112,6 +112,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
pageNameToLog,
false
);
const revalidationErrorPromoCodes = revalidatePromoResponse.errors.map((x) => x.promoCode);
baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
@ -122,6 +123,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
false
);
}
if (hasNewPromo) {
validatePromoResponse = await baseMixin.methods.dispatchStoreActionWithLogging(
storeActions.VALIDATE_ORDER_PROMO_AND_SAVE_SERVER_DATA,
@ -132,6 +134,7 @@ export async function revalidatePromosAndValidateQueryStringPromo(
pageNameToLog,
false
);
if (validatePromoResponse.errorCode == null) {
// Save promo to store
const activePromos = store.getters.order.lineItems.promos ?? [];

View file

@ -39,6 +39,7 @@
</div>
<hr />
<cart
v-if="ShowCart"
:damage="damageInfo"
:availableVaps="vaps"
:allowItemRemoval="false"
@ -138,6 +139,13 @@ export default {
};
},
computed: {
ShowCart() {
if (this.isPia && store.getters.submittedOrder.settledTenderAmount == 0) {
return false;
}
return true;
},
ScheduleConfirmationText() {
return this.getCmsContent("ScheduleConfirmationWidget", "BodyText");
},

View file

@ -10,6 +10,7 @@
<div class="col-md-6 col-xl-4">
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" class="mt-4 mb-5" />
<textboxQuestion
isRequired
class="mb-4"
cmsWidgetName="FirstNameWidget"
v-model="firstName"
@ -18,6 +19,7 @@
validationRules="first-name-required" />
<textboxQuestion
isRequired
class="mb-4"
cmsWidgetName="LastNameWidget"
v-model="lastName"
@ -26,6 +28,7 @@
validationRules="last-name-required" />
<textboxQuestion
isRequired
class="mb-4"
cmsWidgetName="emailQuestionWidget"
v-model="emailAddress"
@ -33,10 +36,10 @@
validationRules="email-address-required|email-address-format" />
<phoneNumberQuestion
isRequired
class="mb-4"
cmsWidgetName="PhoneNumberQuestionWidget"
v-model="phoneNumber"
isRequired
validationRules="phone-number-required" />
<checkboxQuestion

View file

@ -112,6 +112,7 @@ import { defineRule } from "vee-validate";
import { required } from "@/helpers/validation-rules";
import { errorMessages } from "@/constants/error-messages";
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
import { partTypeStrings } from "@/constants/part-type-strings";
import { mapTaxedLineItemsToStoreFormat } from "../../store";
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
@ -156,12 +157,14 @@ export default {
const lineItemsFromStore = deepClone(store.getters.order.lineItems);
const glassParts = lineItemsFromStore.glassParts ?? [];
const supportingItems = lineItemsFromStore.supportingItems ?? [];
const vaps = lineItemsFromStore.vaps ?? [];
const lineItemsToTax = [
resultMap.rainDefense,
...supportingItems,
...resultMap.wipers,
...glassParts,
...vaps,
];
const availableVaps = [resultMap.rainDefense, ...resultMap.wipers];
@ -378,6 +381,32 @@ export default {
);
}
// Because we don't yet have a robust solution for part interchange ...
// if there are front wiper line items in the revalidate response, we need to delete any existing front wiper line items from the store
// and replace them with those that come back from revalidation.
const revalidateResponseHasFrontWiperLineItems =
revalidatePromoResponse.promoLineItems.find(
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
).length > 0;
if (revalidateResponseHasFrontWiperLineItems) {
const frontWiperLineItemsInStore = this.lineItems.vaps.find(
(lineItem) => lineItem.partType == partTypeStrings.FRONT_WIPER
);
if (frontWiperLineItemsInStore.length > 0) {
this.lineItems.vaps = this.lineItems.vaps.find(
(lineItem) => lineItem.partType != partTypeStrings.FRONT_WIPER
);
}
}
const vapsToAddToCart = getVapsThatNeedToBeAddedToSatisfyPromos(
revalidatePromoResponse.promoLineItems,
this.availableVaps,
this.lineItems
);
this.lineItems.vaps.push(...vapsToAddToCart);
this.lineItems.promos = revalidatePromoResponse.promoLineItems;
this.inactivePromos = revalidatePromoResponse.errors.map((x) =>
getPromoCodeWithoutBundleIdentifier(x.promoCode)

View file

@ -60,7 +60,7 @@
<navbar
cmsWidgetName="FunnelFooterWidget"
@ForwardClicked="forwardButtonAction"
:isForwardActionDisabled="!meta.valid"
:isForwardActionDisabled="!meta.valid || !allDataRetrieved"
ref="navbar" />
</div>
</div>
@ -232,12 +232,14 @@ export default {
this.selectedMake = null;
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
}
} else {
this.makeOptions = [];
this.selectedMake = null;
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
}
},
async selectedMake(make) {
@ -248,11 +250,13 @@ export default {
else {
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
}
} else {
this.modelOptions = [];
this.selectedModel = null;
this.selectedStyle = null;
this.carId = null;
}
},
async selectedModel(model) {
@ -269,10 +273,14 @@ export default {
if (sameStyle) {
this.getVehicleDetails();
}
} else this.selectedStyle = null;
} else {
this.selectedStyle = null;
this.carId = null;
}
} else {
this.styleOptions = [];
this.selectedStyle = null;
this.carId = null;
}
},
async selectedStyle(style) {
@ -280,6 +288,7 @@ export default {
this.getVehicleDetails();
} else {
this.imageUrl = null;
this.carId = null;
}
},
},
@ -294,6 +303,15 @@ export default {
else if (this.imageUrl == null && this.carId !== null) return false;
else return true;
},
allDataRetrieved() {
return (
!!this.selectedYear &&
!!this.selectedMake &&
!!this.selectedModel &&
!!this.selectedStyle &&
!!this.carId
);
},
},
methods: {
getVehicle(year, make, model, style) {

View file

@ -172,6 +172,8 @@ router.beforeEach(async (to, from, next) => {
if (isInIframe && notToPIAReturn) {
const newUrl = `${window.top.location.origin}${to.href}`;
window.top.location.href = newUrl;
} else if (toQueryPage === fromQueryPage) {
router.go(0);
} else {
next();
}

View file

@ -132,6 +132,7 @@ const getDefaultState = () => {
workOrderNumber: null,
customerPortalLoginToken: null,
lockToken: null,
settledTenderAmount: 0,
},
applicationUser: {
eventBus: [],
@ -257,6 +258,9 @@ export const mutations = {
updateLockToken(state, lockToken) {
state.order.lockToken = lockToken;
},
updateSettledTenderAmount(state, settledTenderAmount) {
state.order.settledTenderAmount = settledTenderAmount;
},
updateCCToken(state, ccToken) {
state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId;
state.order.payment.ccToken.expMonth = ccToken.expMonth;
@ -1041,6 +1045,7 @@ export const actions = {
workOrderNumber,
customerPortalLoginToken,
lockToken,
settledTenderAmount,
}
) {
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
@ -1054,6 +1059,7 @@ export const actions = {
context.commit(storeMutations.WORK_ORDER_NUMBER, workOrderNumber);
context.commit(storeMutations.LOCK_TOKEN, lockToken);
context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken);
context.commit(storeMutations.UPDATE_SETTLED_TENDER_AMOUNT, settledTenderAmount);
},
logPageView(