Merge branch 'develop' into feature/digital/SSR-254

# Conflicts:
#	src/constants/vehicle-lookup-alert-types.js
#	src/layouts/coverage-statement/coverage-statement.vue
#	src/layouts/vin-lookup/vin-lookup-alerts/vin-lookup-alerts.vue
#	src/layouts/vin-lookup/vin-lookup.vue
This commit is contained in:
Kroell 2023-03-10 11:47:48 -05:00
commit 8e4de86f0d
19 changed files with 297 additions and 64 deletions

View file

@ -1,7 +1,7 @@
const vehicleLookupAlertTypes = Object.freeze({ const vehicleLookupAlertTypes = Object.freeze({
NOT_FOUND: 'notFound', NOT_FOUND: 'notFound',
NOT_MATCHED: 'notMatched', NOT_MATCHED: 'notMatched',
PERFECT_MATCH: 'perfectMatch', TWO_IDENTICAL_YMM_MATCHED:'twoIdenticalYMMMatched'
}); });
export default vehicleLookupAlertTypes; export default vehicleLookupAlertTypes;

View file

@ -229,7 +229,7 @@ export default {
.overflow-scroll { .overflow-scroll {
// Height will be determined by overall height of content above list // Height will be determined by overall height of content above list
height: calc(100% - 383px); height: calc(100% - 400px);
overflow-x: hidden !important; overflow-x: hidden !important;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
} }

View file

@ -4,7 +4,7 @@
<siteHeader cmsWidgetName="SiteHeaderWidget" /> <siteHeader cmsWidgetName="SiteHeaderWidget" />
<vehicleBanner class="mb-3" cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="false" /> <vehicleBanner class="mb-3" cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="false" />
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" /> <siteSubHeader cmsWidgetName="SiteSubHeaderWidget" />
<div class="fade-on-route-transition sub-container make-tall"> <div class="fade-on-route-transition sub-container overflow-scroll">
<alert <alert
ref="alertFewMoreQuestions" ref="alertFewMoreQuestions"
cmsWidgetName="alertWidget" cmsWidgetName="alertWidget"
@ -95,6 +95,10 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.overflow-scroll {
height: calc(100% - 368px);
overflow-x: hidden !important;
}
.questions-page { .questions-page {
.question-text { .question-text {
margin-bottom: 0.5rem; margin-bottom: 0.5rem;

View file

@ -56,6 +56,43 @@ describe("address-lookup.vue", () => {
); );
}); });
test("if the address matches two identical YMM vehicles, then display Two Identical YMM Vehicle alert", async () => {
// Arrange
const mockRegistrationAddress = {
streetAddress: "1234 Main St",
city: "Columbus",
state: "OH",
zipCode: "43215",
};
const { wrapper } = setupMocks({
vinVehicles: [
{
vehicle: {
carId: "C00000",
},
},
],
});
useMainStore().order.vehicle.carId = "CARID2";
await wrapper.setData({
customerQuestions: {
addressQuestions: mockRegistrationAddress,
},
isTwoIdenticalYMMVehicleFound:true,
});
// Act
await wrapper.vm.forwardButtonAction();
// Assert
expect(wrapper.findComponent({ ref: "alertMatchedTwoIdenticalYMMVehicle" }).isVisible()).toBe(
true
);
});
test("if the looking up VIN by address is not allowed in the state selected display the Vin Lookup By HomeAddress Not Allowed Alert", async () => { test("if the looking up VIN by address is not allowed in the state selected display the Vin Lookup By HomeAddress Not Allowed Alert", async () => {
// Arrange // Arrange
const mockRegistrationAddress = { const mockRegistrationAddress = {

View file

@ -29,6 +29,15 @@
:manualCopy="AlertMatchedDifferentVehicleBody" :manualCopy="AlertMatchedDifferentVehicleBody"
alertClass="alert-warning" alertClass="alert-warning"
v-bind:isDismissible="false" /> v-bind:isDismissible="false" />
<alert
ref="alertMatchedTwoIdenticalYMMVehicle"
v-if="displayMatchedTwoIdenticalYMMVehicleAlert"
class="mb-4"
cmsWidgetName="AlertMatchedTwoIdenticalYMMVehicleWidget"
:manualHeadline="AlertMatchedTwoIdenticalYMMVehicleHeader"
:manualCopy="AlertMatchedTwoIdenticalYMMVehicleBody"
alertClass="alert-warning"
v-bind:isDismissible="false" />
<alert <alert
ref="alertVinLookupsByHomeAddressNotAllowed" ref="alertVinLookupsByHomeAddressNotAllowed"
v-if="displayVinLookupByHomeAddressNotAllowedAlert" v-if="displayVinLookupByHomeAddressNotAllowedAlert"
@ -101,10 +110,12 @@ export default {
displayVinNotFoundAlert: false, displayVinNotFoundAlert: false,
displayMatchedDifferentVehicleAlert: false, displayMatchedDifferentVehicleAlert: false,
displayVinLookupByHomeAddressNotAllowedAlert: false, displayVinLookupByHomeAddressNotAllowedAlert: false,
displayMatchedTwoIdenticalYMMVehicleAlert: false,
previouslyEnteredCarId: "", previouslyEnteredCarId: "",
isCarIdDifferent: false, isCarIdDifferent: false,
isSelectedGlassAvailableForVehicle: true, isSelectedGlassAvailableForVehicle: true,
customAlertData: {}, customAlertData: {},
forwardButtonCarStyle:"",
}; };
}, },
methods: { methods: {
@ -171,8 +182,14 @@ export default {
if (this.isCarIdDifferent && carFound.carId !== this.previouslyEnteredCarId) { if (this.isCarIdDifferent && carFound.carId !== this.previouslyEnteredCarId) {
// Display Alert // Display Alert
this.previouslyEnteredCarId = carFound.carId; this.previouslyEnteredCarId = carFound.carId;
this.customAlertData.vehicleInfo = carFound; this.customAlertData.vehicleInfo = carFound;
this.displayMatchedDifferentVehicleAlert = true; if(this.isTwoIdenticalYMMVehicleFound){
this.displayMatchedTwoIdenticalYMMVehicleAlert = true;
this.forwardButtonCarStyle= carFound.style;
}
else{
this.displayMatchedDifferentVehicleAlert = true;
}
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
carFound.carId carFound.carId
@ -180,7 +197,7 @@ export default {
// Update button "Continue with..." // Update button "Continue with..."
this.$refs.siteFooter.updateButtonText( this.$refs.siteFooter.updateButtonText(
`Continue with ${carFound.year} ${carFound.make} ${carFound.model} ${carFound.style}` `Continue with ${carFound.year} ${carFound.make} ${carFound.model} ${this.forwardButtonCarStyle}`
); );
return this.$refs.siteFooter.removeLoader(); return this.$refs.siteFooter.removeLoader();
} }
@ -277,14 +294,34 @@ export default {
).replaceAll("{custom:damage}", getDamageString()); ).replaceAll("{custom:damage}", getDamageString());
}, },
AlertMatchedDifferentVehicleBody() { AlertMatchedDifferentVehicleBody() {
const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
const vinYmmExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
return this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText")
.replaceAll("{custom:damage}", getDamageString())
.replaceAll("{custom:vinYmmFound}", vinYmmFound)
.replaceAll("{custom:vinYmmExpected}", vinYmmExpected);
},
AlertMatchedTwoIdenticalYMMVehicleHeader() {
return this.getCmsContent(
"AlertMatchedTwoIdenticalYMMVehicleWidget",
"HeadlineText"
).replaceAll("{custom:damage}", getDamageString());
},
AlertMatchedTwoIdenticalYMMVehicleBody() {
const vinYmmsFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`; const vinYmmsFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`;
const vinYmmsExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`; const vinYmmsExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`;
return this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText") return this.getCmsContent("AlertMatchedTwoIdenticalYMMVehicleWidget", "BodyText")
.replaceAll("{custom:damage}", getDamageString()) .replaceAll("{custom:damage}", getDamageString())
.replaceAll("{custom:vinYmmsFound}", vinYmmsFound) .replaceAll("{custom:vinYmmsFound}", vinYmmsFound)
.replaceAll("{custom:vinYmmsExpected}", vinYmmsExpected); .replaceAll("{custom:vinYmmsExpected}", vinYmmsExpected);
}, },
isTwoIdenticalYMMVehicleFound(){
const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
const vinYmmExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
return(vinYmmFound.toLowerCase()==vinYmmExpected.toLowerCase());
}
}, },
watch: { watch: {
customerQuestions: { customerQuestions: {
@ -313,7 +350,7 @@ export default {
<style lang="scss"> <style lang="scss">
.overflow-scroll { .overflow-scroll {
height: calc(100% - 353px); height: calc(100% - 368px);
overflow-X: hidden !important; overflow-X: hidden !important;
} }

View file

@ -5,7 +5,7 @@
ref="theForm" ref="theForm"
v-slot="{ meta }" v-slot="{ meta }"
> >
<div class="page-container-grouped-styles overflow-auto"> <div class="page-container-grouped-styles ">
<siteHeader cmsWidgetName="SiteHeaderWidget" /> <siteHeader cmsWidgetName="SiteHeaderWidget" />
<vehicleBanner <vehicleBanner
class="mb-3" class="mb-3"
@ -14,7 +14,7 @@
/> />
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" /> <siteSubHeader cmsWidgetName="SiteSubHeaderWidget" />
<div class="px-5"> <div class="px-5 ">
<alert <alert
cmsWidgetName="FoundMultipleVehicles" cmsWidgetName="FoundMultipleVehicles"
ref="alertFoundMultipleVehicles" ref="alertFoundMultipleVehicles"
@ -26,7 +26,7 @@
id="multiple-vehicles-alert" id="multiple-vehicles-alert"
/> />
</div> </div>
<div class="overflow-scroll">
<addressVehiclesQuestion <addressVehiclesQuestion
ref="addressVehiclesQuestion" ref="addressVehiclesQuestion"
cmsWidgetName="VehicleConfirmationQuestion" cmsWidgetName="VehicleConfirmationQuestion"
@ -54,6 +54,7 @@
</span> </span>
</div> </div>
</div> </div>
</div>
<siteFooter <siteFooter
cmsWidgetName="SiteFooterWidget" cmsWidgetName="SiteFooterWidget"
:isForwardActionDisabled="!meta.valid" :isForwardActionDisabled="!meta.valid"
@ -270,4 +271,9 @@ export default {
#multiple-vehicles-alert p { #multiple-vehicles-alert p {
margin-bottom: 0 !important; // Overrides extra margin-bottom on alert body text margin-bottom: 0 !important; // Overrides extra margin-bottom on alert body text
} }
.overflow-scroll {
height: calc(100% - 432px);
overflow-X: hidden !important;
}
</style> </style>

View file

@ -4,11 +4,11 @@
@invalidSubmit="onInvalidSubmit" @invalidSubmit="onInvalidSubmit"
v-slot="{ meta }" v-slot="{ meta }"
> >
<div class="page-container-grouped-styles overflow-auto"> <div class="page-container-grouped-styles">
<siteHeader <siteHeader
cmsWidgetName="SiteHeaderWidget" cmsWidgetName="SiteHeaderWidget"
/> />
<div class="fade-on-route-transition sub-container make-tall px-5"> <div class="fade-on-route-transition sub-container overflow-scroll px-5">
<textBlock <textBlock
cmsWidgetName="verifyingCoverageStatement" cmsWidgetName="verifyingCoverageStatement"
typeStyle="h5" typeStyle="h5"
@ -141,10 +141,14 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.overflow-scroll {
// prevents vertical scrollbar from appearing when modal opens height: calc(100% - 168px);
.modal { overflow-X: hidden !important;
overflow: hidden;
} }
ol {
margin-left: -1rem;
li {
margin-bottom: .5rem;
}
}
</style> </style>

View file

@ -48,6 +48,30 @@ describe("license-plate-lookup.vue", () => {
); );
}); });
test("If license plate matches two identical YMM vehicles, display alertMatchedTwoIdenticalYMMVehicle", async () => {
// Arrange
const mockRegistrationLicensePlate = {
licensePlate: "UTN990",
};
const { wrapper } = setupMocks({});
useMainStore().order.vehicle.carId = "TESTCARID";
await wrapper.setData({
licensePlate: mockRegistrationLicensePlate,
isTwoIdenticalYMMVehicleFound:true,
});
// Act
await wrapper.vm.forwardButtonAction();
// Assert
expect(wrapper.findComponent({ ref: "alertMatchedTwoIdenticalYMMVehicle" }).isVisible()).toBe(
true
);
});
test("If no vehicles found, display VinNotFound alert", async () => { test("If no vehicles found, display VinNotFound alert", async () => {
// Arrange // Arrange
const mockRegistrationLicensePlate = { const mockRegistrationLicensePlate = {

View file

@ -3,14 +3,14 @@
@submit="onSubmit" @submit="onSubmit"
@invalid-submit="onInvalidSubmit" @invalid-submit="onInvalidSubmit"
v-slot="{ meta }"> v-slot="{ meta }">
<div class="page-container-grouped-styles overflow-auto"> <div class="page-container-grouped-styles">
<siteHeader cms-widget-name="SiteHeaderWidget" /> <siteHeader cms-widget-name="SiteHeaderWidget" />
<vehicleBanner <vehicleBanner
class="mb-3" class="mb-3"
cms-widget-name="VehicleBannerWidget" cms-widget-name="VehicleBannerWidget"
:display-generic-vehicle-image="false" /> :display-generic-vehicle-image="false" />
<siteSubHeader cms-widget-name="SiteSubHeaderWidget" /> <siteSubHeader cms-widget-name="SiteSubHeaderWidget" />
<div class="fade-on-route-transition sub-container make-tall mt-5 px-5"> <div class="fade-on-route-transition sub-container overflow-scroll mt-5 px-5">
<alert <alert
ref="alertVinNotFound" ref="alertVinNotFound"
v-if="displayVinNotFoundAlert" v-if="displayVinNotFoundAlert"
@ -27,6 +27,15 @@
:manualCopy="AlertMatchedDifferentVehicleBody" :manualCopy="AlertMatchedDifferentVehicleBody"
alertClass="alert-warning" alertClass="alert-warning"
v-bind:isDismissible="false" /> v-bind:isDismissible="false" />
<alert
ref="alertMatchedTwoIdenticalYMMVehicle"
v-if="displayMatchedTwoIdenticalYMMVehicleAlert"
class="mb-4"
cmsWidgetName="AlertMatchedTwoIdenticalYMMVehicleWidget"
:manualHeadline="AlertMatchedTwoIdenticalYMMVehicleHeader"
:manualCopy="AlertMatchedTwoIdenticalYMMVehicleBody"
alertClass="alert-warning"
v-bind:isDismissible="false" />
<textboxQuestion <textboxQuestion
cmsWidgetName="LicensePlateNumberQuestionWidget" cmsWidgetName="LicensePlateNumberQuestionWidget"
v-model="licensePlate" v-model="licensePlate"
@ -112,10 +121,12 @@ export default {
licenseState: useMainStore().order.customer.address.state, licenseState: useMainStore().order.customer.address.state,
displayVinNotFoundAlert: false, displayVinNotFoundAlert: false,
displayMatchedDifferentVehicleAlert: false, displayMatchedDifferentVehicleAlert: false,
displayMatchedTwoIdenticalYMMVehicleAlert: false,
previouslyEnteredCarId: "", previouslyEnteredCarId: "",
isCarIdDifferent: false, isCarIdDifferent: false,
customAlertData: {}, customAlertData: {},
isSelectedGlassAvailableForVehicle: true, isSelectedGlassAvailableForVehicle: true,
forwardButtonCarStyle:"",
}; };
}, },
methods: { methods: {
@ -178,15 +189,21 @@ export default {
// Display Alert // Display Alert
this.previouslyEnteredCarId = vehicleFromLookup.carId; this.previouslyEnteredCarId = vehicleFromLookup.carId;
this.customAlertData.vehicleInfo = vehicleFromLookup; this.customAlertData.vehicleInfo = vehicleFromLookup;
this.displayMatchedDifferentVehicleAlert = true;
if(this.isTwoIdenticalYMMVehicleFound){
this.displayMatchedTwoIdenticalYMMVehicleAlert = true;
this.forwardButtonCarStyle= vehicleFromLookup.style;
}
else{
this.displayMatchedDifferentVehicleAlert = true;
}
this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId(
vehicleFromLookup.carId vehicleFromLookup.carId
); );
// Update button "Continue with..." // Update button "Continue with..."
this.$refs.siteFooter.updateButtonText( this.$refs.siteFooter.updateButtonText(`Continue with ${vehicleFromLookup.year} ${vehicleFromLookup.make} ${vehicleFromLookup.model} ${this.forwardButtonCarStyle}`);
`Continue with ${vehicleFromLookup.year} ${vehicleFromLookup.make} ${vehicleFromLookup.model} ${vehicleFromLookup.style}`
);
return this.$refs.siteFooter.removeLoader(); return this.$refs.siteFooter.removeLoader();
} }
@ -236,14 +253,34 @@ export default {
).replaceAll("{custom:damage}", getDamageString()); ).replaceAll("{custom:damage}", getDamageString());
}, },
AlertMatchedDifferentVehicleBody() { AlertMatchedDifferentVehicleBody() {
const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
const vinYmmExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
return this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText")
.replaceAll("{custom:damage}", getDamageString())
.replaceAll("{custom:vinYmmFound}", vinYmmFound)
.replaceAll("{custom:vinYmmExpected}", vinYmmExpected);
},
AlertMatchedTwoIdenticalYMMVehicleHeader() {
return this.getCmsContent(
"AlertMatchedTwoIdenticalYMMVehicleWidget",
"HeadlineText"
).replaceAll("{custom:damage}", getDamageString());
},
AlertMatchedTwoIdenticalYMMVehicleBody() {
const vinYmmsFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`; const vinYmmsFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model} ${this.customAlertData?.vehicleInfo?.style}`;
const vinYmmsExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`; const vinYmmsExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model} ${this.mainStore.order.vehicle.style}`;
return this.getCmsContent("AlertMatchedDifferentVehicleWidget", "BodyText") return this.getCmsContent("AlertMatchedTwoIdenticalYMMVehicleWidget", "BodyText")
.replaceAll("{custom:damage}", getDamageString()) .replaceAll("{custom:damage}", getDamageString())
.replaceAll("{custom:vinYmmsFound}", vinYmmsFound) .replaceAll("{custom:vinYmmsFound}", vinYmmsFound)
.replaceAll("{custom:vinYmmsExpected}", vinYmmsExpected); .replaceAll("{custom:vinYmmsExpected}", vinYmmsExpected);
}, },
isTwoIdenticalYMMVehicleFound(){
const vinYmmFound = `${this.customAlertData?.vehicleInfo?.year} ${this.customAlertData?.vehicleInfo?.make} ${this.customAlertData?.vehicleInfo?.model}`;
const vinYmmExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
return(vinYmmFound.toLowerCase()==vinYmmExpected.toLowerCase());
},
stateOptions: { stateOptions: {
get: function () { get: function () {
return states; return states;
@ -276,6 +313,11 @@ export default {
</script> </script>
<style> <style>
.overflow-scroll {
height: calc(100% - 392px);
overflow-x: hidden !important;
}
#license-plate-question-wrapper .form-test-error { #license-plate-question-wrapper .form-test-error {
/** /**
Override extra margin-bottom in the error message in TextboxQuestion Override extra margin-bottom in the error message in TextboxQuestion

View file

@ -138,7 +138,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.overflow-scroll { .overflow-scroll {
height: calc(100% - 152px); height: calc(100% - 168px);
overflow-X: hidden !important; overflow-X: hidden !important;
} }
.alert.alert-warning .alert.alert-warning

View file

@ -475,7 +475,7 @@ export default {
<style lang="scss"> <style lang="scss">
.overflow-scroll { .overflow-scroll {
height: calc(100% - 353px); height: calc(100% - 368px);
overflow-X: hidden !important; overflow-X: hidden !important;
} }
</style> </style>

View file

@ -118,7 +118,7 @@ export default {
<style lang="scss"> <style lang="scss">
.overflow-scroll { .overflow-scroll {
height: calc(100% - 353px); height: calc(100% - 368px);
overflow-X: hidden !important; overflow-X: hidden !important;
} }
</style> </style>

View file

@ -8,7 +8,7 @@
cmsWidgetName="VehicleBannerWidget" cmsWidgetName="VehicleBannerWidget"
:displayGenericVehicleImage="false" /> :displayGenericVehicleImage="false" />
<siteSubHeader ref="siteSubHeader" cmsWidgetName="SiteSubHeaderWidget" /> <siteSubHeader ref="siteSubHeader" cmsWidgetName="SiteSubHeaderWidget" />
<div class="fade-on-route-transition sub-container make-tall overflow-auto px-5"> <div class="fade-on-route-transition sub-container overflow-scroll px-5">
<div class="prevent-squish my-5"> <div class="prevent-squish my-5">
<div class="row"> <div class="row">
<div class="col"> <div class="col">
@ -221,3 +221,9 @@ export default {
}, },
}; };
</script> </script>
<style lang="scss">
.overflow-scroll {
height: calc(100% - 368px);
overflow-x: hidden !important;
}
</style>

View file

@ -0,0 +1,53 @@
<template>
<alert
alertClass="alert-warning"
cmsWidgetName="AlertMatchedTwoIdenticalYMMVehicleWidget"
:manualCopy="body"
:manualHeadline="header"
aria-label="two-identical-ymm-vehicle-alert"
/>
</template>
<script>
import { getDamageString } from '@/helpers/damage-helper';
import alert from '@/ux-components/alert/alert.vue';
export default {
name: 'two-identical-ymm-vehicle-alert',
components: {
alert,
},
inject: ['vehicleFromLookup'],
computed: {
header() {
return (
this.getCmsContent('AlertMatchedTwoIdenticalYMMVehicleWidget', 'HeadlineText')
.replaceAll('{custom:damage}', getDamageString())
);
},
body() {
let year = '';
let make = '';
let model = '';
let style = '';
if (this.vehicleFromLookup) {
year = this.vehicleFromLookup.year;
make = this.vehicleFromLookup.make;
model = this.vehicleFromLookup.model;
style = this.vehicleFromLookup.style;
}
return (
this.getCmsContent('AlertMatchedTwoIdenticalYMMVehicleWidget', 'BodyText')
.replaceAll('{custom:damage}', getDamageString())
.replaceAll('{custom:vinlookupYear}', year)
.replaceAll('{custom:vinlookupMake}', make)
.replaceAll('{custom:vinlookupModel}', model)
.replaceAll('{custom:vinlookupStyle}', style)
);
},
},
};
</script>

View file

@ -28,14 +28,12 @@ export default {
body() { body() {
let year = ''; let year = '';
let make = ''; let make = '';
let model = ''; let model = '';
let style = '';
if (this.vehicleFromLookup) { if (this.vehicleFromLookup) {
year = this.vehicleFromLookup.year; year = this.vehicleFromLookup.year;
make = this.vehicleFromLookup.make; make = this.vehicleFromLookup.make;
model = this.vehicleFromLookup.model; model = this.vehicleFromLookup.model;
style = this.vehicleFromLookup.style;
} }
return ( return (
@ -43,8 +41,7 @@ export default {
.replaceAll('{custom:damage}', getDamageString()) .replaceAll('{custom:damage}', getDamageString())
.replaceAll('{custom:vinlookupYear}', year) .replaceAll('{custom:vinlookupYear}', year)
.replaceAll('{custom:vinlookupMake}', make) .replaceAll('{custom:vinlookupMake}', make)
.replaceAll('{custom:vinlookupModel}', model) .replaceAll('{custom:vinlookupModel}', model)
.replaceAll('{custom:vinlookupStyle}', style)
); );
}, },
}, },

View file

@ -54,4 +54,18 @@ describe('vin-lookup-alerts.vue', () => {
expect(vehicleNotFoundAlert).toEqual(null); expect(vehicleNotFoundAlert).toEqual(null);
expect(vehicleNotMatchedAlert).toBeVisible(); expect(vehicleNotMatchedAlert).toBeVisible();
}); });
test('TwoIdenticalYMMVehicleAlert is displayed on the screen', () => {
getDamageString.mockImplementation(() => 'Mock Damage String');
mountOptions.props = {
activeAlertType: vehicleLookupAlertTypes.TWO_IDENTICAL_YMM_MATCHED,
};
mountOptions.global.provide = {
vehicleFromLookup: {},
};
const { queryByRole } = render(VinLookupAlertsComponent, mountOptions);
const twoIdenticalYMMVehicleAlert = queryByRole('alert', { name: 'two-identical-ymm-vehicle-alert' });
expect(twoIdenticalYMMVehicleAlert).toBeVisible();
});
}); });

View file

@ -6,6 +6,9 @@
<vehicleNotFoundAlert <vehicleNotFoundAlert
v-if="isVehicleNotFoundVisible" v-if="isVehicleNotFoundVisible"
/> />
<twoIdenticalYMMVehicleAlert
v-if="isTwoIdenticalYMMVehicleFoundVisible"
/>
<vehicleNotMatchedAlert <vehicleNotMatchedAlert
v-else-if="isVehicleNotMatchedVisible" v-else-if="isVehicleNotMatchedVisible"
/> />
@ -16,9 +19,9 @@
</template> </template>
<script> <script>
import vehicleLookupAlertTypes from '@/constants/vehicle-lookup-alert-types'; import vehicleLookupAlertTypes from '@/constants/vehicle-lookup-alert-types';
import vehicleNotFoundAlert from './vehicle-not-found-alert/vehicle-not-found-alert.vue'; import vehicleNotFoundAlert from '@/layouts/vin-lookup/vin-lookup-alerts/vehicle-not-found-alert/vehicle-not-found-alert';
import vehicleNotMatchedAlert from './vehicle-not-matched-alert/vehicle-not-matched-alert.vue'; import vehicleNotMatchedAlert from '@/layouts/vin-lookup/vin-lookup-alerts/vehicle-not-matched-alert/vehicle-not-matched-alert';
import perfectMatchAlert from './perfect-match-alert/perfect-match-alert.vue'; import twoIdenticalYMMVehicleAlert from '@/layouts/vin-lookup/vin-lookup-alerts/two-identical-ymm-vehicle-alert/two-identical-ymm-vehicle-alert'
export default { export default {
@ -26,7 +29,7 @@ export default {
components: { components: {
vehicleNotFoundAlert, vehicleNotFoundAlert,
vehicleNotMatchedAlert, vehicleNotMatchedAlert,
perfectMatchAlert, twoIdenticalYMMVehicleAlert,
}, },
props: { props: {
activeAlertType: { activeAlertType: {
@ -45,8 +48,8 @@ export default {
isVehicleNotMatchedVisible() { isVehicleNotMatchedVisible() {
return this.activeAlertType === vehicleLookupAlertTypes.NOT_MATCHED; return this.activeAlertType === vehicleLookupAlertTypes.NOT_MATCHED;
}, },
isPerfectMatchVisible() { isTwoIdenticalYMMVehicleFoundVisible(){
return this.activeAlertType === vehicleLookupAlertTypes.PERFECT_MATCH; return this.activeAlertType === vehicleLookupAlertTypes.TWO_IDENTICAL_YMM_MATCHED;
}, },
wrapperCssClass() { wrapperCssClass() {
return { return {

View file

@ -4,7 +4,7 @@
@invalidSubmit="onInvalidSubmit" @invalidSubmit="onInvalidSubmit"
v-slot="{ meta }" v-slot="{ meta }"
> >
<div class="page-container-grouped-styles overflow-auto"> <div class="page-container-grouped-styles ">
<siteHeader <siteHeader
cmsWidgetName="SiteHeaderWidget" cmsWidgetName="SiteHeaderWidget"
/> />
@ -16,16 +16,14 @@
<siteSubHeader <siteSubHeader
cmsWidgetName="SiteSubHeaderWidget" cmsWidgetName="SiteSubHeaderWidget"
/> />
<div class="px-4"> <div class="px-4 overflow-scroll ">
<div class="fade-on-route-transition sub-container make-tall px-2 mt-5"> <div class="fade-on-route-transition sub-container px-2 mt-5">
<vinLookupAlerts <vinLookupAlerts
:activeAlertType="activeVehicleLookupAlertType" :activeAlertType="activeVehicleLookupAlertType"
/> />
<vinQuestion <vinQuestion
v-model="vin" v-model="vin"
:isDisabled="vinPopulatedOnPageLoad"
:mask="vinMask"
/> />
<vinLocationInformation /> <vinLocationInformation />
@ -87,8 +85,8 @@ export default {
activeVehicleLookupAlertType: null, activeVehicleLookupAlertType: null,
needToLookupVehicle: true, needToLookupVehicle: true,
vehicleFromLookup: null, vehicleFromLookup: null,
vin: this.getVinFromStore(), vin: null,
vinPopulatedOnPageLoad: this.getVinFromStore()?.length > 0, forwardButtonCarStyle:"",
}; };
}, },
provide() { provide() {
@ -120,23 +118,16 @@ export default {
&& this.vehicleFromLookup.carId !== this.mainStore.vehicle.carId && this.vehicleFromLookup.carId !== this.mainStore.vehicle.carId
); );
}, },
vinMask() { isTwoIdenticalYMMVehicleFound(){
if (this.vinPopulatedOnPageLoad) { const vinYmmFound = `${this.vehicleFromLookup.year} ${this.vehicleFromLookup.make} ${this.vehicleFromLookup.model}`;
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.PERFECT_MATCH; const vinYmmExpected = `${this.mainStore.order.vehicle.year} ${this.mainStore.order.vehicle.make} ${this.mainStore.order.vehicle.model}`;
const lastSixChars = this.vin.substring(11, this.vin.length); return(vinYmmFound.toLowerCase()==vinYmmExpected.toLowerCase());
return `!X!X!X!X!X!X!X!X!X!X!X${lastSixChars}`; }
} else {
return "XXXXXXXXXXXXXXXXX";
}
},
}, },
methods: { methods: {
arePagePrerequisiteValid() { arePagePrerequisiteValid() {
return true; return true;
}, },
getVinFromStore() {
return this.mainStore.vehicle.vin;
},
backButtonAction() { backButtonAction() {
/** /**
* this.navigationScenarios comes from base-mixin * this.navigationScenarios comes from base-mixin
@ -168,9 +159,16 @@ export default {
} }
if (this.needToLookupVehicle && this.isCarIdDifferentFromTheStore) { if (this.needToLookupVehicle && this.isCarIdDifferentFromTheStore) {
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.NOT_MATCHED; if(this.isTwoIdenticalYMMVehicleFound){
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.TWO_IDENTICAL_YMM_MATCHED;
this.forwardButtonCarStyle = this.vehicleFromLookup.style;
}
else{
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.NOT_MATCHED;
}
const vehicleYearMakeModelStyle = `${this.vehicleFromLookup.year} ${this.vehicleFromLookup.make} ${this.vehicleFromLookup.model} ${this.vehicleFromLookup.style}`; const vehicleYearMakeModelStyle = `${this.vehicleFromLookup.year} ${this.vehicleFromLookup.make} ${this.vehicleFromLookup.model} ${this.forwardButtonCarStyle}`;
this.$refs.siteFooter.updateButtonText(`Continue with ${vehicleYearMakeModelStyle}`); this.$refs.siteFooter.updateButtonText(`Continue with ${vehicleYearMakeModelStyle}`);
this.$refs.siteFooter.removeLoader(); this.$refs.siteFooter.removeLoader();
@ -198,7 +196,7 @@ export default {
// navigate() doesn't stop the processing flow // navigate() doesn't stop the processing flow
return; return;
} }
this.activeVehicleLookupAlertType = vehicleLookupAlertTypes.PERFECT_MATCH;
this.mainStore.updateVehicle(this.vehicleFromLookup); this.mainStore.updateVehicle(this.vehicleFromLookup);
const partsOrQuestionsResponse = await this.getPartsOrQuestions(); const partsOrQuestionsResponse = await this.getPartsOrQuestions();
if (partsOrQuestionsResponse.error) { if (partsOrQuestionsResponse.error) {
@ -256,3 +254,11 @@ export default {
}, },
}; };
</script> </script>
<style>
.overflow-scroll {
height: calc(100% - 368px);
overflow-X: hidden !important;
}
</style>

View file

@ -335,7 +335,7 @@
<style lang="scss"> <style lang="scss">
.overflow-scroll { .overflow-scroll {
height: calc(100% - 152px); height: calc(100% - 165px);
overflow-X: hidden !important; overflow-X: hidden !important;
} }
.my-2 .my-2