merge 12.08 to develop
This commit is contained in:
parent
9bf2733a81
commit
7e5a0fed3e
9 changed files with 157 additions and 128 deletions
|
|
@ -36,14 +36,33 @@
|
|||
</button>
|
||||
</div>
|
||||
<div class="modal-body d-flex flex-column">
|
||||
<textLink linkType="navigation" text="Terms of use" href="//www.safelite.com/terms-of-use" target="_blank" />
|
||||
<textLink linkType="navigation" text="Your privacy choices" href="//www.safelite.com/privacy-center" target="_blank">
|
||||
<template v-slot:after-text>
|
||||
<img class="ccpa-icon" src="~@/assets/img/icons/ccpa-icon.svg" alt="Your privacy choices"/>
|
||||
</template>
|
||||
</textLink>
|
||||
<textLink linkType="navigation" text="Warranty" href="//www.safelite.com/national-lifetime-warranty" target="_blank" />
|
||||
<textLink linkType="navigation" text="Notice at collection" href="https://privacyportal-cdn.onetrust.com/dsarwebform/d3b95a93-e22e-4d4d-a806-482052406557/9e371601-eae3-4338-9430-b90b9036022b.html" target="_blank" />
|
||||
<textLink
|
||||
linkType="navigation"
|
||||
text="Terms of use"
|
||||
href="//www.safelite.com/terms-of-use"
|
||||
target="_blank" />
|
||||
<textLink
|
||||
linkType="navigation"
|
||||
text="Your privacy choices"
|
||||
href="//www.safelite.com/privacy-center"
|
||||
target="_blank">
|
||||
<template v-slot:after-text>
|
||||
<img
|
||||
class="ccpa-icon"
|
||||
src="~@/assets/img/icons/ccpa-icon.svg"
|
||||
alt="Your privacy choices" />
|
||||
</template>
|
||||
</textLink>
|
||||
<textLink
|
||||
linkType="navigation"
|
||||
text="Warranty"
|
||||
href="//www.safelite.com/national-lifetime-warranty"
|
||||
target="_blank" />
|
||||
<textLink
|
||||
linkType="navigation"
|
||||
text="Notice at collection"
|
||||
href="https://privacyportal-cdn.onetrust.com/dsarwebform/d3b95a93-e22e-4d4d-a806-482052406557/9e371601-eae3-4338-9430-b90b9036022b.html"
|
||||
target="_blank" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -4,15 +4,15 @@ const storeActions = {
|
|||
GET_HOMEPAGE_NAME: "getHomepageName",
|
||||
GET_PAGE_DATA: "getPageData",
|
||||
|
||||
// Vehicle Actions
|
||||
GET_VEHICLE_YEARS: "getVehicleYears",
|
||||
GET_VEHICLE_MAKES: "getVehicleMakes",
|
||||
GET_VEHICLE_MODELS: "getVehicleModels",
|
||||
GET_VEHICLE_STYLES: "getVehicleStyles",
|
||||
SET_VEHICLE: "setVehicle",
|
||||
GET_DAMAGE_OPTIONS: "getDamageOptions",
|
||||
GET_EVOX_IMAGE: "getEvoxImage",
|
||||
IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle",
|
||||
// Vehicle Actions
|
||||
GET_VEHICLE_YEARS: "getVehicleYears",
|
||||
GET_VEHICLE_MAKES: "getVehicleMakes",
|
||||
GET_VEHICLE_MODELS: "getVehicleModels",
|
||||
GET_VEHICLE_STYLES: "getVehicleStyles",
|
||||
SET_VEHICLE: "setVehicle",
|
||||
GET_DAMAGE_OPTIONS: "getDamageOptions",
|
||||
GET_EVOX_IMAGE: "getEvoxImage",
|
||||
IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle",
|
||||
|
||||
// Lookup Actions
|
||||
LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms",
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ async function getLatestPageForRedirection() {
|
|||
|
||||
const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE);
|
||||
const promiseResultMap = [
|
||||
{
|
||||
resultKey: "vinOptionalOptions",
|
||||
promise: vinOptionalVehiclePromise,
|
||||
},
|
||||
{
|
||||
resultKey: "vinOptionalOptions",
|
||||
promise: vinOptionalVehiclePromise,
|
||||
},
|
||||
];
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
||||
|
|
@ -104,8 +104,11 @@ async function getLatestPageForRedirection() {
|
|||
return fmgPageValues.VEHICLE_PARTS;
|
||||
} else if (partQuestionsComponent.methods.arePagePrerequisitesValid()) {
|
||||
return fmgPageValues.PART_QUESTIONS;
|
||||
}
|
||||
else if (vinLookupComponent.methods.arePagePrerequisitesValid() && !store.getters.damage.isRepair && !isVinOptionalVehicle) {
|
||||
} else if (
|
||||
vinLookupComponent.methods.arePagePrerequisitesValid() &&
|
||||
!store.getters.damage.isRepair &&
|
||||
!isVinOptionalVehicle
|
||||
) {
|
||||
return fmgPageValues.VIN_LOOKUP;
|
||||
} else {
|
||||
return fmgPageValues.ESTIMATE;
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -47,8 +47,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -69,8 +69,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -92,8 +92,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -116,8 +116,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -141,8 +141,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -171,8 +171,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -201,8 +201,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -231,8 +231,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -261,8 +261,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -291,8 +291,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
query: {},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Mock out the lazy load calls for all components.
|
||||
mockLazyLoadComponentReturnValues({
|
||||
|
|
@ -323,8 +323,8 @@ describe("getPageToRouteExistingOrderTo", () => {
|
|||
},
|
||||
};
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
// Act
|
||||
const result = await getPageToRouteExistingOrderTo(toRoute, true);
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ describe("estimate.vue", () => {
|
|||
selectedVinLookupMethod: vinLookupMethodSelections.MANUALVIN,
|
||||
});
|
||||
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
|
||||
store.commit( storeMutations.UPDATE_MAKE, "acura" );
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, false);
|
||||
store.commit(storeMutations.UPDATE_MAKE, "acura");
|
||||
|
||||
//Act
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
|
@ -220,16 +220,21 @@ describe("estimate.vue", () => {
|
|||
});
|
||||
|
||||
describe("skipVinLookup", () => {
|
||||
const skipOptions = [[true, true, true],
|
||||
[true, false, true],
|
||||
[false, true, true],
|
||||
[false, false, false]];
|
||||
test.each(skipOptions)("isRepair %s and isVinOptional %s should return %s", async (isRepair, isVinOptionalVehicle, expectedVinSkip) => {
|
||||
const { wrapper } = setupMocks({ isVinOptionalVehicle: isVinOptionalVehicle});
|
||||
store.commit( storeMutations.UPDATE_IS_REPAIR, isRepair);
|
||||
const skipOptions = [
|
||||
[true, true, true],
|
||||
[true, false, true],
|
||||
[false, true, true],
|
||||
[false, false, false],
|
||||
];
|
||||
test.each(skipOptions)(
|
||||
"isRepair %s and isVinOptional %s should return %s",
|
||||
async (isRepair, isVinOptionalVehicle, expectedVinSkip) => {
|
||||
const { wrapper } = setupMocks({ isVinOptionalVehicle: isVinOptionalVehicle });
|
||||
store.commit(storeMutations.UPDATE_IS_REPAIR, isRepair);
|
||||
|
||||
expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip);
|
||||
});
|
||||
expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
function setupMocks({
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ export default {
|
|||
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
if (this.skipVinLookup){
|
||||
if (this.skipVinLookup) {
|
||||
const zipCodeData = await this.getZipCodeData(this.serviceZipCode);
|
||||
//todo: validation
|
||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false);
|
||||
|
|
|
|||
|
|
@ -1316,26 +1316,6 @@ export const actions = {
|
|||
!sortedPreviousResultsArray?.every(
|
||||
(x, i) => x.partNum === sortedMoldingQuestionAnswersArray[i].partNum
|
||||
);
|
||||
|
||||
isVinOptionalVehicle(context){
|
||||
switch((context.state.order.vehicle.make).toLowerCase()) {
|
||||
case "mercedes benz":
|
||||
case "volkswagen":
|
||||
case "audi":
|
||||
case "porsche":
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
|
||||
if ((context.state.order.vehicle.make).toLowerCase() === "ford" && context.state.order.vehicle.year >= 2018)
|
||||
return true;
|
||||
|
||||
if ((context.state.order.vehicle.make).toLowerCase() === "bmw" && context.state.order.vehicle.year <= 2017)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (haveMoldingQuestionAnswersChanged) {
|
||||
context.commit(storeMutations.UPDATE_GLASS_PARTS, null);
|
||||
|
|
@ -1407,6 +1387,31 @@ export const actions = {
|
|||
clearVin(context) {
|
||||
context.commit(storeMutations.UPDATE_VEHICLE_VIN, null);
|
||||
},
|
||||
|
||||
isVinOptionalVehicle(context) {
|
||||
switch (context.state.order.vehicle.make.toLowerCase()) {
|
||||
case "mercedes benz":
|
||||
case "volkswagen":
|
||||
case "audi":
|
||||
case "porsche":
|
||||
return true;
|
||||
default:
|
||||
}
|
||||
|
||||
if (
|
||||
context.state.order.vehicle.make.toLowerCase() === "ford" &&
|
||||
context.state.order.vehicle.year >= 2018
|
||||
)
|
||||
return true;
|
||||
|
||||
if (
|
||||
context.state.order.vehicle.make.toLowerCase() === "bmw" &&
|
||||
context.state.order.vehicle.year <= 2017
|
||||
)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
},
|
||||
};
|
||||
|
||||
export default createStore({
|
||||
|
|
|
|||
|
|
@ -2713,26 +2713,31 @@ describe("Getters", () => {
|
|||
});
|
||||
|
||||
describe("isVinOptionalVehicle", () => {
|
||||
const testVehicles = [["2017", "acura", false],
|
||||
["2017", "ford", false],
|
||||
["2018", "ford", true],
|
||||
["2018", "bmw", false],
|
||||
["2017", "bmw", true],
|
||||
["2016", "bmw", true],
|
||||
["2016", "mercedes benz", true],
|
||||
["2016", "volkswagen", true],
|
||||
["2016", "audi", true],
|
||||
["2016", "porsche", true]];
|
||||
test.each(testVehicles)("%s %s should skip vin lookup is %s", async (year, make, expectedVinSkip) => {
|
||||
const context = state;
|
||||
const testVehicles = [
|
||||
["2017", "acura", false],
|
||||
["2017", "ford", false],
|
||||
["2018", "ford", true],
|
||||
["2018", "bmw", false],
|
||||
["2017", "bmw", true],
|
||||
["2016", "bmw", true],
|
||||
["2016", "mercedes benz", true],
|
||||
["2016", "volkswagen", true],
|
||||
["2016", "audi", true],
|
||||
["2016", "porsche", true],
|
||||
];
|
||||
test.each(testVehicles)(
|
||||
"%s %s should skip vin lookup is %s",
|
||||
async (year, make, expectedVinSkip) => {
|
||||
const context = state;
|
||||
|
||||
context.state = {
|
||||
order: {
|
||||
vehicle: { year: year, make: make}
|
||||
}
|
||||
};
|
||||
context.state = {
|
||||
order: {
|
||||
vehicle: { year: year, make: make },
|
||||
},
|
||||
};
|
||||
|
||||
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
||||
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
||||
});
|
||||
});
|
||||
var vinOptionalResult = actions.isVinOptionalVehicle(context);
|
||||
expect(vinOptionalResult).toEqual(expectedVinSkip);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,8 +1,21 @@
|
|||
<template>
|
||||
<a v-if="linkType === 'navigation'" @click="handleClick" class="navigation-link" :href="href">{{text}}<slot name="after-text"></slot></a>
|
||||
<a v-else-if="linkType === 'footer'" @click="handleClick" class="footer-link" :href="href" target="_blank">{{text}}<slot name="after-text"></slot></a>
|
||||
<a v-else-if="linkType === 'textSmall'" @click="handleClick" class="small" :href="href">{{text}}<slot name="after-text"></slot></a>
|
||||
<a v-else-if="linkType === 'text'" @click="handleClick" :href="href">{{text}}<slot name="after-text"></slot></a>
|
||||
<a v-if="linkType === 'navigation'" @click="handleClick" class="navigation-link" :href="href"
|
||||
>{{ text }}<slot name="after-text"></slot
|
||||
></a>
|
||||
<a
|
||||
v-else-if="linkType === 'footer'"
|
||||
@click="handleClick"
|
||||
class="footer-link"
|
||||
:href="href"
|
||||
target="_blank"
|
||||
>{{ text }}<slot name="after-text"></slot
|
||||
></a>
|
||||
<a v-else-if="linkType === 'textSmall'" @click="handleClick" class="small" :href="href"
|
||||
>{{ text }}<slot name="after-text"></slot
|
||||
></a>
|
||||
<a v-else-if="linkType === 'text'" @click="handleClick" :href="href"
|
||||
>{{ text }}<slot name="after-text"></slot
|
||||
></a>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -61,30 +74,9 @@ a {
|
|||
font-weight: 400;
|
||||
font-size: 0.75rem;
|
||||
&:hover {
|
||||
color: $blue-700;
|
||||
}
|
||||
&.small {
|
||||
line-height: 24px;
|
||||
&:hover {
|
||||
color: $blue-700;
|
||||
}
|
||||
}
|
||||
&.navigation-link {
|
||||
color: $black;
|
||||
line-height: 26px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
&.footer-link {
|
||||
color: $gray-600;
|
||||
text-decoration: none;
|
||||
line-height: 20px;
|
||||
padding: 0 0 2px 0;
|
||||
font-weight: 400;
|
||||
font-size: 0.75rem;
|
||||
&:hover {
|
||||
padding: 0 0 2px 0;
|
||||
text-decoration: underline;
|
||||
}
|
||||
padding: 0 0 2px 0;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue