diff --git a/src/assets/img/icons/ccpa-icon.svg b/src/assets/img/icons/ccpa-icon.svg new file mode 100644 index 000000000..30eb3e086 --- /dev/null +++ b/src/assets/img/icons/ccpa-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/common-components/funnel-header/menu-modal/menu-modal.vue b/src/common-components/funnel-header/menu-modal/menu-modal.vue index 55ed98dd9..fd0c96cb8 100644 --- a/src/common-components/funnel-header/menu-modal/menu-modal.vue +++ b/src/common-components/funnel-header/menu-modal/menu-modal.vue @@ -44,16 +44,28 @@ + + + @@ -147,6 +159,11 @@ export default { overflow-y: visible; .modal-body { padding: 2rem; + .ccpa-icon { + width: 2.0625rem; + height: 1rem; + margin-left: 0.5rem; + } } .modal-fullscreen { width: 100vw; diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 1d8540075..1fd8c3256 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -203,6 +203,7 @@ export default { border: 1px solid $gray-500; border-radius: 0.5rem; min-height: 3rem; + max-height: 48px; padding: 12px 16px; &::placeholder { color: $gray-500; diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index be1bb3d1b..0dcaf6d3f 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -12,6 +12,7 @@ const storeActions = { SET_VEHICLE: "setVehicle", GET_DAMAGE_OPTIONS: "getDamageOptions", GET_EVOX_IMAGE: "getEvoxImage", + IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle", // Lookup Actions LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms", diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index e51331779..5d02f5dc6 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -3,6 +3,8 @@ import { externalUrls } from "@/router/router-constants/externalUrl-values"; import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"; import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; import { fmgPageValues } from "@/router/router-constants/fmgPage-values"; +import { storeActions } from "@/constants/store-actions.js"; +import { settleAllPromises } from "@/helpers/layout-helper"; import store from "@/store"; import router from "@/router"; @@ -72,6 +74,17 @@ async function getLatestPageForRedirection() { fmgPageValues.CAPABILITY_QUESTIONS ); + const vinOptionalVehiclePromise = store.dispatch(storeActions.IS_VIN_OPTIONAL_VEHICLE); + const promiseResultMap = [ + { + resultKey: "vinOptionalOptions", + promise: vinOptionalVehiclePromise, + }, + ]; + const resultMap = await settleAllPromises(promiseResultMap); + + var isVinOptionalVehicle = resultMap.vinOptionalOptions; + if (!vehicleMakeComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.VEHICLE_YEAR; } else if (!vehicleModelComponent.methods.arePagePrerequisitesValid()) { @@ -93,7 +106,8 @@ async function getLatestPageForRedirection() { return fmgPageValues.PART_QUESTIONS; } else if ( vinLookupComponent.methods.arePagePrerequisitesValid() && - !store.getters.damage.isRepair + !store.getters.damage.isRepair && + !isVinOptionalVehicle ) { return fmgPageValues.VIN_LOOKUP; } else { diff --git a/src/helpers/heritage-integration/navigation-helper.spec.js b/src/helpers/heritage-integration/navigation-helper.spec.js index 7e26f4a54..263fd054f 100644 --- a/src/helpers/heritage-integration/navigation-helper.spec.js +++ b/src/helpers/heritage-integration/navigation-helper.spec.js @@ -5,6 +5,7 @@ import { import * as orderHelper from "@/helpers/heritage-integration/order-helper"; import { lazyLoadComponent } from "@/router/dynamic-routing/component-loader.js"; import { storeActions } from "@/constants/store-actions"; +import { storeMutations } from "@/constants/store-mutations"; import { setupMocksForJsFiles, getMockOrderInfo } from "@/helpers/unit-test-helper.js"; import { externalUrls } from "@/router/router-constants/externalUrl-values"; import { queryStrings } from "@/constants/query-strings"; @@ -25,6 +26,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: false, @@ -43,6 +47,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -62,6 +69,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -82,6 +92,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -103,6 +116,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -125,6 +141,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -152,6 +171,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -179,6 +201,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -206,6 +231,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -233,6 +261,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -260,6 +291,9 @@ describe("getPageToRouteExistingOrderTo", () => { query: {}, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Mock out the lazy load calls for all components. mockLazyLoadComponentReturnValues({ [fmgPageValues.VEHICLE_MAKE]: true, @@ -289,6 +323,9 @@ describe("getPageToRouteExistingOrderTo", () => { }, }; + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + // Act const result = await getPageToRouteExistingOrderTo(toRoute, true); diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 87c911232..4e533bb70 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -61,6 +61,9 @@ describe("estimate.vue", () => { selectedVinLookupMethod: vinLookupMethodSelections.MANUALVIN, }); + store.commit(storeMutations.UPDATE_IS_REPAIR, false); + store.commit(storeMutations.UPDATE_MAKE, "acura"); + //Act await wrapper.vm.forwardButtonAction(); @@ -216,8 +219,27 @@ 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); + + expect(wrapper.vm.skipVinLookup).toEqual(expectedVinSkip); + } + ); +}); + function setupMocks({ groupName = "estimate", + isVinOptionalVehicle = false, cmsQuestionText = "Let's get your VIN. Or we can look it up for you!", cmsAnswers = [ { Name: "Provide my VIN manually Most specific to your vehicle" }, @@ -249,6 +271,7 @@ function setupMocks({ mountOptions["attachTo"] = document.body; const wrapper = shallowMount(estimate, mountOptions); + wrapper.vm.isVinOptionalVehicle = isVinOptionalVehicle; return { wrapper, apiPromise }; } diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 523e0b103..058077d39 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -5,7 +5,7 @@
-
+
= 2018 + ) + return true; + + if ( + context.state.order.vehicle.make.toLowerCase() === "bmw" && + context.state.order.vehicle.year <= 2017 + ) + return true; + + return false; + }, }; export default createStore({ diff --git a/src/store/store.spec.js b/src/store/store.spec.js index d99e42b82..7ca65cc74 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -2711,3 +2711,33 @@ 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; + + context.state = { + order: { + vehicle: { year: year, make: make }, + }, + }; + + var vinOptionalResult = actions.isVinOptionalVehicle(context); + expect(vinOptionalResult).toEqual(expectedVinSkip); + } + ); +}); diff --git a/src/ux-components/text-link/text-link.vue b/src/ux-components/text-link/text-link.vue index 57f061971..fff40d9a0 100644 --- a/src/ux-components/text-link/text-link.vue +++ b/src/ux-components/text-link/text-link.vue @@ -1,19 +1,21 @@