Merge branch 'release/2024.12.12' into Feature/Digital/CSR-2338

This commit is contained in:
hiteshkumar87 2024-12-06 23:01:12 +05:30 committed by GitHub
commit 0875676dec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 117 additions and 40 deletions

View file

@ -102,6 +102,8 @@ const storeActions = {
RESET_SUBMITTED_ORDER: "resetSubmittedOrder",
RESET_EXTERNAL_PARAMETER_STATE: "resetExternalParameterState",
UPDATE_EXTERNAL_PARAMETER_MMS: "updateExternalParameterMMS",
SAVE_LOGGING_OPTION: "saveLoggingOption",
};
export { storeActions };

View file

@ -84,6 +84,7 @@ const storeMutations = {
UPDATE_STATE_WITH_ORDER_INFORMATION: "updateStateWithOrderInformation",
UPDATE_SAVE_SESSION_PROMISE: "updateSaveSessionPromise",
UPDATE_LAST_PAGE_VISITED: "updateLastPageVisited",
UPDATE_LOGGING_OPTION: "updateLoggingOption",
// EXPERIMENT MUTATIONS
UPDATE_EXPERIMENTS: "updateExperiments",

View file

@ -199,6 +199,7 @@ export default {
shouldHideRecalibration: Boolean,
isItac: Boolean,
isNoComp: Boolean,
isExpandedOnLoad: Boolean,
},
data() {
return {
@ -217,7 +218,7 @@ export default {
this.isExpanded = !this.isExpanded;
},
updateIsExpandedWithDefault() {
this.isExpanded = this.shouldHideRecalibration;
this.isExpanded = this.isExpandedOnLoad;
},
getVapsPrice(packageName) {
const vapsItems = this.getVapsCartItemsForSelectedPackage(packageName);
@ -297,8 +298,8 @@ export default {
this.lineItems[category] = this.lineItems[category].filter(
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
);
if (category == cartItemCategories.VAPS) {
await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false);
if (category == cartItemCategories.VAPS || category == cartItemCategories.PROMOS) {
this.saveVaps(this.lineItems);
}
if (category == cartItemCategories.SUPPORTING_ITEMS) {
await this.dispatchStoreAction(
@ -331,9 +332,8 @@ export default {
},
computed: {
isCartReadyToLoad() {
var myReturn = this.shouldHideRecalibration !== null;
this.updateIsExpandedWithDefault();
return myReturn;
return this.isExpandedOnLoad !== null;
},
lineItems: {
get: function () {
@ -749,8 +749,13 @@ export default {
recycleFeeCartItemName() {
return this.getCmsContent("RecycleFeeTextWidget", "Text");
},
requiresRecycleFeeCartItem() {
return !this.isRepair;
showRecycleFeeCartItem() {
if (!this.isInsurance || this.isItac || this.isNoComp) {
// CASH, ITAC, NOCOMP ORDERS
return !this.isRepair;
} else {
return false;
}
},
recycleFeeCartItem() {
let cartItem = null;
@ -759,7 +764,7 @@ export default {
(supportingItem) => supportingItem.partType == partTypeStrings.REPLACE_FEE
);
if (!recycleFeeLineItem && this.requiresRecycleFeeCartItem) {
if (!recycleFeeLineItem && this.showRecycleFeeCartItem) {
recycleFeeLineItem = {
partNumber: partTypeStrings.RECYCLE_FEE,
partType: partTypeStrings.REPLACE_FEE,

View file

@ -19,6 +19,11 @@ jest.mock("@/mixins/base-mixin", () => ({
return mockReturnsForStoreActions[action];
}
),
dispatchStoreAction: jest.fn(
(action, { promoCode, addableVaps }, pageNameToLog, someBool) => {
return mockReturnsForStoreActions[action];
}
),
},
}));
@ -286,6 +291,13 @@ describe("promo-modal-question.vue", () => {
(lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
));
await baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{
activePromos: lineItems.promos,
},
false
);
//Assert
expect(existingPromo).toEqual(lineItems.promos);

View file

@ -10,7 +10,7 @@
:ref="modalName"
:headerText="modalHeaderText"
:onModalClosedCallback="onModalClosed"
:onModalOpenedCallback="focusOnPromoInput"
:onModalOpenedCallback="openModal"
:footerButtonText="modalFooterText"
@footer-button-event="addPromoCode">
<promoQuestion
@ -230,6 +230,13 @@ export default {
(lineItemsToKeep) =>
getPromoCodeWithoutBundleIdentifier(lineItemsToKeep.promoCode) != promo
);
await baseMixin.methods.dispatchStoreAction(
storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,
{
activePromos: this.lineItems.promos,
},
false
);
},
getErrorMessage(error, additionalInfo) {
switch (error) {

View file

@ -13,7 +13,7 @@ export function updateOrCreateFunnelCookie() {
// Set up cookie with all the props.
setFunnelCookieProperties({
LastTouched: new Date().toUTCString(),
LastTouched: new Date().toJSON(),
SavedSessionTimeoutDate: store.getters.applicationUser.savedSessionTimeout,
DidHeritageFunnelUpdateLast: false,
ShouldResetState: false,

View file

@ -43,5 +43,5 @@ Function to calculate the date for the saved session timeout.
export function getDateForSavedSessionTimeout() {
const currentDate = new Date(new Date().toUTCString());
currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS);
return currentDate.toUTCString();
return currentDate.toJSON();
}

View file

@ -81,7 +81,7 @@ describe("getDateForSavedSessionTimeout", () => {
currentDate.setDate(currentDate.getDate() + applicationConfig.SAVED_SESSION_TIMEOUT_DAYS);
// Act
const result = getDateForSavedSessionTimeout();
const result = new Date(getDateForSavedSessionTimeout()).toUTCString();
// Assert
expect(result).toEqual(currentDate.toUTCString());

View file

@ -45,7 +45,7 @@
class="duration-text-block" />
</div>
<hr />
<hr class="mt-4 mb-0" />
<cart
v-if="ShowCart"
@ -60,6 +60,7 @@
:insuranceCompanyName="insuranceCompanyName"
:showInsuranceCoverageAs="showInsuranceCoverageAs"
:shouldHideRecalibration="shouldHideRecalibration"
:isExpandedOnLoad="false"
:isItac="isItac"
:isNoComp="isNoComp" />
@ -111,6 +112,8 @@ import { containsRecalParts } from "@/helpers/recal-helper.js";
export default {
name: "confirmation",
async beforeRouteEnter(to, from, next) {
const hasRecalPriceRemoveExperiment = await store.getters.shouldHideRecalibration;
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order
// Call APIs
@ -155,10 +158,6 @@ export default {
const isNoComp = submittedOrder?.policy?.isNoComp;
const isItac = submittedOrder?.policy?.isItac;
const isRecalibrationOnOrder = containsRecalParts(lineItemsFromSubmittedOrder);
const hasRecalPriceRemoveExperiment =
experimentMixin.methods
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
?.toLowerCase() === "true";
const shouldHideRecalibration = () => {
if (isNoComp || isItac) {

View file

@ -32,9 +32,10 @@
:showInsuranceCoverageAs="showInsuranceCoverageAs"
:shouldHideRecalibration="shouldHideRecalibration"
:isItac="isItac"
:isNoComp="isNoComp" />
:isNoComp="isNoComp"
:isExpandedOnLoad="false" />
<hr class="my-5" />
<hr />
<div>
<alert
@ -46,16 +47,16 @@
v-bind:isDismissible="false" />
</div>
<div v-if="!isInsurance" class="questions-about-service my-5">
<div
v-if="isRecalibrationOnOrder && shouldHideRecalibration"
class="questions-about-service my-5">
<textBlock
cmsWidgetName="QuestionsAboutYourServiceWidget"
justifyText="left"
class="service-questions" />
<textBlock cmsWidgetName="CallOrTextWidget" justifyText="left" />
<hr class="my-5" />
<div
class="d-flex flex-row checkbox-group"
v-if="isRecalibrationOnOrder && shouldHideRecalibration">
<div class="d-flex flex-row checkbox-group">
<checkboxQuestion
cmsWidgetName="RecalConfirmWidget"
class="mb-5"

View file

@ -55,11 +55,13 @@
v-model="lineItems"
servicePackageOptionsCmsName="ServicePackageTitle"
recyclingModalCmsWidgetName="RecycleModal"
:isInsurance="isInsurance"
:insuranceDeductible="currentDeductible"
:insuranceCompanyName="insuranceCompanyName"
:showInsuranceCoverageAs="showInsuranceCoverageAs"
:isItac="isItac"
:isNocomp="isNocomp" />
:isNoComp="isNoComp"
:isExpandedOnLoad="true" />
<hr class="mb-5" />

View file

@ -428,8 +428,11 @@ export default {
);
},
shouldHideRecalibration() {
if (this.isInsuranceSelected) return false;
return (experimentMixin.methods.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() === "true" && this.isRecalibrationOnOrder);
return (
experimentMixin.methods
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
?.toLowerCase() === "true" && this.isRecalibrationOnOrder
);
},
showAfterpayBanner() {
return (

View file

@ -436,7 +436,6 @@ export default {
policy.policyNumber !== "";
const skipVin = await skipVinLookup();
if (vehicleChangedDuringPolicyLookupInHeritage) {
if (skipVin) {
this.$router.navigateWithSaving(
@ -455,13 +454,22 @@ export default {
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false }
);
} else {
this.$router.navigateWithSaving(
this.navigationScenarios
.CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE,
this.$route,
{},
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false }
);
if (store.getters.vehicle.vin) {
this.$router.navigateWithSaving(
this.navigationScenarios
.CLICKED_FORWARD_WITH_REPLACE_AND_VERIFIED_INSURANCE,
this.$route,
{},
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false }
);
} else {
this.$router.navigateWithSaving(
this.navigationScenarios.CLICKED_FORWARD_WITHOUT_VIN,
this.$route,
{},
{ [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: false }
);
}
}
}
}

View file

@ -460,6 +460,7 @@ async function navigate(
const promo = getQuerystringParameter(queryStrings.PROMO);
const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR);
const logQs = getQuerystringParameter(queryStrings.LOG);
baseMixin.methods.dispatchStoreAction(storeActions.SAVE_LOGGING_OPTION, logQs, false);
log("------------- router index.js navigate start -----------------");
log(" --scenario: ", scenario);

View file

@ -41,7 +41,11 @@ import {
coverageTypeValue,
coverageTypeEnum,
} from "@/constants/insurance";
import { containsRecalParts, getTopLevelPartsWithRecal } from "@/helpers/recal-helper";
import {
containsRecalParts,
getTopLevelPartsWithRecal,
isRecalPartOrHasChildRecalPart,
} from "@/helpers/recal-helper";
import { externalParameterStatus } from "@/constants/external-parameters";
import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
@ -180,6 +184,7 @@ const getDefaultState = () => {
experiments: [],
triggeredSiteEntry: false,
affiliateCookies: [],
loggingOption: false,
},
};
};
@ -410,6 +415,9 @@ export const mutations = {
updateLastPageVisited(state, lastPageVisited) {
state.applicationUser.lastPageVisited = lastPageVisited;
},
updateLoggingOption(state, loggingOption) {
state.applicationUser.loggingOption = loggingOption;
},
// EVENT BUS MUTATIONS
addEventToBus(state, event) {
state.applicationUser.eventBus.push(event);
@ -685,6 +693,10 @@ export const mutations = {
!sessionInformation.order.payment.isInsurance &&
!sessionInformation.order.serviceLocation.provider?.providerNumber
) {
console.log(
"------------- updateStateWithOrderInformation reset isInsurance -----------------"
);
console.log(new Date() + " sessionInformation: " + JSON.stringify(sessionInformation));
state.order.payment.isInsurance = null;
} else {
state.order.payment.isInsurance = sessionInformation.order.payment.isInsurance;
@ -1025,6 +1037,7 @@ export const actions = {
endpoint: endpoints.LookupVehicleByVin.url,
payload: {
vin: vin, // EX "1J4GW58S4XC541166"
logEnabled: context.getters.applicationUser.loggingOption,
},
logApiCall: true,
pageNameToLog: pageNameToLog,
@ -1651,9 +1664,10 @@ export const actions = {
const partialLineItemsObjects = context.getters.order.lineItems.glassParts?.map(
(lineItem) => ({
partNumber: lineItem.partNumber,
recalibrationType: lineItem.recalibrationType
? escapeRecalibrationType(lineItem.recalibrationType)
: undefined,
recalibrationType:
lineItem.recalibrationType && isRecalPartOrHasChildRecalPart(lineItem)
? escapeRecalibrationType(lineItem.recalibrationType)
: undefined,
})
);
@ -3009,6 +3023,15 @@ export const actions = {
);
},
saveLoggingOption(context, loggingOption) {
var option = false;
if (loggingOption != null) {
option = loggingOption == "true" ? true : false;
}
context.commit(storeMutations.UPDATE_LOGGING_OPTION, option);
},
async getRecalPartsAndSaveToLineItems(context, { pageNameToLog }) {
// identify each part that needs recal
const glassParts = context.state.order?.lineItems?.glassParts

View file

@ -404,6 +404,11 @@ describe("Actions", () => {
it("lookupVehicleByVin action, should return car data", async () => {
// Arrange
const context = state;
context.getters = {
applicationUser: {
loggingOption: false,
},
};
// Act
globalMethods.callHttpClient.mockImplementation(() => {

View file

@ -10,7 +10,7 @@ body {
overflow-x: unset;
}
&.page-container-grouped-styles {
height: 100vh;
height: 100dvh;
display: flex;
flex-direction: column;
}
@ -68,6 +68,14 @@ body {
height: 1px;
overflow: hidden;
}
// Fix "iOS viewport scroll bug" issue on iPhone
// where bottom of page is covered by address bar
@media only screen and (min-device-width: 375px) and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3) and (orientation: portrait) {
.page-container-grouped-styles {
padding-bottom: 3rem;
}
}
}
.modal-open {
.container-fluid {

View file

@ -7,7 +7,7 @@
]"
v-model="selectedValue">
<div
class="button-content list-button-horizontal-content d-flex flex-column justify-content-center p-2">
class="button-content list-button-horizontal-content d-flex flex-column justify-content-center py-3 px-1">
<span class="m-0" :class="textPosition">
{{ buttonLabel }}
</span>