Merge branch 'release/2023.05.04' into rlsmerge/2023.04.05-to-develop-04.25
This commit is contained in:
commit
0a6593c597
9 changed files with 107 additions and 33 deletions
|
|
@ -19,6 +19,7 @@ const GaActions = {
|
|||
CLICKED: "Clicked",
|
||||
VIF: "vif",
|
||||
SUBMITTED: "Submitted",
|
||||
DISPLAYED: "Displayed",
|
||||
};
|
||||
|
||||
const GaLabels = {
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ import listButtonHorizontal from "@/ux-components/list-button-horizontal/list-bu
|
|||
import listCard from "@/ux-components/list-card/list-card";
|
||||
import radio from "@/ux-components/radio/radio";
|
||||
import { useField, ErrorMessage } from "vee-validate";
|
||||
import { queryStrings } from "@/constants/query-strings";
|
||||
|
||||
export default {
|
||||
name: "buttonQuestion",
|
||||
|
|
@ -129,6 +130,10 @@ export default {
|
|||
additionalButtonStyling: String,
|
||||
isSmallQuestionText: Boolean,
|
||||
customButtonQuestionId: String,
|
||||
logDisplayedValuesEvent: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const propsClone = Object.assign({}, props);
|
||||
|
|
@ -161,7 +166,7 @@ export default {
|
|||
return {
|
||||
lastValuePushedToGa: null,
|
||||
};
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
getFieldSetClasses() {
|
||||
const baseClasses = this.isOverflowScrollable
|
||||
|
|
@ -253,7 +258,25 @@ export default {
|
|||
modelValue() {
|
||||
this.resetField();
|
||||
},
|
||||
},
|
||||
answers() {
|
||||
//once we get the answers to display from parent, see if we need a GA event to log what we showed
|
||||
if (this.logDisplayedValuesEvent && this.answers.length > 0) {
|
||||
var eventLabel = "";
|
||||
//build comma separated list of all items in button list that we are going to display on page
|
||||
this.answers.forEach((item) => {
|
||||
eventLabel += item.Name + ",";
|
||||
});
|
||||
|
||||
eventLabel = eventLabel.slice(0, -1); //remove the last comma
|
||||
this.pushEventToGA(
|
||||
this.$route.query[queryStrings.FMG_PAGE],
|
||||
this.GaActions.DISPLAYED,
|
||||
eventLabel,
|
||||
true
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
components: {
|
||||
listButton,
|
||||
listButtonHorizontal,
|
||||
|
|
@ -289,7 +312,7 @@ export default {
|
|||
margin-bottom: 1rem;
|
||||
font-size: 1rem;
|
||||
line-height: 1.625rem;
|
||||
|
||||
|
||||
& > span {
|
||||
text-align: center;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import store from "@/store";
|
||||
import baseMixin from "@/mixins/base-mixin.js";
|
||||
import { storeActions } from "@/constants/store-actions";
|
||||
import { damageLocationsSelected as glassLocations } from "@/constants/damage-locations-selected";
|
||||
|
||||
export function getDamageString() {
|
||||
// If it's a repair it's always a windshield.
|
||||
|
|
@ -45,6 +46,14 @@ export function getIsWindshieldOnly() {
|
|||
return returnString;
|
||||
}
|
||||
|
||||
export function includesWindshieldReplacement() {
|
||||
const windshieldMatches =
|
||||
store.getters.order.damage.glassToReplace?.filter(
|
||||
(glassToReplace) => glassToReplace.glassLocation === glassLocations.WINDSHIELD
|
||||
) ?? [];
|
||||
return windshieldMatches.length > 0;
|
||||
}
|
||||
|
||||
export async function isGlassAvailableForCarId(carId) {
|
||||
const newGlassOptions = await baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.GET_DAMAGE_OPTIONS,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { storeActions } from "@/constants/store-actions.js";
|
|||
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||
import experimentMixin from "@/mixins/experiment-mixin";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
import { includesWindshieldReplacement } from "@/helpers/damage-helper";
|
||||
import store from "@/store";
|
||||
import router from "@/router";
|
||||
|
||||
|
|
@ -73,6 +74,7 @@ export async function skipVinLookup() {
|
|||
return (
|
||||
store.getters.damage.isRepair ||
|
||||
isVinOptionalVehicle ||
|
||||
!includesWindshieldReplacement() ||
|
||||
experimentMixin.methods.hasSettingEqualTo(experimentSettings.SUPPRESS_VIN_CAPTURE, "true")
|
||||
);
|
||||
}
|
||||
|
|
@ -85,6 +87,7 @@ export async function skipVinLookupNotRepair() {
|
|||
return (
|
||||
!store.getters.damage.isRepair &&
|
||||
(isVinOptionalVehicle ||
|
||||
!includesWindshieldReplacement() ||
|
||||
experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.SUPPRESS_VIN_CAPTURE,
|
||||
"true"
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
expect(result).toBe(fmgPageValues.VEHICLE_DAMAGE);
|
||||
});
|
||||
|
||||
test("user has YMMS and no vehicle questions > should return vin-lookup", async () => {
|
||||
test("user has YMMS and no vehicle questions > should return estimate", async () => {
|
||||
// Arrange
|
||||
const toRoute = {
|
||||
query: {},
|
||||
|
|
@ -172,7 +172,7 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
const result = await getPageToRouteExistingOrderTo(toRoute, false);
|
||||
|
||||
//Assert
|
||||
expect(result).toBe(fmgPageValues.VIN_LOOKUP);
|
||||
expect(result).toBe(fmgPageValues.ESTIMATE);
|
||||
});
|
||||
|
||||
test("user has YMMS but no questions or carId > should return estimate", async () => {
|
||||
|
|
|
|||
|
|
@ -101,6 +101,9 @@ describe("estimate.vue", () => {
|
|||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
delete window.location;
|
||||
window.location = { search: "?fmgPage=estimate&zipcode=43015" };
|
||||
|
||||
//Act
|
||||
estimate.beforeRouteEnter.call(
|
||||
wrapper.vm,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@
|
|||
buttonTypeString="listButton"
|
||||
v-model="selectedVinLookupMethod"
|
||||
isRequired
|
||||
validationRules="option-required" />
|
||||
validationRules="option-required"
|
||||
:logDisplayedValuesEvent="true" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<alert
|
||||
|
|
@ -147,11 +148,17 @@ export default {
|
|||
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
const hasZip = urlParams.has(queryStrings.ZIP_CODE);
|
||||
const zip = urlParams.get(queryStrings.ZIP_CODE);
|
||||
const lowerCaseParams = new URLSearchParams();
|
||||
for (const [name, value] of urlParams) {
|
||||
lowerCaseParams.append(name.toLowerCase(), value);
|
||||
}
|
||||
|
||||
const zip = lowerCaseParams.get(queryStrings.ZIP_CODE)
|
||||
? lowerCaseParams.get(queryStrings.ZIP_CODE)
|
||||
: store.getters.order.serviceLocation.zipCode;
|
||||
|
||||
var vinByAddressPromise;
|
||||
if (hasZip) {
|
||||
if (zip) {
|
||||
vinByAddressPromise = baseMixin.methods.dispatchStoreAction(
|
||||
storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE,
|
||||
zip,
|
||||
|
|
@ -191,7 +198,7 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
if (zip && resultMap.vinByAddress === false) {
|
||||
if (!zip || resultMap.vinByAddress === false) {
|
||||
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||
(answer) => answer.Name === "HomeAddress"
|
||||
);
|
||||
|
|
@ -199,6 +206,7 @@ export default {
|
|||
resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1);
|
||||
}
|
||||
}
|
||||
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -146,18 +146,18 @@ export default {
|
|||
false
|
||||
);
|
||||
|
||||
if (response.data) {
|
||||
if (response.data.sessionKey && skey === 0) {
|
||||
if (response?.data) {
|
||||
if (response?.data.sessionKey && skey === 0) {
|
||||
setCookieProperties(
|
||||
{ [cookieNames.SESSION_KEY]: response.data.sessionKey },
|
||||
{ [cookieNames.SESSION_KEY]: response?.data.sessionKey },
|
||||
{
|
||||
useDefaultFunnelCookieAttributes: false,
|
||||
}
|
||||
);
|
||||
}
|
||||
if (response.data.sessionId && sid === "00000000-0000-0000-0000-000000000000") {
|
||||
if (response?.data.sessionId && sid === "00000000-0000-0000-0000-000000000000") {
|
||||
setCookieProperties(
|
||||
{ [cookieNames.SESSION_ID]: response.data.sessionId },
|
||||
{ [cookieNames.SESSION_ID]: response?.data.sessionId },
|
||||
{
|
||||
maxAge: 60 * 30, // 30 minutes
|
||||
}
|
||||
|
|
|
|||
|
|
@ -727,12 +727,21 @@ export const actions = {
|
|||
experimentsForUser: experimentsForUser,
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogPageView.method,
|
||||
endpoint: endpoints.LogPageView.url,
|
||||
payload: payload,
|
||||
logApiCall: false,
|
||||
});
|
||||
return globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.LogPageView.method,
|
||||
endpoint: endpoints.LogPageView.url,
|
||||
payload: payload,
|
||||
logApiCall: false,
|
||||
})
|
||||
.then(
|
||||
(response) => {
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
console.log("Analytics Service Error: " + error.data);
|
||||
}
|
||||
);
|
||||
},
|
||||
logCustomEvent(
|
||||
context,
|
||||
|
|
@ -763,12 +772,21 @@ export const actions = {
|
|||
experimentsForUser: experimentsForUser,
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogCustomEvent.method,
|
||||
endpoint: endpoints.LogCustomEvent.url,
|
||||
payload: payload,
|
||||
logApiCall: false,
|
||||
});
|
||||
return globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.LogCustomEvent.method,
|
||||
endpoint: endpoints.LogCustomEvent.url,
|
||||
payload: payload,
|
||||
logApiCall: false,
|
||||
})
|
||||
.then(
|
||||
(response) => {
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
console.log("Analytics Service Error: " + error.data);
|
||||
}
|
||||
);
|
||||
},
|
||||
initializeSession(context, { userId, sessionId, userAgent, referrer }) {
|
||||
var payload = {
|
||||
|
|
@ -782,12 +800,21 @@ export const actions = {
|
|||
referrer: referrer,
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.InitializeSession.method,
|
||||
endpoint: endpoints.InitializeSession.url,
|
||||
payload: payload,
|
||||
logApiCall: false,
|
||||
});
|
||||
return globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.InitializeSession.method,
|
||||
endpoint: endpoints.InitializeSession.url,
|
||||
payload: payload,
|
||||
logApiCall: false,
|
||||
})
|
||||
.then(
|
||||
(response) => {
|
||||
return response;
|
||||
},
|
||||
(error) => {
|
||||
console.log("Analytics Service Error: " + error.data);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
// Misc Actions
|
||||
|
|
|
|||
Loading…
Reference in a new issue