From 79e56c643a68b197f19c9f9064817ffa45ea2c8a Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Mon, 3 Feb 2025 13:47:03 -0500 Subject: [PATCH 01/17] CASH-177: CSS fix for button/link outline --- .../save-progress-modal-question.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue index 5b885f27f..27ca1f479 100644 --- a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue +++ b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue @@ -123,6 +123,7 @@ export default { flex-direction: row; justify-content: center; align-items: center; + height: 3rem; border-radius: 0.5rem; &.progress-saved { @@ -156,6 +157,10 @@ export default { background: none; box-shadow: none; } + &:focus-visible span { + outline: 2px solid #005FCC; + border-radius: .25rem; + } &.delay { // fixes flicker while transitioning between states transition: background 0s 0s ease-in-out; @@ -205,7 +210,7 @@ export default { } } } - + .alert { border-radius: $border-radius-lg; border: 1px solid $green; From 969ea18d2a53e03c24b474146c42f3bdc302f879 Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Mon, 3 Feb 2025 13:55:06 -0500 Subject: [PATCH 02/17] CASH-97 CASH-97 got phone number from leadGen and populated customer-details phone number field --- src/constants/header-keys.js | 2 +- src/constants/query-strings.js | 1 + src/constants/store-mutations.js | 2 + .../save-progress-modal-question.vue | 2 +- .../save-progress-popup-question.vue | 4 +- src/layouts/confirmation/confirmation.vue | 30 ++++++--------- src/layouts/vehicle/vehicle.vue | 6 ++- src/router/index.js | 7 ++++ src/store/index.js | 38 ++++++++++--------- 9 files changed, 52 insertions(+), 40 deletions(-) diff --git a/src/constants/header-keys.js b/src/constants/header-keys.js index d9b3578c4..ed88393b5 100644 --- a/src/constants/header-keys.js +++ b/src/constants/header-keys.js @@ -5,5 +5,5 @@ export const headerKeys = { SESSION_SEQUENCE_NUMBER: "X-Session-Sequence-Number", TRANSACTION_ID: "X-Transaction-Id", EON: "X-Enterprise-Order-Number", - LOG_ENABLED: "log-enabled" + LOG_ENABLED: "log-enabled", }; diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index 210ac28f0..f5881f005 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -46,6 +46,7 @@ const queryStrings = { ORGANIC_SOCIAL: "organic_social", EXPERIMENTS: "experiments", FROM_HERITAGE: "fromheritage", + PHONE_NUMBER: "phonenumber", }; export { queryStrings }; diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index f625e27cf..2f231bb59 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -107,6 +107,7 @@ const storeMutations = { UPDATE_EXTERNAL_PARAMETER_VIN_SELECTION: "updateExternalParameterVinSelection", UPDATE_EXTERNAL_PARAMETER_SERVICE_PACKAGE: "updateExternalParameterServicePackage", UPDATE_EXTERNAL_PARAMETER_SOURCE: "updateExternalParameterSource", + UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER: "updateExternalParameterPhoneNumber", //RESET EXTERNAL_PARAMETER MUTATIONS RESET_EXTERNAL_PARAMETER_VEHICLE_STATE: "resetExternalParameterVehicleState", @@ -115,6 +116,7 @@ const storeMutations = { RESET_EXTERNAL_PARAMETER_SERVICEZIP_STATE: "resetExternalParameterServiceZipState", RESET_EXTERNAL_PARAMETER_QUOTE_STATE: "resetExternalParameterQuoteState", RESET_EXTERNAL_PARAMETER_SOURCE_STATE: "resetExternalParameterSourceState", + RESET_EXTERNAL_PARAMETER_CUSTOMER_STATE: "resetExternalParameterCustomerState", RESET_IS_EXTERNAL_PARAMETER: "resetIsExternalParameter", //Affiliate Cookies diff --git a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue index 5b885f27f..873e58709 100644 --- a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue +++ b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue @@ -205,7 +205,7 @@ export default { } } } - + .alert { border-radius: $border-radius-lg; border: 1px solid $green; diff --git a/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue b/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue index 5d98d5c4b..34ef44e71 100644 --- a/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue +++ b/src/fmg-components/save-progress-popup-question/save-progress-popup-question.vue @@ -219,7 +219,7 @@ export default { .textbox-question { padding: 0; margin: 0 0 1.5rem 0; - + label { text-align: left; font-weight: 900; @@ -258,7 +258,7 @@ export default { &.progress-saved { .modal-footer-button, - .modal-disclaimer { + .modal-disclaimer { display: none; } .skip-button { diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index f699d6a59..f05bece86 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -116,13 +116,13 @@ export default { // send part question data to SPS API for logging const orderFromStore = await deepClone(store.getters.order); - const ctu = orderFromStore.serviceLocation?.zipCodeCtu + const ctu = orderFromStore.serviceLocation?.zipCodeCtu; const partsOrQuestions = orderFromStore.damage?.partQuestionAnswers; - partsOrQuestions.forEach(pqa => { + partsOrQuestions.forEach((pqa) => { const payloadPartQuestions = []; - pqa.answeredQuestions.forEach(answer => { + pqa.answeredQuestions.forEach((answer) => { payloadPartQuestions.push({ questionSeq: answer?.questionNum, questionText: answer?.questionText, @@ -132,24 +132,18 @@ export default { }); const payload = { - eon: orderFromStore.eon, - ctu: ctu, - workOrderId: orderFromStore.workOrderId, - workOrderNumber: orderFromStore.workOrderNumber, - carId: orderFromStore.vehicle.carId, - glassLocation: pqa?.glassLocation, - partQuestions: payloadPartQuestions, - }; - - baseMixin.methods.dispatchStoreAction( - storeActions.LOG_PART_QUESTIONS, - payload, - false - ); + eon: orderFromStore.eon, + ctu: ctu, + workOrderId: orderFromStore.workOrderId, + workOrderNumber: orderFromStore.workOrderNumber, + carId: orderFromStore.vehicle.carId, + glassLocation: pqa?.glassLocation, + partQuestions: payloadPartQuestions, + }; + baseMixin.methods.dispatchStoreAction(storeActions.LOG_PART_QUESTIONS, payload, false); }); - // Create order await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index c81dfa2b0..fa7f5c036 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -80,7 +80,11 @@ import vehicleQuestion from "@/layouts/vehicle/vehicle-question/vehicle-question // Supporting files import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { experimentUniverses } from "@/constants/experiments"; -import { getSessionKeyValue, getUserIdValue, getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper"; +import { + getSessionKeyValue, + getUserIdValue, + getDeviceIdValue, +} from "@/helpers/heritage-integration/cookie-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import { Form, defineRule } from "vee-validate"; import { required } from "@/helpers/validation-rules"; diff --git a/src/router/index.js b/src/router/index.js index 76d1203b7..2230a652d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -837,6 +837,7 @@ function updateExternalParameterState() { const externalParameterServicePackage = getQuerystringParameter(queryStrings.SERVICE_PACKAGE); const externalParameterNumberOfChips = getQuerystringParameter(queryStrings.NUMBER_OF_CHIPS); const externalParameterSource = getQuerystringParameter(queryStrings.EXPERIMENTS); + const externalParameterPhoneNumber = getQuerystringParameter(queryStrings.PHONE_NUMBER); if ( externalParameterYear && externalParameterMake && @@ -892,6 +893,12 @@ function updateExternalParameterState() { if (externalParameterSource) { store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_SOURCE, externalParameterSource); } + if (externalParameterPhoneNumber) { + store.commit( + storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER, + externalParameterPhoneNumber + ); + } } // if there is an existing external parameter state then they have already been through from an external source(LeadGen) and diff --git a/src/store/index.js b/src/store/index.js index 77a1f1e95..c41d51d05 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -495,6 +495,11 @@ export const mutations = { externalParameterState.quote.servicePackage = servicePackage; saveExternalParameterState(externalParameterState); }, + updateExternalParameterPhoneNumber(state, phoneNumber) { + externalParameterState.customer.phoneNumber = phoneNumber; + state.order.customer.phoneNumber = externalParameterState.customer.phoneNumber; + saveExternalParameterState(externalParameterState); + }, //RESET ExternalParameter MUTATIONS resetExternalParameterVehicleState(state) { externalParameterState.vehicle.year = null; @@ -528,6 +533,10 @@ export const mutations = { externalParameterState.isExternalParameter = externalParameterStatus.INACTIVE; saveExternalParameterState(externalParameterState); }, + resetExternalParameterCustomerState(state) { + externalParameterState.customer.phoneNumber = null; + saveExternalParameterState(externalParameterState); + }, // RESET DEPENDENCY MUTATIONS resetVehicleState(state) { @@ -984,6 +993,7 @@ export const getters = { externalParameterQuote: (state) => externalParameterState?.quote, externalParameterServiceZip: (state) => externalParameterState?.serviceZip, externalParameterEstimate: (state) => externalParameterState?.estimate, + externalParameterCustomer: (state) => externalParameterState?.customer, isExternalParameter: (state) => externalParameterState?.isExternalParameter, }; @@ -1448,16 +1458,7 @@ export const actions = { logPartQuestions( context, - { - eon, - ctu, - workOrderId, - workOrderNumber, - carId, - glassLocation, - partQuestions, - userAgent, - } + { eon, ctu, workOrderId, workOrderNumber, carId, glassLocation, partQuestions, userAgent } ) { var payload = { applicationName: applicationConfig.APPLICATION_NAME, @@ -1468,15 +1469,14 @@ export const actions = { carId: carId, glassLocation: glassLocation, partQuestions: partQuestions, - userAgent: navigator.userAgent + userAgent: navigator.userAgent, }; - return globalMethods - .callHttpClient({ - method: endpoints.LogPartQuestions.method, - endpoint: endpoints.LogPartQuestions.url, - payload: payload, - }); + return globalMethods.callHttpClient({ + method: endpoints.LogPartQuestions.method, + endpoint: endpoints.LogPartQuestions.url, + payload: payload, + }); }, // Misc Actions @@ -3132,6 +3132,7 @@ export const actions = { context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_ESTIMATE_STATE); context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_SERVICEZIP_STATE); context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_QUOTE_STATE); + context.commit(storeMutations.RESET_EXTERNAL_PARAMETER_CUSTOMER_STATE); context.commit(storeMutations.RESET_IS_EXTERNAL_PARAMETER); } }, @@ -3704,6 +3705,9 @@ function createExternalParameterDefaultState() { isInsurance: null, servicePackage: null, }, + customer: { + phoneNumber: null, + }, }; // set to session storage saveExternalParameterState(externalParameterDefaultState); From 8a0d622049c323c0105ea6be543a77022bd2ee67 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 3 Feb 2025 15:07:38 -0500 Subject: [PATCH 03/17] CASH-48 CASH-48 null check --- src/layouts/confirmation/confirmation.vue | 54 +++++++++++------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index f699d6a59..d495d8217 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -120,35 +120,35 @@ export default { const partsOrQuestions = orderFromStore.damage?.partQuestionAnswers; - partsOrQuestions.forEach(pqa => { - const payloadPartQuestions = []; - pqa.answeredQuestions.forEach(answer => { - payloadPartQuestions.push({ - questionSeq: answer?.questionNum, - questionText: answer?.questionText, - answerText: answer?.selectedAnswerText, - basePart: pqa?.result, + if (partsOrQuestions) { + partsOrQuestions.forEach(pqa => { + const payloadPartQuestions = []; + pqa.answeredQuestions.forEach(answer => { + payloadPartQuestions.push({ + questionSeq: answer?.questionNum, + questionText: answer?.questionText, + answerText: answer?.selectedAnswerText, + basePart: pqa?.result, + }); }); + + const payload = { + eon: orderFromStore.eon, + ctu: ctu, + workOrderId: orderFromStore.workOrderId, + workOrderNumber: orderFromStore.workOrderNumber, + carId: orderFromStore.vehicle.carId, + glassLocation: pqa?.glassLocation, + partQuestions: payloadPartQuestions, + }; + + baseMixin.methods.dispatchStoreAction( + storeActions.LOG_PART_QUESTIONS, + payload, + false + ); }); - - const payload = { - eon: orderFromStore.eon, - ctu: ctu, - workOrderId: orderFromStore.workOrderId, - workOrderNumber: orderFromStore.workOrderNumber, - carId: orderFromStore.vehicle.carId, - glassLocation: pqa?.glassLocation, - partQuestions: payloadPartQuestions, - }; - - baseMixin.methods.dispatchStoreAction( - storeActions.LOG_PART_QUESTIONS, - payload, - false - ); - - }); - + } // Create order await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_ORDER); // This nulls the Store order From 5c8999899c84b7832ad6eb0bf59766dfa8971fec Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Mon, 3 Feb 2025 17:06:51 -0500 Subject: [PATCH 04/17] CASH-97 CASH-97 update to externalParameterPhoneNumber mutation --- src/store/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index c41d51d05..c93ddf90a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -497,7 +497,6 @@ export const mutations = { }, updateExternalParameterPhoneNumber(state, phoneNumber) { externalParameterState.customer.phoneNumber = phoneNumber; - state.order.customer.phoneNumber = externalParameterState.customer.phoneNumber; saveExternalParameterState(externalParameterState); }, //RESET ExternalParameter MUTATIONS From 19f775c46332cf18937861f8c2d23d633d87b5a4 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 4 Feb 2025 06:40:19 -0500 Subject: [PATCH 05/17] CASH-97 CASH-97 use a store action/mutation to persist phone number in vuex. --- src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 1 + src/router/index.js | 4 ++++ src/store/index.js | 7 +++++++ 4 files changed, 13 insertions(+) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index aee8d705f..ec6b0db0c 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -76,6 +76,7 @@ const storeActions = { SAVE_SERVICE_LOCATION: "saveServiceLocation", SAVE_SCHEDULE: "saveSchedule", SAVE_EMAIL: "saveEmail", + SAVE_PHONE_NUMBER: "savePhoneNumber", SAVE_REGISTRATION_LICENSE_PLATE_LOOKUP: "saveRegistrationLicensePlateLookup", SAVE_VIN: "saveVin", SAVE_REGISTRATION_ADDRESS_LOOKUP: "saveRegistrationAddressLookup", diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 2f231bb59..1ebf39b8d 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -41,6 +41,7 @@ const storeMutations = { // CUSTOMER MUTATIONS UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress", + UPDATE_CUSTOMER_PHONE_NUMBER: "updateCustomerPhoneNumber", UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails", // ORDER MUTATIONS diff --git a/src/router/index.js b/src/router/index.js index 2230a652d..9595cf11c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -898,6 +898,10 @@ function updateExternalParameterState() { storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER, externalParameterPhoneNumber ); + store.commit( + storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, + externalParameterPhoneNumber + ); } } diff --git a/src/store/index.js b/src/store/index.js index c93ddf90a..c591d493d 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -343,6 +343,9 @@ export const mutations = { updateCustomerEmailAddress(state, customerEmailAddress) { state.order.customer.emailAddress = customerEmailAddress; }, + updateCustomerPhoneNumber(state, phoneNumber) { + state.order.customer.phoneNumber = phoneNumber; + }, updateVehicle(state, vehicleInfo) { state.order.vehicle.year = vehicleInfo.year; state.order.vehicle.make = vehicleInfo.make; @@ -3038,6 +3041,10 @@ export const actions = { context.commit(storeMutations.UPDATE_CUSTOMER_EMAIL_ADDRESS, email === "" ? null : email); }, + savePhoneNumber(context, phoneNumber) { + context.commit(storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, phoneNumber === "" ? null : phoneNumber); + }, + saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) { //Reset dependent state when changing if (vehicleInfo.vin !== context.state.order.vehicle.vin) { From c2b7ed99dc8853ad5cf58ebc3d15669f7731767f Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 4 Feb 2025 07:05:43 -0500 Subject: [PATCH 06/17] CASH-97 code coverage CASH-97 code coverage --- jest.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jest.config.js b/jest.config.js index ce4aa3ad6..04f474e53 100644 --- a/jest.config.js +++ b/jest.config.js @@ -12,6 +12,7 @@ module.exports = { "!src/constants/*.js", "!src/router/**/*.js", "!src/helpers/unit-test-helper.js", + "!src/helpers/logger.js", "!src/layouts/vehicle-damage/windshield-options/windshield-options.vue", "!src/layouts/reveal/**/*.vue", "!src/layouts/payment-method/**/*.vue", From 233a5fa4f091e47ed42674412f9dff5988fbe137 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 4 Feb 2025 09:10:39 -0500 Subject: [PATCH 07/17] CASH-97 CASH-97 use store action --- src/router/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 9595cf11c..83004b38c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -898,10 +898,7 @@ function updateExternalParameterState() { storeMutations.UPDATE_EXTERNAL_PARAMETER_PHONE_NUMBER, externalParameterPhoneNumber ); - store.commit( - storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, - externalParameterPhoneNumber - ); + store.dispatch(storeActions.SAVE_PHONE_NUMBER, externalParameterPhoneNumber); } } From f716c1fc883b9afae2baec0b9bcba9afaa4094b0 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 4 Feb 2025 12:52:37 -0500 Subject: [PATCH 08/17] Don't refresh dxdev cookie with other cookies. --- src/helpers/heritage-integration/cookie-helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/cookie-helper.js b/src/helpers/heritage-integration/cookie-helper.js index 4ff5c0c8e..6e78d1304 100644 --- a/src/helpers/heritage-integration/cookie-helper.js +++ b/src/helpers/heritage-integration/cookie-helper.js @@ -201,7 +201,8 @@ export function areAllSessionCookiesSet() { export function refreshSessionExpiration() { refreshCookieExpiration(cookieNames.SESSION_ID, cookieExpirations.SESSION_ID); - refreshCookieExpiration(cookieNames.DXDEV, cookieExpirations.DXDEV); + // Change 2/4/25: Don't update DXDEV to avoid Safari constraints on client-set cookies. + // refreshCookieExpiration(cookieNames.DXDEV, cookieExpirations.DXDEV); refreshCookieExpiration(cookieNames.FUNNEL_USER_ID, cookieExpirations.FUNNEL_USER_ID); refreshCookieExpiration(cookieNames.FUNNEL_SESSION_KEY, cookieExpirations.FUNNEL_SESSION_KEY); } From d92cb225c2a3dce2b1520cb01e3f60cecfac850a Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 5 Feb 2025 16:45:50 +0530 Subject: [PATCH 09/17] CASH-182 Do not assign service type and schedule details from load session once user make selection. it is overriding user selection. --- src/store/index.js | 81 +++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 36 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index c591d493d..b02f7907a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -49,6 +49,7 @@ import { import { externalParameterStatus } from "@/constants/external-parameters"; import { experimentSettings } from "@/constants/experiments"; import experimentMixin from "@/mixins/experiment-mixin.js"; +import { Store } from "vuex/dist/vuex.cjs.js"; // Export State const getDefaultState = () => { @@ -678,34 +679,38 @@ export const mutations = { sessionInformation.order.payment.billToAccountNumber; state.order.payment.inactivePromos = sessionInformation.order.payment.inactivePromos; - state.order.serviceLocation.address = - sessionInformation.order.serviceLocation.streetAddress; - state.order.serviceLocation.address2 = - sessionInformation.order.serviceLocation.streetAddress2; - state.order.serviceLocation.city = sessionInformation.order.serviceLocation.city; - state.order.serviceLocation.state = sessionInformation.order.serviceLocation.state; - state.order.serviceLocation.zipCode = sessionInformation.order.serviceLocation.zipCode; - state.order.serviceLocation.zipCodeCtu = - sessionInformation.order.serviceLocation.zipCodeCtu; + //Do not assign default service type once user make service type selection + if (state.order.serviceLocation.appointmentType == null) { + state.order.serviceLocation.address = + sessionInformation.order.serviceLocation.streetAddress; + state.order.serviceLocation.address2 = + sessionInformation.order.serviceLocation.streetAddress2; + state.order.serviceLocation.city = sessionInformation.order.serviceLocation.city; + state.order.serviceLocation.state = sessionInformation.order.serviceLocation.state; + state.order.serviceLocation.zipCode = sessionInformation.order.serviceLocation.zipCode; + state.order.serviceLocation.zipCodeCtu = + sessionInformation.order.serviceLocation.zipCodeCtu; - state.order.serviceLocation.appointmentType = - sessionInformation.order.serviceLocation.appointmentType; - state.order.serviceLocation.isVehicleProtected = - sessionInformation.order.serviceLocation.isVehicleProtected; + state.order.serviceLocation.appointmentType = + sessionInformation.order.serviceLocation.appointmentType; + state.order.serviceLocation.isVehicleProtected = + sessionInformation.order.serviceLocation.isVehicleProtected; - state.order.serviceLocation.provider.providerNumber = - sessionInformation.order.serviceLocation.provider?.providerNumber; - state.order.serviceLocation.provider.address.streetAddress = - sessionInformation.order.serviceLocation.provider?.address?.streetAddress; - state.order.serviceLocation.provider.address.city = - sessionInformation.order.serviceLocation.provider?.address?.city; - state.order.serviceLocation.provider.address.state = - sessionInformation.order.serviceLocation.provider?.address?.state; - state.order.serviceLocation.provider.address.zipCode = - sessionInformation.order.serviceLocation.provider?.address?.zipCode; - state.order.serviceLocation.provider.address.zipCodeCtu = - sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu; - state.order.serviceLocation.techNotes = sessionInformation.order.serviceLocation.techNotes; + state.order.serviceLocation.provider.providerNumber = + sessionInformation.order.serviceLocation.provider?.providerNumber; + state.order.serviceLocation.provider.address.streetAddress = + sessionInformation.order.serviceLocation.provider?.address?.streetAddress; + state.order.serviceLocation.provider.address.city = + sessionInformation.order.serviceLocation.provider?.address?.city; + state.order.serviceLocation.provider.address.state = + sessionInformation.order.serviceLocation.provider?.address?.state; + state.order.serviceLocation.provider.address.zipCode = + sessionInformation.order.serviceLocation.provider?.address?.zipCode; + state.order.serviceLocation.provider.address.zipCodeCtu = + sessionInformation.order.serviceLocation.provider?.address?.zipCodeCtu; + state.order.serviceLocation.techNotes = + sessionInformation.order.serviceLocation.techNotes; + } // if we're loading a session and we do not have a provider number yet, then set isInsurance to null so that // a service package is not selected by default on the quote page. @@ -749,14 +754,15 @@ export const mutations = { state.applicationUser.savedSessionId = sessionInformation.applicationUser.savedSessionId; } - - state.order.schedule.date = sessionInformation.order.schedule?.date; - 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; - state.order.schedule.jobMinMinutes = sessionInformation.order.schedule?.jobMinMinutes; - + //Do not assign default schedule details once user make schedule selection + if (state.order.schedule.date == null) { + state.order.schedule.date = sessionInformation.order.schedule?.date; + 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; + state.order.schedule.jobMinMinutes = sessionInformation.order.schedule?.jobMinMinutes; + } state.order.policy.currentDeductible = sessionInformation.order.policy?.currentDeductible; state.order.policy.originalDeductible = sessionInformation.order.policy?.originalDeductible; state.order.policy.additionalAuthFlag = sessionInformation.order.policy?.additionalAuthFlag; @@ -2254,7 +2260,7 @@ export const actions = { response.data ); - await resetScheduleIfUnavailable(context, response.data.order, pageNameToLog); + await resetScheduleIfUnavailable(context, context.state.order, pageNameToLog); return response; }, (error) => { @@ -3042,7 +3048,10 @@ export const actions = { }, savePhoneNumber(context, phoneNumber) { - context.commit(storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, phoneNumber === "" ? null : phoneNumber); + context.commit( + storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, + phoneNumber === "" ? null : phoneNumber + ); }, saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) { From 8af9fcc0a315da91b7869bb32938c194726aec9d Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Wed, 5 Feb 2025 18:36:44 +0530 Subject: [PATCH 10/17] CASH-182 remove unwanted file reference --- src/store/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/store/index.js b/src/store/index.js index b02f7907a..c46d35a0b 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -49,7 +49,6 @@ import { import { externalParameterStatus } from "@/constants/external-parameters"; import { experimentSettings } from "@/constants/experiments"; import experimentMixin from "@/mixins/experiment-mixin.js"; -import { Store } from "vuex/dist/vuex.cjs.js"; // Export State const getDefaultState = () => { From 690d992ef7a52c7798c74ff1b80e51a299272ee8 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 5 Feb 2025 09:03:46 -0500 Subject: [PATCH 11/17] CASH-176 CASH-176 service zip changes for sms --- src/constants/error-messages.js | 2 + src/constants/store-actions.js | 1 + src/layouts/confirmation/confirmation.vue | 4 +- src/layouts/service-zip/service-zip.vue | 45 +++++++++++++------ src/mixins/vin-pages-mixin.js | 9 ++++ src/router/router-constants/fmgPage-values.js | 1 + src/store/index.js | 29 +++++++++++- 7 files changed, 74 insertions(+), 17 deletions(-) diff --git a/src/constants/error-messages.js b/src/constants/error-messages.js index 4326a5412..45841f21f 100644 --- a/src/constants/error-messages.js +++ b/src/constants/error-messages.js @@ -18,6 +18,8 @@ const errorMessages = { LAST_NAME_REQUIRED: "Please enter your last name", EMAIL_ADDRESS_REQUIRED: "Please enter your email address", EMAIL_ADDRESS_FORMAT: "Please enter a valid email address", + EMAIL_SMS_REQUIRED: "Please enter your mobile phone number or email", + EMAIL_SMS_FORMAT: "Please enter a valid mobile phone number or email", SERVICE_ZIP_REQUIRED: "Please enter your service ZIP", SERVICE_ZIP_FORMAT: "Please enter a valid service ZIP", VIN_REQUIRED: "Please enter your VIN", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index ec6b0db0c..833645578 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -1,6 +1,7 @@ const storeActions = { // Content Actions GET_PAGE_DATA: "getPageData", + SAVE_PAGE_DATA: "savePageData", // Vehicle Actions GET_VEHICLE_YEARS: "getVehicleYears", diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 0739a9af6..804ed5608 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -121,9 +121,9 @@ export default { const partsOrQuestions = orderFromStore.damage?.partQuestionAnswers; if (partsOrQuestions) { - partsOrQuestions.forEach(pqa => { + partsOrQuestions.forEach((pqa) => { const payloadPartQuestions = []; - pqa.answeredQuestions.forEach(answer => { + pqa.answeredQuestions.forEach((answer) => { payloadPartQuestions.push({ questionSeq: answer?.questionNum, questionText: answer?.questionText, diff --git a/src/layouts/service-zip/service-zip.vue b/src/layouts/service-zip/service-zip.vue index b74db95dc..18a8b3362 100644 --- a/src/layouts/service-zip/service-zip.vue +++ b/src/layouts/service-zip/service-zip.vue @@ -23,11 +23,11 @@ @@ -88,16 +88,17 @@ import vinPagesMixin from "@/mixins/vin-pages-mixin"; import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import baseMixin from "@/mixins/base-mixin.js"; import { queryStrings } from "@/constants/query-strings"; +import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; // Define Validation Rules defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT)); -defineRule("email-address-required", required(errorMessages.EMAIL_ADDRESS_REQUIRED)); +defineRule("email-sms-required", required(errorMessages.EMAIL_SMS_REQUIRED)); defineRule( - "email-address-format", + "email-sms-format", regex( - /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, - errorMessages.EMAIL_ADDRESS_FORMAT + /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$|^\(?(\d{3})\)?[-. ]?(\d{3})[-. ]?(\d{4})$/, + errorMessages.EMAIL_SMS_FORMAT ) ); defineRule("option-required", required(errorMessages.OPTION_REQUIRED)); @@ -108,7 +109,7 @@ export default { data() { return { serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, - emailAddress: this.getEmailFromStore(), + emailOrSms: this.getEmailOrSmsFromStore(), displayInvalidZipAlert: false, displayNonServiceableZipAlert: false, }; @@ -160,11 +161,11 @@ export default { store.getters.order.serviceLocation.zipCode ); }, - getEmailFromStore() { - return ( - store.getters.externalParameterServiceZip.emailAddress ?? - store.getters.order.customer.emailAddress - ); + getEmailOrSmsFromStore() { + return store.getters.emailOrSms; + }, + getPhoneFromStore() { + return store.getters.order.customer.phoneNumber; }, arePagePrerequisitesValid() { return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0; @@ -186,7 +187,23 @@ export default { }, async forwardButtonAction() { const zipCodeData = await this.getZipCodeData(this.serviceZipCode); - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, 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); + } + + await this.dispatchStoreAction( + storeActions.SAVE_PAGE_DATA, + { + page: fmgPageValues.EMAIL_SMS_PAGES, + data: { emailOrSmsValue: this.emailOrSms }, + }, + false + ); + await this.dispatchStoreAction( storeActions.SAVE_SERVICE_ZIP_CODE_INFO, { diff --git a/src/mixins/vin-pages-mixin.js b/src/mixins/vin-pages-mixin.js index 7d15066c5..fc195d910 100644 --- a/src/mixins/vin-pages-mixin.js +++ b/src/mixins/vin-pages-mixin.js @@ -16,6 +16,11 @@ export default { ? "email-address-format" : "email-address-required|email-address-format"; }, + EmailOrSmsValidationRules() { + return this.IsEmailOptional + ? "email-sms-format" + : "email-sms-required|email-sms-format"; + }, }, methods: { async navigateForwardWithSingleCarMatch() { @@ -56,5 +61,9 @@ export default { false ); }, + isPhoneNumber(input) { + const phoneRegex = /^\(?(\d{3})\)?[-. ]?(\d{3})[-. ]?(\d{4})$/; + return phoneRegex.test(input); + }, }, }; diff --git a/src/router/router-constants/fmgPage-values.js b/src/router/router-constants/fmgPage-values.js index 5fade6506..1cba0414b 100644 --- a/src/router/router-constants/fmgPage-values.js +++ b/src/router/router-constants/fmgPage-values.js @@ -23,6 +23,7 @@ const fmgPageValues = { PAYMENT_PIA_RETURN: "payment-pia-return", CONFIRMATION: "confirmation", RETURN_USER: "return-user", + EMAIL_SMS_PAGES: "email-or-sms-related-pages", }; const funnelStartPageName = fmgPageValues.VEHICLE; diff --git a/src/store/index.js b/src/store/index.js index c591d493d..a137dd7ef 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -997,6 +997,26 @@ export const getters = { externalParameterEstimate: (state) => externalParameterState?.estimate, externalParameterCustomer: (state) => externalParameterState?.customer, isExternalParameter: (state) => externalParameterState?.isExternalParameter, + + emailOrSms: (state) => { + const email = externalParameterState.serviceZip.emailAddress ?? state.order.customer.emailAddress; + const phone = state.order.customer.phoneNumber; + + if (!phone && !email) { + return null; + } + + if (phone && !email) { + return phone; + } + + if (email && !phone) { + return email; + } + + // if we're here, then we have both email and phone so get the value from pageData to reflect what they entered on the page + return state.applicationUser.pageData[fmgPageValues.EMAIL_SMS_PAGES]?.emailOrSmsValue; + }, }; function getNonFalseValuesOfPropertyInArrayOfObjects(array, propertyName) { @@ -3042,7 +3062,14 @@ export const actions = { }, savePhoneNumber(context, phoneNumber) { - context.commit(storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, phoneNumber === "" ? null : phoneNumber); + context.commit( + storeMutations.UPDATE_CUSTOMER_PHONE_NUMBER, + phoneNumber === "" ? null : phoneNumber + ); + }, + + savePageData(context, emailOrSms) { + context.commit(storeMutations.UPDATE_PAGE_DATA, emailOrSms); }, saveVin(context, { isSelectedGlassAvailableForVehicle, vehicleInfo }) { From d728cd76488f1c2cc1f4f0e664c20fe8b470314d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 5 Feb 2025 09:32:42 -0500 Subject: [PATCH 12/17] CASH-176 CASDH-176 mock emailOrSms for test --- src/layouts/service-zip/service-zip.spec.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/layouts/service-zip/service-zip.spec.js b/src/layouts/service-zip/service-zip.spec.js index 214fd96f0..773157980 100644 --- a/src/layouts/service-zip/service-zip.spec.js +++ b/src/layouts/service-zip/service-zip.spec.js @@ -181,6 +181,7 @@ function applyMockStoreDataToGetters() { payment: mockStoreData.payment, policy: mockStoreData.policy, externalParameterServiceZip: mockStoreData.externalParameterServiceZip, + emailOrSms: mockStoreData.customer.emailAddress, }; store.state.order = mockStoreData; store.state.applicationUser.experiments = mockExperimentSettings; @@ -241,7 +242,7 @@ describe("service-zip.vue", () => { // Assert expect(wrapper.vm.serviceZipCode).toEqual("11111"); - expect(wrapper.vm.emailAddress).toEqual("builddigitaltest@safelite.com"); + expect(wrapper.vm.emailOrSms).toEqual("builddigitaltest@safelite.com"); }); test("Zip in querystring -> pushed to data", () => { From 31719e5ef6b678d9a0482a13fac7db94be47f745 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Wed, 5 Feb 2025 09:59:22 -0500 Subject: [PATCH 13/17] CASH-183 | Update the store when exposure is logged This prevents erroneous logs being created in EXPERIMENT_LOG by log-custom-event If the store still showed not exposed after logExposure was called, following log-custom-events still sent the experiment as not exposed --- src/constants/store-actions.js | 2 +- src/layouts/vehicle/vehicle.vue | 2 +- src/store/index.js | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index ec6b0db0c..8c9a28910 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -54,7 +54,7 @@ const storeActions = { GET_RECAL_PARTS_AND_SAVE_TO_LINE_ITEMS: "getRecalPartsAndSaveToLineItems", // Analytics - LOG_EXPERIMENT_EXPOSURE: "logExperimentExposure", + LOG_EXPERIMENT_EXPOSURE_AND_UPDATE_STORE: "logExperimentExposureAndUpdateStore", LOG_PAGE_VIEW: "logPageView", LOG_CUSTOM_EVENT: "logCustomEvent", INITIALIZE_SESSION: "initializeSession", diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index fa7f5c036..d5dc768ce 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -187,7 +187,7 @@ export default { if (experimentForLogging !== undefined) { // Log experiment exposure baseMixin.methods.dispatchStoreActionWithLogging( - storeActions.LOG_EXPERIMENT_EXPOSURE, + storeActions.LOG_EXPERIMENT_EXPOSURE_AND_UPDATE_STORE, { userId: getUserIdValue(), deviceId: getDeviceIdValue(), diff --git a/src/store/index.js b/src/store/index.js index c591d493d..dcd631941 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1262,10 +1262,23 @@ export const actions = { }, // Analytics Actions - logExperimentExposure( + logExperimentExposureAndUpdateStore( context, { payload: { userId, deviceId, sessionKey, pageName, experiment }, pageNameToLog } ) { + const experiments = deepClone(context.getters.applicationUser.experiments); + const experimentToMarkAsExposed = experiments.find(ex => { + ex.universeId == experiment.universeId && + ex.testId == experiment.testIde && + ex.variationId == experiment.variationId && + ex.assignmentId == experiment.assignmentId + }); + if (experimentToMarkAsExposed) { + experimentToMarkAsExposed.isExposed = true; + } + + context.commit(storeMutations.UPDATE_EXPERIMENTS, experiments); + return globalMethods.callHttpClient({ method: endpoints.LogExperimentExposureIfAssigned.method, endpoint: endpoints.LogExperimentExposureIfAssigned.url, From 53d08f0724332d3ef2f67240519adfc740ce2848 Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Wed, 5 Feb 2025 14:28:33 -0500 Subject: [PATCH 14/17] CASH-69: MSR for ITAC. Remove Vehicle MSR Check. --- src/constants/store-mutations.js | 2 - .../service-location/service-location.spec.js | 3 -- .../service-location/service-location.vue | 11 ++---- src/layouts/vehicle/vehicle.vue | 8 ---- src/store/index.js | 37 +++---------------- 5 files changed, 9 insertions(+), 52 deletions(-) diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 1ebf39b8d..0836beb06 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -16,8 +16,6 @@ const storeMutations = { UPDATE_VEHICLE_IMAGE_COLOR: "updateVehicleImageColor", UPDATE_VEHICLE_VIN: "updateVehicleVin", UPDATE_VEHICLE: "updateVehicle", - UPDATE_VEHICLE_MOBILE_STATIC_RECALIBRATION_APPLICABLE: - "updateIsMobileStaticRecalibrationApplicable", UPDATE_IS_REPAIR: "updateIsRepair", UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips", diff --git a/src/layouts/service-location/service-location.spec.js b/src/layouts/service-location/service-location.spec.js index 54f28a89c..68d2e948f 100644 --- a/src/layouts/service-location/service-location.spec.js +++ b/src/layouts/service-location/service-location.spec.js @@ -182,9 +182,6 @@ beforeEach(() => { zipCode: "43235", state: "OH", }, - vehicle: { - isMobileStaticRecalibrationApplicable: true, - }, }, damage: { isRepair: false, diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 9addea705..ef7a5491f 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -191,8 +191,6 @@ export default { isRecalibrationServiceableInshop: null, isGlassServiceableMobile: null, isRecalibrationServiceableMobile: null, - isVehicleMobileStaticRecalibrationApplicable: - this.getIsVehicleMobileStaticRecalibrationApplicableFromStore(), selectedAppointmentType: this.getSelectedAppointmentType(), selectedProvider: this.getSelectedProvider(), mobileFeePart: null, @@ -322,9 +320,8 @@ export default { isMobileStaticRecalibrationApplicable() { return ( this.displayMSR && - this.isVehicleMobileStaticRecalibrationApplicable && this.mobileFeePart?.partNumber == partNumberStrings.MOBILE_STATIC_RECAL_FEE && - (this.isInsurance ? this.mobileFeePart?.isInsurable : true) + (this.isInsurance && !this.isITAC ? this.mobileFeePart?.isInsurable : true) ); }, displayMSR() { @@ -401,6 +398,9 @@ export default { isInsurance() { return store.getters.payment.isInsurance; }, + isITAC() { + return store.getters.order.policy.isItac; + }, }, methods: { arePagePrerequisitesValid() { @@ -509,9 +509,6 @@ export default { getSelectedProvider() { return store.getters.order.serviceLocation.provider; }, - getIsVehicleMobileStaticRecalibrationApplicableFromStore() { - return store.getters.order.vehicle.isMobileStaticRecalibrationApplicable; - }, resetMobileLocation() { this.streetAddress = ""; this.apartmentNumberOrBusinessName = ""; diff --git a/src/layouts/vehicle/vehicle.vue b/src/layouts/vehicle/vehicle.vue index fa7f5c036..728e1dcfd 100644 --- a/src/layouts/vehicle/vehicle.vue +++ b/src/layouts/vehicle/vehicle.vue @@ -121,7 +121,6 @@ export default { modelOptions: [], styleOptions: [], displayNoServiceAlert: false, - isMobileStaticRecalibrationApplicable: this.getIsMobileStaticRecalibrationApplicable(), }; }, @@ -444,8 +443,6 @@ export default { this.imageVifNumber = result?.data.imageVifNumber; this.imageVifColor = result?.data.imageVifColor; this.displayNoServiceAlert = !result?.data.canSafeliteService; - this.isMobileStaticRecalibrationApplicable = - result?.data.isMobileStaticRecalibrationApplicable; }, resetAlert() { this.displayNoServiceAlert = false; @@ -464,8 +461,6 @@ export default { imageUrl: this.imageUrl, imageVifNumber: this.imageVifNumber, imageVifColor: this.imageVifColor, - isMobileStaticRecalibrationApplicable: - this.isMobileStaticRecalibrationApplicable, }, false ); @@ -541,9 +536,6 @@ export default { getImageVifColorfromStore() { return store.getters.vehicle.imageVifColor; }, - getIsMobileStaticRecalibrationApplicable() { - return store.getters.vehicle.isMobileStaticRecalibrationApplicable; - }, }, components: { diff --git a/src/store/index.js b/src/store/index.js index c591d493d..c07fffbd3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -68,7 +68,6 @@ const getDefaultState = () => { registration: { licensePlate: null, }, - isMobileStaticRecalibrationApplicable: false, }, serviceLocation: { address: null, @@ -226,10 +225,6 @@ export const mutations = { updateVehicleVin(state, vin) { state.order.vehicle.vin = vin; }, - updateIsMobileStaticRecalibrationApplicable(state, isMobileStaticRecalibrationApplicable) { - state.order.vehicle.isMobileStaticRecalibrationApplicable = - isMobileStaticRecalibrationApplicable; - }, updateIsRepair(state, isRepair) { state.order.damage.isRepair = isRepair; }, @@ -358,8 +353,6 @@ export const mutations = { state.order.vehicle.imageUrl = vehicleInfo.imageUrl; state.order.vehicle.imageVifNumber = vehicleInfo.imageVifNumber; state.order.vehicle.imageColor = vehicleInfo.imageVifColor; - state.order.vehicle.isMobileStaticRecalibrationApplicable = - vehicleInfo.isMobileStaticRecalibrationApplicable; }, updateRegistration(state, registrationInfo) { state.order.vehicle.registration.licensePlate = registrationInfo?.licensePlate; @@ -552,7 +545,6 @@ export const mutations = { state.order.vehicle.imageUrl = null; state.order.vehicle.imageVifNumber = null; state.order.vehicle.imageColor = null; - state.order.vehicle.isMobileStaticRecalibrationApplicable = false; }, resetDamageState(state) { state.order.damage.isRepair = null; @@ -1656,8 +1648,6 @@ export const actions = { const coverageStatus = coverageStatusEnum(order.payment?.insuranceCoverage?.coverageStatus); const coverageType = coverageTypeEnum(order.payment?.insuranceCoverage?.coverageType); const isItacOptimized = order.policy?.isItac ?? false; - const isMobileStaticRecalibrationApplicable = - order.vehicle?.isMobileStaticRecalibrationApplicable; const zipCode = serviceZipCode ?? order.serviceLocation?.provider?.address?.zipCode ?? @@ -1673,12 +1663,10 @@ export const actions = { var endPoint = `${endpoints.GetMobileFeePart.url}/?serviceType=${serviceType}&facilityType=${facilityType}&parentAccountNumber=${parentAccountNumber}&billToAccountNumber=${billToAccountNumber}&providerNumber=${providerNumber}&isItacOptimized=${isItacOptimized}&zipCode=${zipCode}`; - if (isMobileStaticRecalibrationApplicable) { - const recalPartNumber = getRecalPartNumber(order.lineItems?.glassParts[0]); - const carId = order.vehicle?.carId; - if (recalPartNumber && carId) { - endPoint = `${endPoint}&partNumbers=${recalPartNumber}&carId=${carId}`; - } + const recalPartNumber = getRecalPartNumber(order.lineItems?.glassParts[0]); + const carId = order.vehicle?.carId; + if (recalPartNumber && carId) { + endPoint = `${endPoint}&partNumbers=${recalPartNumber}&carId=${carId}`; } if (coverageStatus) { @@ -2281,18 +2269,7 @@ export const actions = { // Vehicle saveVehicle( context, - { - year, - make, - model, - style, - carId, - category, - imageUrl, - imageVifNumber, - imageVifColor, - isMobileStaticRecalibrationApplicable, - } + { year, make, model, style, carId, category, imageUrl, imageVifNumber, imageVifColor } ) { if ( context.state.order.vehicle.year != year || @@ -2313,10 +2290,6 @@ export const actions = { context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, imageUrl); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, imageVifNumber); context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor); - context.commit( - storeMutations.UPDATE_VEHICLE_MOBILE_STATIC_RECALIBRATION_APPLICABLE, - isMobileStaticRecalibrationApplicable - ); } }, From 9247117e1242848e18c7cd658acb0c7f4c3965e8 Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Thu, 6 Feb 2025 13:01:54 -0500 Subject: [PATCH 15/17] CASH-176 CASH-176 Added email or sms to vin-lookup, address-lookup, and license plate-lookup --- src/layouts/address-lookup/address-lookup.vue | 23 +++++--- .../customer-questions/customer-questions.vue | 16 +++--- .../license-plate-lookup.vue | 37 +++++++++---- src/layouts/vin-lookup/vin-lookup.vue | 53 ++++++++++++++----- src/store/index.js | 3 +- 5 files changed, 94 insertions(+), 38 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 55d8a0499..8789f0839 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -18,7 +18,7 @@ @@ -59,12 +59,12 @@ import textBlock from "@/digital-components/text-block/text-block"; // DEFINE VALIDATION RULES defineRule("first-name-required", required(errorMessages.FIRST_NAME_REQUIRED)); defineRule("last-name-required", required(errorMessages.LAST_NAME_REQUIRED)); -defineRule("email-address-required", required(errorMessages.EMAIL_ADDRESS_REQUIRED)); +defineRule("email-sms-required", required(errorMessages.EMAIL_SMS_REQUIRED)); defineRule( - "email-address-format", + "email-sms-format", regex( - /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, - errorMessages.EMAIL_ADDRESS_FORMAT + /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$|^\(?(\d{3})\)?[-. ]?(\d{3})[-. ]?(\d{4})$/, + errorMessages.EMAIL_SMS_FORMAT ) ); @@ -84,7 +84,7 @@ export default { }, firstName: "", lastName: "", - emailAddress: "", + emailOrSms: "", }, }), }, diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index b374e8bb6..e1b3f721e 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -28,10 +28,10 @@ @@ -110,17 +110,18 @@ import { Form, defineRule } from "vee-validate"; import baseMixin from "@/mixins/base-mixin.js"; import store from "@/store"; import vinPagesMixin from "@/mixins/vin-pages-mixin"; +import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; // DEFINE VALIDATION RULES defineRule("license-plate-required", required(errorMessages.LICENSE_PLATE_REQUIRED)); defineRule("registration-zip-required", required(errorMessages.REGISTRATION_ZIP_REQUIRED)); defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT)); -defineRule("email-address-required", required(errorMessages.EMAIL_ADDRESS_REQUIRED)); +defineRule("email-sms-required", required(errorMessages.EMAIL_SMS_REQUIRED)); defineRule( - "email-address-format", + "email-sms-format", regex( - /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, - errorMessages.EMAIL_ADDRESS_FORMAT + /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$|^\(?(\d{3})\)?[-. ]?(\d{3})[-. ]?(\d{4})$/, + errorMessages.EMAIL_SMS_FORMAT ) ); @@ -155,7 +156,7 @@ export default { return { licensePlate: this.getLicensePlateFromStore(), registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipcode, - email: this.getEmailFromStore(), + emailOrSms: this.getEmailOrSmsFromStore(), serviceZipCode: this.getServiceZipFromStore(), displayNonServiceableZipAlert: false, displayVinNotFoundAlert: false, @@ -193,8 +194,8 @@ export default { getRegistrationZipFromStore() { return this.$store.getters.vehicle.registration.zipCode; }, - getEmailFromStore() { - return this.$store.getters.order.customer.emailAddress; + getEmailOrSmsFromStore() { + return this.$store.getters.emailOrSms; }, getServiceZipFromStore() { return this.$store.getters.order.serviceLocation.zipCode; @@ -310,7 +311,21 @@ export default { false ); - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.email, 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); + } + + await this.dispatchStoreAction( + storeActions.SAVE_PAGE_DATA, + { + page: fmgPageValues.EMAIL_SMS_PAGES, + data: { emailOrSmsValue: this.emailOrSms }, + }, + false + ); await this.dispatchStoreAction( storeActions.SAVE_SERVICE_ZIP_CODE_INFO, diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index eb184bd69..82c54d43a 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -46,10 +46,10 @@ @@ -151,16 +151,17 @@ import { routerParams } from "@/router/router-constants/router-params"; import baseMixin from "@/mixins/base-mixin.js"; import store from "@/store"; import vinPagesMixin from "@/mixins/vin-pages-mixin"; +import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; // DEFINE VALIDATION RULES defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); defineRule("zip-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.SERVICE_ZIP_FORMAT)); -defineRule("email-address-required", required(errorMessages.EMAIL_ADDRESS_REQUIRED)); +defineRule("email-sms-required", required(errorMessages.EMAIL_SMS_REQUIRED)); defineRule( - "email-address-format", + "email-sms-format", regex( - /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$/, - errorMessages.EMAIL_ADDRESS_FORMAT + /^([a-zA-Z0-9_\-.+]+)@([a-zA-Z0-9-]+)\.([a-zA-Z]{2,})$|^\(?(\d{3})\)?[-. ]?(\d{3})[-. ]?(\d{4})$/, + errorMessages.EMAIL_SMS_FORMAT ) ); defineRule("vin-required", required(errorMessages.VIN_REQUIRED)); @@ -195,7 +196,7 @@ export default { return { vin: this.getVinFromStore(), serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, - emailAddress: this.getEmailFromStore(), + emailOrSms: this.getEmailOrSmsFromStore(), isCarIdDifferent: false, customAlertData: {}, previouslyEnteredCarId: "", @@ -212,8 +213,8 @@ export default { arePagePrerequisitesValid() { return store.getters.vehicle.carId !== null; }, - getEmailFromStore() { - return this.$store.getters.order.customer.emailAddress; + getEmailOrSmsFromStore() { + return this.$store.getters.emailOrSms; }, getVinFromStore() { return this.$store.getters.vehicle.vin; @@ -329,7 +330,21 @@ export default { false ); - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, 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); + } + + await this.dispatchStoreAction( + storeActions.SAVE_PAGE_DATA, + { + page: fmgPageValues.EMAIL_SMS_PAGES, + data: { emailOrSmsValue: this.emailOrSms }, + }, + false + ); await this.dispatchStoreAction( storeActions.SAVE_SERVICE_ZIP_CODE_INFO, { @@ -365,7 +380,21 @@ export default { ); } - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, 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); + } + + await this.dispatchStoreAction( + storeActions.SAVE_PAGE_DATA, + { + page: fmgPageValues.EMAIL_SMS_PAGES, + data: { emailOrSmsValue: this.emailOrSms }, + }, + false + ); return await this.navigateForward(); } diff --git a/src/store/index.js b/src/store/index.js index 1feb02a2f..e1c726892 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1004,7 +1004,8 @@ export const getters = { isExternalParameter: (state) => externalParameterState?.isExternalParameter, emailOrSms: (state) => { - const email = externalParameterState.serviceZip.emailAddress ?? state.order.customer.emailAddress; + const email = + externalParameterState.serviceZip.emailAddress ?? state.order.customer.emailAddress; const phone = state.order.customer.phoneNumber; if (!phone && !email) { From 759e1eef57efd731278fcff740274985c0d19787 Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Thu, 6 Feb 2025 15:25:21 -0500 Subject: [PATCH 16/17] CASH-176 CASH-176 Fixed unit test for license-plate-spec --- .../license-plate-lookup/license-plate-lookup.spec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js index 93aee887a..9dfbc4ed1 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js +++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js @@ -68,7 +68,7 @@ describe("license-plate-lookup.vue", () => { const { wrapper } = setupMocks({ emailAddress: mockEmail }); // ACT - const customerEmail = wrapper.vm.getEmailFromStore(); + const customerEmail = wrapper.vm.getEmailOrSmsFromStore(); // Assert expect(customerEmail).toEqual(mockEmail); @@ -625,6 +625,8 @@ function setupMocks({ licensePlate = null, //"TESTPLATE", emailAddress = null, //"test@test.com" }) { + console.log("======================================================================================================" + emailAddress); + console.log("serviceLocationZipCode" + serviceLocationZipCode); store.commit(storeMutations.RESET_STATE); //Mock api responses const apiResponses = { @@ -665,6 +667,7 @@ function setupMocks({ }, store: { getters: { + emailOrSms: emailAddress, vehicle: { registration: { licensePlate: licensePlate, From f9b043ca66d766c50c35a0c105692c24495df9b8 Mon Sep 17 00:00:00 2001 From: Johnny shultz Date: Thu, 6 Feb 2025 16:48:43 -0500 Subject: [PATCH 17/17] CASH-176 CASH-176 Removed console.logs from license-plate-lookup.spec.js --- .../save-progress-modal-question.vue | 4 ++-- src/layouts/address-lookup/address-lookup.vue | 6 +++++- .../license-plate-lookup/license-plate-lookup.spec.js | 2 -- src/store/index.js | 10 +++++----- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue index 27ca1f479..c6e31b781 100644 --- a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue +++ b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue @@ -158,8 +158,8 @@ export default { box-shadow: none; } &:focus-visible span { - outline: 2px solid #005FCC; - border-radius: .25rem; + outline: 2px solid #005fcc; + border-radius: 0.25rem; } &.delay { // fixes flicker while transitioning between states diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 8789f0839..e069ee48d 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -361,7 +361,11 @@ export default { 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( + storeActions.SAVE_EMAIL, + this.customerQuestions.emailOrSms, + false + ); } await this.dispatchStoreAction( diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js index 9dfbc4ed1..2d4b729d8 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js +++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js @@ -625,8 +625,6 @@ function setupMocks({ licensePlate = null, //"TESTPLATE", emailAddress = null, //"test@test.com" }) { - console.log("======================================================================================================" + emailAddress); - console.log("serviceLocationZipCode" + serviceLocationZipCode); store.commit(storeMutations.RESET_STATE); //Mock api responses const apiResponses = { diff --git a/src/store/index.js b/src/store/index.js index ae85d311e..8e156871f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1293,16 +1293,16 @@ export const actions = { { payload: { userId, deviceId, sessionKey, pageName, experiment }, pageNameToLog } ) { const experiments = deepClone(context.getters.applicationUser.experiments); - const experimentToMarkAsExposed = experiments.find(ex => { + const experimentToMarkAsExposed = experiments.find((ex) => { ex.universeId == experiment.universeId && - ex.testId == experiment.testIde && - ex.variationId == experiment.variationId && - ex.assignmentId == experiment.assignmentId + ex.testId == experiment.testIde && + ex.variationId == experiment.variationId && + ex.assignmentId == experiment.assignmentId; }); if (experimentToMarkAsExposed) { experimentToMarkAsExposed.isExposed = true; } - + context.commit(storeMutations.UPDATE_EXPERIMENTS, experiments); return globalMethods.callHttpClient({