Merge branch 'develop' into feature/digital/SSR-405
# Conflicts: # src/layouts/welcome-page/welcome-page.vue # src/store/index.js
This commit is contained in:
commit
1b79bdd445
23 changed files with 391 additions and 312 deletions
|
|
@ -36,7 +36,8 @@ const errorMessages = {
|
|||
DAMAGE_OPTION_REQUIRED: "Please select an option",
|
||||
|
||||
POLICYHOLDER_FIRST_NAME_REQUIRED: "Please enter the policyholder first name",
|
||||
POLICYHOLDER_LAST_NAME_REQUIRED: "Please enter the policyholder last name"
|
||||
POLICYHOLDER_LAST_NAME_REQUIRED: "Please enter the policyholder last name",
|
||||
ACKNOWLEDGEMENT_REQUIRED: "You must agree to the terms to continue"
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
<template>
|
||||
<div class="footerImage" id="imgCity" v-if="footerImageURL" >
|
||||
<img id="siteFooterImage" :src="footerImageURL" />
|
||||
</div>
|
||||
<footer class="footer container-fluid fixed-bottom g-5 bg-light py-4" id="infoBox">
|
||||
|
||||
<footer class="footer container-fluid g-5 px-0 py-3 " id="infoBox">
|
||||
<div class="row d-flex flex-row-reverse align-items-center vw-100 mx-0">
|
||||
<div class="col button-col d-flex" id="stacked" >
|
||||
<div class="col button-col d-flex px-0" id="stacked" >
|
||||
<buttonMain
|
||||
v-if="!isForwardButtonHidden"
|
||||
ref="buttonMain"
|
||||
|
|
@ -19,7 +17,7 @@
|
|||
data-bs-dismiss="modal"
|
||||
data-test-id="site-footer-main-button" />
|
||||
</div>
|
||||
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 text-break">
|
||||
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 px-0 text-break">
|
||||
<textLink
|
||||
linkType="navigation"
|
||||
:text="backLink"
|
||||
|
|
@ -31,6 +29,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="footerImage" id="imgCity" v-if="footerImageURL" >
|
||||
<img id="siteFooterImage" :src="footerImageURL" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="container-fluid pb-2">
|
||||
<div class="row px-3">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded">
|
||||
<div class="select-car-form rounded pb-1">
|
||||
<textBlock
|
||||
cmsWidgetName="verifyingCoverageStatement"
|
||||
typeStyle="h5"
|
||||
|
|
@ -28,14 +28,15 @@
|
|||
</div>
|
||||
|
||||
<steeringText cmsWidgetName="MASteeringText" ></steeringText>
|
||||
<siteFooter
|
||||
|
||||
</div>
|
||||
<siteFooter
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@backClicked="navigateBack"
|
||||
@forwardClicked="forwardButtonAction"
|
||||
ref="siteFooter"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -156,6 +157,7 @@ export default {
|
|||
<style lang="scss">
|
||||
ol {
|
||||
margin-left: -1rem;
|
||||
margin-bottom:0;
|
||||
li {
|
||||
margin-bottom: .5rem;
|
||||
line-height: 1.5rem;
|
||||
|
|
@ -169,7 +171,10 @@ ol {
|
|||
color: $black;
|
||||
}
|
||||
p strong {
|
||||
color: $black;
|
||||
color: $black;
|
||||
font-weight: 500;
|
||||
}
|
||||
p.small{
|
||||
margin-bottom:0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
:options="stateOptions"
|
||||
disableAutoFill
|
||||
validationRules="state-required"
|
||||
class="mt-4" />
|
||||
class="mt-4 mb-2"/>
|
||||
<siteFooter
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
cms-widget-name="SiteFooterWidget"
|
||||
|
|
|
|||
|
|
@ -87,6 +87,14 @@ describe("navigation", () => {
|
|||
state: "OH",
|
||||
zipCode: "43215",
|
||||
};
|
||||
const mockvehicles = [
|
||||
{
|
||||
vin: "TEST_VIN",
|
||||
},
|
||||
{
|
||||
vin: "TEST_VIN2",
|
||||
}
|
||||
];
|
||||
|
||||
const { wrapper } = setupMocks();
|
||||
|
||||
|
|
@ -97,22 +105,17 @@ describe("navigation", () => {
|
|||
addressQuestions: mockRegistrationAddress,
|
||||
},
|
||||
isCoverageEnabled : true,
|
||||
vehiclesCount:2,
|
||||
vehiclesFound:mockvehicles
|
||||
});
|
||||
const vehiclesFound = [{
|
||||
vehicles:[
|
||||
{
|
||||
vin: "TEST_VIN",
|
||||
},
|
||||
{
|
||||
vin: "TEST_VIN2",
|
||||
}
|
||||
]}];
|
||||
|
||||
|
||||
useMainStore().order.policy.policyNumber = "p_0001";
|
||||
useMainStore().order.policy.dateOfLoss = "2022-01-28";
|
||||
useMainStore().order.accountNumber = "00000";
|
||||
|
||||
// Act
|
||||
|
||||
await wrapper.vm.forwardButtonAction();
|
||||
|
||||
// Assert
|
||||
|
|
@ -121,7 +124,7 @@ describe("navigation", () => {
|
|||
undefined,
|
||||
{},
|
||||
{},
|
||||
vehiclesFound
|
||||
mockvehicles
|
||||
);
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget"/>
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="container-fluid pb-2 px-5">
|
||||
<div class="row mt-4 mb-3">
|
||||
<div class="col">
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" id="sub-header"/>
|
||||
<addressQuestions ref="addressQuestions" v-model="customerQuestions.addressQuestions" includeStreetAddress2="true" id="address-questions-wrapper"/>
|
||||
|
|
@ -65,7 +65,8 @@ export default {
|
|||
mixins: [BaseFormMixin],
|
||||
data() {
|
||||
return {
|
||||
customerQuestions: this.getPolicyHolderDetailsFromStore()
|
||||
customerQuestions: this.getPolicyHolderDetailsFromStore(),
|
||||
vehiclesFound: [],
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
|
|
@ -84,13 +85,16 @@ export default {
|
|||
promise: cmsContentPromise,
|
||||
},];
|
||||
|
||||
|
||||
//use resultMap to populate layout content.
|
||||
let resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
});
|
||||
|
||||
},
|
||||
created(){
|
||||
this.getVehiclesfromPolicyLookup();
|
||||
},
|
||||
methods:
|
||||
{
|
||||
|
|
@ -100,36 +104,18 @@ export default {
|
|||
|
||||
async forwardButtonAction()
|
||||
{
|
||||
this.mainStore.updatePolicyHolderDetails(this.customerQuestions);
|
||||
//call coverage policy lookup if isCoverageEnabled flag enabled
|
||||
var vehiclesFound = {};
|
||||
if(this.isCoverageEnabled){
|
||||
const policyLookupResponse = this.mainStore.getCoveragePolicyInfo({
|
||||
accountNumber:this.mainStore.order.accountNumber.toString(),
|
||||
policyNumber:this.mainStore.order.policy.policyNumber,
|
||||
dateOfLoss:this.mainStore.order.policy.dateOfLoss});
|
||||
|
||||
// Settle promises and get results
|
||||
const promisePolicyLookupResultMap = [
|
||||
{
|
||||
resultKey: "policyLookupResponse",
|
||||
promise: policyLookupResponse,
|
||||
}
|
||||
];
|
||||
const policyLookupResultMap = await settleAllPromises(promisePolicyLookupResultMap);
|
||||
vehiclesFound = policyLookupResultMap.policyLookupResponse?.policies;
|
||||
}
|
||||
return this.navigateForward(vehiclesFound);
|
||||
this.mainStore.updatePolicyHolderDetails(this.customerQuestions);
|
||||
return this.navigateForward();
|
||||
},
|
||||
|
||||
navigateForward(vehiclesFound) {
|
||||
if(vehiclesFound?.length > 0)
|
||||
navigateForward() {
|
||||
if(this.vehiclesCount > 0)
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED,
|
||||
this.$route,
|
||||
{},
|
||||
{},
|
||||
vehiclesFound
|
||||
this.vehiclesFound
|
||||
);
|
||||
else
|
||||
this.$router.navigate(
|
||||
|
|
@ -151,11 +137,54 @@ export default {
|
|||
lastName : this.mainStore.order.customer.lastName,
|
||||
}
|
||||
},
|
||||
async getPolicyLookupResponse(){
|
||||
const policyLookupResponse = this.mainStore.getCoveragePolicyInfo({
|
||||
accountNumber:this.mainStore.order.accountNumber.toString(),
|
||||
policyNumber:this.mainStore.order.policy.policyNumber,
|
||||
dateOfLoss:this.mainStore.order.policy.dateOfLoss});
|
||||
|
||||
// Settle promises and get results
|
||||
const promisePolicyLookupResultMap = [
|
||||
{
|
||||
resultKey: "policyLookupResponse",
|
||||
promise: policyLookupResponse,
|
||||
}
|
||||
];
|
||||
const policyLookupResultMap = await settleAllPromises(promisePolicyLookupResultMap);
|
||||
return policyLookupResultMap.policyLookupResponse;
|
||||
},
|
||||
async getVehiclesfromPolicyLookup()
|
||||
{
|
||||
//call coverage policy lookup if isCoverageEnabled flag enabled
|
||||
if(this.isCoverageEnabled){
|
||||
const policyLookupResponse = await this.getPolicyLookupResponse();
|
||||
if(policyLookupResponse!=null){
|
||||
var policy = policyLookupResponse.policies?.[0];
|
||||
if(policy!=null){
|
||||
//populate policy holder details from policy lookup
|
||||
this.mainStore.order.customer.address.streetAddress = policy.insureds?.[0]?.address;
|
||||
this.mainStore.order.customer.address.city=policy.insureds?.[0]?.city;
|
||||
this.mainStore.order.customer.address.state=policy.insureds?.[0]?.state;
|
||||
this.mainStore.order.customer.address.zipCode=policy.insureds?.[0]?.zipCode;
|
||||
this.mainStore.order.customer.firstName = policy.insureds?.[0]?.firstName;
|
||||
this.mainStore.order.customer.lastName = policy.insureds?.[0]?.lastName;
|
||||
|
||||
this.customerQuestions = this.getPolicyHolderDetailsFromStore();
|
||||
//populate vehicles
|
||||
this.vehiclesFound= policy.vehicles;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
computed:{
|
||||
isCoverageEnabled(){
|
||||
return this.mainStore.issConfig.isCoverageEnabled;
|
||||
}
|
||||
},
|
||||
vehiclesCount(){
|
||||
return this.vehiclesFound.length;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
siteHeader,
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader class="mb-2 header" cmsWidgetName="SiteHeaderWidget"/>
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="container-fluid pb-2 px-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="true" class="mt-2 mb-4" />
|
||||
<policyVehiclesQuestion class="px-4" cmsWidgetName="PolicyVehiclesQuestion" :vehicles="VehiclesForQuestions" validationRules="option-required"/>
|
||||
<policyVehiclesQuestion cmsWidgetName="PolicyVehiclesQuestion" :vehicles="VehiclesForQuestions" validationRules="option-required"/>
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" ref="siteFooter" :isForwardActionDisabled="!meta.valid" @ForwardClicked="forwardButtonAction" @back-clicked="backButtonAction"/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -71,7 +71,7 @@ export default {
|
|||
computed:{
|
||||
VehiclesForQuestions() {
|
||||
// Map API result data, to address-vehicles data structure
|
||||
const vehicles = this.VehiclesFromApi?.[0].vehicles;
|
||||
const vehicles = this.VehiclesFromApi;
|
||||
const mappedData = vehicles.map((v) => {
|
||||
const maskSymbol = "X";
|
||||
const vinStart = maskSymbol.repeat(v.vin.length - 6);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
ref="theForm"
|
||||
>
|
||||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<div class="fade-on-route-transition position-relative px-5">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeader" id="sub-header" class="mb-5" />
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="page-container-grouped-styles">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" id="sub-header" class="mt-5" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" id="sub-header" />
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="row px-3">
|
||||
|
|
@ -28,11 +28,12 @@
|
|||
buttonTypeString="listCard"
|
||||
isRequired
|
||||
v-model="selectedAppointmentType"
|
||||
validationRules="selection-required" />
|
||||
<div class="select-car">
|
||||
validationRules="selection-required"
|
||||
class="service-location-button-question mb-1"/>
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="row px-3">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col px-0">
|
||||
<div class="select-car-form rounded">
|
||||
<siteFooter
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
|
|
@ -218,9 +219,7 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.fade-on-route-transition {
|
||||
margin-bottom: 100px;
|
||||
}
|
||||
|
||||
.page-container-grouped-styles {
|
||||
overflow: auto;
|
||||
}
|
||||
|
|
@ -245,6 +244,7 @@ export default {
|
|||
line-height: 1.250rem;
|
||||
}
|
||||
}
|
||||
|
||||
.choose-option{
|
||||
.button-question >div {
|
||||
&:first-of-type {
|
||||
|
|
@ -255,7 +255,18 @@ export default {
|
|||
}
|
||||
.button-question{
|
||||
.row.form-test-error{
|
||||
line-height:1.5rem;
|
||||
line-height:1.500rem;
|
||||
padding-left: 0rem !important;
|
||||
}
|
||||
}
|
||||
.service-location-button-question {
|
||||
.question-text {
|
||||
margin-top: 1.5rem;
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@
|
|||
TIER_TWO: 'TierTwo',
|
||||
TIER_THREE: 'TierThree',
|
||||
};
|
||||
|
||||
const store = useMainStore();
|
||||
|
||||
export default {
|
||||
name: 'servicePackageQuestion',
|
||||
emits: ['vapsItemsSelected'],
|
||||
|
|
@ -39,6 +42,11 @@
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
availableLineItems() {
|
||||
if (this.allGlassPartsAndItemsHavePrices(store.order.lineItems)) {
|
||||
this.selectDefaultPackage();
|
||||
}
|
||||
},
|
||||
selectedPackageName(newValue) {
|
||||
const VapsProductsInSelectedPackage = this.getVapsLineItemsForSelectedPackage(newValue);
|
||||
this.$emit('vapsItemsSelected', VapsProductsInSelectedPackage);
|
||||
|
|
@ -54,7 +62,7 @@
|
|||
},
|
||||
servicePackageAnswers() {
|
||||
if (!this.cmsWidgetName) return [];
|
||||
let cmsAnswersContent = [
|
||||
const cmsAnswersContent = [
|
||||
{
|
||||
Name: 'TierOne',
|
||||
cmsWidgetName: 'EconomyServicePackage'
|
||||
|
|
@ -72,10 +80,6 @@
|
|||
if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (!this.shouldDisplayTierTwoPackage) {
|
||||
cmsAnswersContent = cmsAnswersContent.filter((answer) => answer.Name != packageNames.TIER_TWO);
|
||||
}
|
||||
const modifiedAnswers = cmsAnswersContent.map((answer) => ({
|
||||
value: answer.Name,
|
||||
buttonLabel: this.getHeaderTextFromCms(answer.cmsWidgetName),
|
||||
|
|
@ -92,9 +96,13 @@
|
|||
},
|
||||
frontWipersApplicableForTierTwo() {
|
||||
const store = useMainStore();
|
||||
const frontWipersAreAvailable = this.lineItemsContainsPartType(partTypeStrings.FRONT_WIPER);
|
||||
const frontWipersAreAvailable = this.lineItemsContainsPartType(
|
||||
partTypeStrings.FRONT_WIPER
|
||||
);
|
||||
const isRepair = store.order.damage.isRepair;
|
||||
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation(glassLocations.WINDSHIELD);
|
||||
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation(
|
||||
glassLocations.WINDSHIELD
|
||||
);
|
||||
if (frontWipersAreAvailable) {
|
||||
if (isRepair) {
|
||||
return true;
|
||||
|
|
@ -162,7 +170,7 @@
|
|||
},
|
||||
getPackagePriceString(packageName) {
|
||||
const formattedPriceFloat = parseFloat(this.getPackagePrice(packageName)).toFixed(2);
|
||||
return '+$' + formattedPriceFloat;
|
||||
return '$' + formattedPriceFloat;
|
||||
},
|
||||
getPackagePrice(packageName) {
|
||||
let priceFloat = 0;
|
||||
|
|
@ -178,9 +186,11 @@
|
|||
const priceFrontWipers = this.frontWipersApplicableForTierTwo;
|
||||
const priceRearWipers = this.rearWiperApplicableForTierTwo;
|
||||
this.nullSafeAvailableLineItems.forEach((item) => {
|
||||
if ((priceFrontWipers &&
|
||||
item.partType.toUpperCase() === partTypeStrings.FRONT_WIPER) ||
|
||||
(priceRearWipers && item.partType.toUpperCase() === partTypeStrings.REAR_WIPER)) {
|
||||
if (
|
||||
(priceFrontWipers &&
|
||||
item.partType.toUpperCase() === partTypeStrings.FRONT_WIPER) ||
|
||||
(priceRearWipers && item.partType.toUpperCase() === partTypeStrings.REAR_WIPER)
|
||||
) {
|
||||
vapsPrice += this.getTotalLineItemPrice(item);
|
||||
}
|
||||
});
|
||||
|
|
@ -205,6 +215,26 @@
|
|||
});
|
||||
return vapsPrice;
|
||||
},
|
||||
selectDefaultPackage() {
|
||||
const vapsFromStore = store.order.lineItems.vaps;
|
||||
let lowestTierForPackage = packageNames.TIER_ONE;
|
||||
if (vapsFromStore?.length > 0) {
|
||||
vapsFromStore.every((vapsItem) => {
|
||||
let lowestTierForThisItem = this.getLowestTierForThisItem(vapsItem);
|
||||
if (lowestTierForThisItem === packageNames.TIER_THREE) {
|
||||
lowestTierForPackage = packageNames.TIER_THREE;
|
||||
return false;
|
||||
} else if (lowestTierForThisItem === packageNames.TIER_TWO) {
|
||||
lowestTierForPackage = packageNames.TIER_TWO;
|
||||
return true;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
this.selectedPackageName = lowestTierForPackage;
|
||||
},
|
||||
|
||||
getLowestTierForThisItem(vapsItem) {
|
||||
let lowestTierForThisItem = null;
|
||||
switch (vapsItem.partType) {
|
||||
|
|
@ -282,6 +312,37 @@
|
|||
return null;
|
||||
}
|
||||
},
|
||||
allGlassPartsAndItemsHavePrices() {
|
||||
if (this.pricedGlassParts) {
|
||||
for (let i = 0; i < this.pricedGlassParts.length; i++) {
|
||||
if (this.priceIsNullOrZero(this.pricedGlassParts[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.supportingItems) {
|
||||
for (let i = 0; i < this.supportingItems.length; i++) {
|
||||
if (this.priceIsNullOrZero(this.supportingItems[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.selectedVaps) {
|
||||
for (let i = 0; i < this.selectedVaps.length; i++) {
|
||||
if (this.priceIsNullOrZero(this.selectedVaps[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
priceIsNullOrZero(lineItem) {
|
||||
return (
|
||||
(lineItem.kitPrice == null || lineItem.kitPrice == 0) &&
|
||||
(lineItem.laborAmount == null || lineItem.laborAmount == 0) &&
|
||||
(lineItem.sellingPrice == null || lineItem.sellingPrice == 0)
|
||||
);
|
||||
},
|
||||
getLineItemsContainingPartType(partType) {
|
||||
const partTypeMatches = this.nullSafeAvailableLineItems.filter(
|
||||
(lineItem) => lineItem.partType.toUpperCase() === partType
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@
|
|||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||
},
|
||||
forwardButtonAction() {
|
||||
if (!this.allGlassPartsAndItemsHavePrices()) {
|
||||
if (!this.$ref.servicePackage.allGlassPartsAndItemsHavePrices()) {
|
||||
console.error('One or more items have no price assigned!');
|
||||
}
|
||||
if (this.pricedGlassParts.length > 0) {
|
||||
|
|
@ -145,37 +145,6 @@
|
|||
store.saveVaps(this.selectedVaps);
|
||||
|
||||
this.$router.navigate(this.navigationScenarios.CLICKED_FORWARD, this.$route);
|
||||
},
|
||||
allGlassPartsAndItemsHavePrices() {
|
||||
if (this.pricedGlassParts) {
|
||||
for (let i = 0; i < this.pricedGlassParts.length; i++) {
|
||||
if (this.priceIsNullOrZero(this.pricedGlassParts[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.supportingItems) {
|
||||
for (let i = 0; i < this.supportingItems.length; i++) {
|
||||
if (this.priceIsNullOrZero(this.supportingItems[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.selectedVaps) {
|
||||
for (let i = 0; i < this.selectedVaps.length; i++) {
|
||||
if (this.priceIsNullOrZero(this.selectedVaps[i])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
priceIsNullOrZero(lineItem) {
|
||||
return (
|
||||
(lineItem.kitPrice == null || lineItem.kitPrice == 0) &&
|
||||
(lineItem.laborAmount == null || lineItem.laborAmount == 0) &&
|
||||
(lineItem.sellingPrice == null || lineItem.sellingPrice == 0)
|
||||
);
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,8 @@
|
|||
v-model="selectedWindshieldOptions"
|
||||
:hasRepairReplaceConflict="hasRepairReplaceConflict"
|
||||
:hasSplitSingleConflict="hasSplitSingleConflict"
|
||||
:selectedDamageLocations="selectedDamageLocations" />
|
||||
:selectedDamageLocations="selectedDamageLocations"
|
||||
class="mb-3" />
|
||||
<alert
|
||||
v-if="hasRepairReplaceConflict"
|
||||
class="my-5"
|
||||
|
|
@ -41,7 +42,7 @@
|
|||
groupName="SideDoorSideQuestion"
|
||||
v-model="sideDoorOptionsData"
|
||||
v-show="!hasRepairReplaceConflict"
|
||||
:selectedDamageLocations="selectedDamageLocations" />
|
||||
:selectedDamageLocations="selectedDamageLocations" class="mb-1"/>
|
||||
<replaceOptionsQuestion
|
||||
ref="backGlassOptions"
|
||||
cmsWidgetName="RearReplaceOptionsQuestion"
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="container-fluid pb-2 px-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="true" class="mb-3" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" :hasBackButton="true" @click-event="backButtonAction" />
|
||||
<makeQuestion class="px-4" v-model="selectedMake" ref="makeQuestion" cmsWidgetName="VehicleMakeQuestion" />
|
||||
<makeQuestion v-model="selectedMake" ref="makeQuestion" cmsWidgetName="VehicleMakeQuestion" />
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" ref="siteFooter" @back-clicked="backButtonAction" :isForwardButtonHidden="shouldHideForwardButton" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="container-fluid pb-2 px-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="true" class="mb-3" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" :hasBackButton="true" :backButtonAccessibleText="backButtonAccessibleText" @click-event="backButtonAction" />
|
||||
<modelQuestion v-model="selectedModel" ref="modelQuestion" cmsWidgetName="VehicleModelQuestion" class="px-4" />
|
||||
<modelQuestion v-model="selectedModel" ref="modelQuestion" cmsWidgetName="VehicleModelQuestion" />
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" ref="siteFooter" @back-clicked="backButtonAction" :isForwardButtonHidden="shouldHideForwardButton" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ describe("glass-part-question.vue", () => {
|
|||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
const { wrapper } = setupMocks(featureListData);
|
||||
|
||||
//Act
|
||||
|
|
@ -94,7 +94,7 @@ describe("glass-part-question.vue", () => {
|
|||
await wrapper.setData({ selectedTint: "Green Tint" });
|
||||
// to trigger the computed setter
|
||||
wrapper.vm.selectedPartNumber = "DB12209GTYN";
|
||||
|
||||
|
||||
//Assert
|
||||
expect(wrapper.emitted()["update:modelValue"][0]).toEqual([
|
||||
{ partNumber: "DB12209GTYN", color: "Green Tint" },
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ import { errorMessages } from "@/constants/error-messages";
|
|||
|
||||
export default {
|
||||
name: "glass-part-question",
|
||||
emits: ["update:modelValue"],
|
||||
inheritAttrs: false,
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -117,10 +118,8 @@ export default {
|
|||
return this.modelValue?.partNumber;
|
||||
},
|
||||
set(newValue) {
|
||||
this.$emit(
|
||||
"update:modelValue",
|
||||
this.partsForSelectedTint.filter((part) => part.partNumber == newValue.value)[0]
|
||||
);
|
||||
const part = this.partsForSelectedTint.filter((part) => part.partNumber == newValue?.value)[0];
|
||||
this.$emit("update:modelValue", part);
|
||||
},
|
||||
},
|
||||
|
||||
|
|
@ -181,13 +180,6 @@ export default {
|
|||
return tintSourceObject.src;
|
||||
},
|
||||
|
||||
// Reset selections when tint changes for the same glass to ensure proper selection.
|
||||
// Also checks if only a single part is present for the tint.
|
||||
ResetTintAndPartSelections() {
|
||||
this.selectedPartNumber = null;
|
||||
this.AutoSelectIfSinglePart();
|
||||
},
|
||||
|
||||
AutoSelectIfSinglePart() {
|
||||
if (this.partsForSelectedTint?.length > 0)
|
||||
{
|
||||
|
|
@ -202,6 +194,9 @@ export default {
|
|||
radioInput?.click();
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.selectedPartNumber = null;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -108,9 +108,7 @@ data() {
|
|||
},
|
||||
computed: {
|
||||
isForwardActionDisabled() {
|
||||
return (
|
||||
this.selectedGlassPartNumbers.length !== this.PartsFromApi.partsOrQuestions.length
|
||||
);
|
||||
return this.selectedGlassPartNumbers.length !== this.PartsFromApi.partsOrQuestions.length
|
||||
},
|
||||
selectedGlassPartNumbers() {
|
||||
// Compile all selected parts from the page.
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="container-fluid pb-2 px-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" class="mb-3" displayGenericVehicleImage />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" :hasBackButton="true" :backButtonAccessibleText="backButtonAccessibleText" @click-event="backButtonAction" />
|
||||
<styleQuestion v-model="selectedStyle" ref="styleQuestion" cmsWidgetName="VehicleStyleQuestion" class="px-4" />
|
||||
<styleQuestion v-model="selectedStyle" ref="styleQuestion" cmsWidgetName="VehicleStyleQuestion" />
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" ref="siteFooter" @back-clicked="backButtonAction" :isForwardButtonHidden="shouldHideForwardButton" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="container-fluid pb-2 px-5">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="true" class="mb-3" />
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" />
|
||||
<yearQuestion class="px-4" v-model="selectedYear" ref="yearQuestion" cmsWidgetName="VehicleYearQuestion" />
|
||||
<yearQuestion v-model="selectedYear" ref="yearQuestion" cmsWidgetName="VehicleYearQuestion" />
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" ref="siteFooter" @back-clicked="backButtonAction" :isForwardButtonHidden="shouldHideForwardButton" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div class="vin-location-information mt-2">
|
||||
<div class="vin-location-information mt-2 mb-3">
|
||||
<div
|
||||
class="vin-toggle"
|
||||
:class="[isVinLocationDetailVisible ? 'active' : '']"
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
<div class="page-container-grouped-styles welcome">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget"/>
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget" class="mt-4"/>
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="row mt-5 px-3">
|
||||
<siteSubHeader cmsWidgetName="SiteSubHeaderWidget"/>
|
||||
<div class="container-fluid px-5">
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<textboxQuestion
|
||||
inputId="policyNumberField"
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
validationRules="policy-number-required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3" v-if="this.displayPolicyZip">
|
||||
<div class="row mt-4 " v-if="this.displayPolicyZip">
|
||||
<div class="col">
|
||||
<textboxQuestion
|
||||
inputId="policyZipCode"
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
ref="policyZip" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<textboxQuestion
|
||||
type="date"
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
<textBlock cmsWidgetName="DamageDateEstimateWidget" typeStyle="small" class="mt-2" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<dropdownQuestion
|
||||
cmsWidgetName="DamageCauseQuestion"
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="row mt-4 ">
|
||||
<div class="col">
|
||||
<textboxQuestion
|
||||
inputId="phoneNumberField"
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
disableAutoFill />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<textboxQuestion
|
||||
inputId="emailField"
|
||||
|
|
@ -88,9 +88,10 @@
|
|||
disableAutoFill />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<textboxQuestion
|
||||
class="mt-4"
|
||||
inputId="damageCityField"
|
||||
cmsWidgetName="DamageCityQuestion"
|
||||
v-model="welcomePageModel.damageCity"
|
||||
|
|
@ -101,9 +102,10 @@
|
|||
validationRules="loss-city-required" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4 px-3">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<dropdownQuestion
|
||||
class="mt-4"
|
||||
cmsWidgetName="DamageStateQuestion"
|
||||
v-model="welcomePageModel.damageState"
|
||||
ref="state"
|
||||
|
|
@ -118,9 +120,9 @@
|
|||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="row mb-3">
|
||||
<buttonQuestion
|
||||
class="px-0"
|
||||
class="px-0 mt-4"
|
||||
cmsWidgetName="GlassOnlyQuestion"
|
||||
v-model="welcomePageModel.isDamageGlassOnly"
|
||||
inputId = "isDamageGlassOnly"
|
||||
|
|
@ -134,7 +136,7 @@
|
|||
v-if="this.displayGlassOnlyQuestion"
|
||||
disableAutoFill/>
|
||||
</div>
|
||||
<div class="row mt-4 position-sticky top-100" id="welcomeFooter">
|
||||
<div class="row position-sticky top-100" id="welcomeFooter">
|
||||
<div class="col">
|
||||
<site-footer
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
|
|
@ -320,7 +322,9 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.page-container-grouped-styles.welcome {
|
||||
height: auto;
|
||||
}
|
||||
@-moz-document url-prefix() {
|
||||
// Temporary solution that prevents the Continue button from being hidden in Firefox
|
||||
#welcomeFooter {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { endpoints } from "@/constants/endpoints.js";
|
||||
import { getDateForSavedSessionTimeout } from "@/helpers/session-helper";
|
||||
import globalMethods from "@/global-methods";
|
||||
import { experimentTriggers } from "@/constants/experiments";
|
||||
import { applicationConfig } from "@/constants/application-config";
|
||||
import { issPageValues } from "@/router/router-constants/issPage-values";
|
||||
import { damageLocationsSelected } from "@/constants/damage-locations-selected";
|
||||
import { defineStore } from 'pinia';
|
||||
import { endpoints } from '@/constants/endpoints.js';
|
||||
import { getDateForSavedSessionTimeout } from '@/helpers/session-helper';
|
||||
import globalMethods from '@/global-methods';
|
||||
import { experimentTriggers } from '@/constants/experiments';
|
||||
import { applicationConfig } from '@/constants/application-config';
|
||||
import { issPageValues } from '@/router/router-constants/issPage-values';
|
||||
import { damageLocationsSelected } from '@/constants/damage-locations-selected';
|
||||
|
||||
const storeId = 'main';
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ const getDefaultState = () => {
|
|||
damageCause: null,
|
||||
damageState: null,
|
||||
damageCity: null,
|
||||
isDamageGlassOnly: null,
|
||||
isDamageGlassOnly: null
|
||||
},
|
||||
customer: {
|
||||
address: {
|
||||
|
|
@ -96,9 +96,9 @@ const getDefaultState = () => {
|
|||
triggeredSiteEntry: false
|
||||
},
|
||||
issConfig: {
|
||||
clientName: "Generic Insurance", // this is the default and will be overriden by the client's name
|
||||
clientDisplayName: "Generic Insurance", // this is the default and will be overridden by the client's name or client display name.
|
||||
styleSheet: "",
|
||||
clientName: 'Generic Insurance', // this is the default and will be overriden by the client's name
|
||||
clientDisplayName: 'Generic Insurance', // this is the default and will be overridden by the client's name or client display name.
|
||||
styleSheet: '',
|
||||
accountNumber: 0,
|
||||
isCoverageEnabled: false, // Indicates if we should be calling coverage on this flow.
|
||||
isAuthenticated: false, // Indicates if user is authenticated or not.
|
||||
|
|
@ -145,10 +145,10 @@ export const useMainStore = defineStore({
|
|||
streetAddress: registration.address,
|
||||
city: registration.city,
|
||||
state: registration.state,
|
||||
zipCode: registration.zipCode,
|
||||
zipCode: registration.zipCode
|
||||
},
|
||||
firstName: registration.firstName,
|
||||
lastName: registration.lastName,
|
||||
lastName: registration.lastName
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -158,10 +158,10 @@ export const useMainStore = defineStore({
|
|||
streetAddress: address.streetAddress,
|
||||
city: address.city,
|
||||
state: address.state,
|
||||
zipCode: address.zipCode,
|
||||
zipCode: address.zipCode
|
||||
},
|
||||
firstName: state.order.customer.firstName,
|
||||
lastName: state.order.customer.lastName,
|
||||
lastName: state.order.customer.lastName
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -183,41 +183,41 @@ export const useMainStore = defineStore({
|
|||
issSelectedMultiGlass: state.order.damage.glassToReplace?.length > 1,
|
||||
issSelectedWindshieldGlass: getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.damage.glassToReplace,
|
||||
"glassLocation"
|
||||
'glassLocation'
|
||||
).includes(damageLocationsSelected.WINDSHIELD),
|
||||
issSelectedBackGlass: getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.damage.glassToReplace,
|
||||
"glassLocation"
|
||||
'glassLocation'
|
||||
).includes(damageLocationsSelected.REAR),
|
||||
issSelectedDriverSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.damage.glassToReplace,
|
||||
"glassLocation"
|
||||
'glassLocation'
|
||||
).includes(damageLocationsSelected.DRIVER),
|
||||
issSelectedPassengerSideGlass: getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.damage.glassToReplace,
|
||||
"glassLocation"
|
||||
'glassLocation'
|
||||
).includes(damageLocationsSelected.PASSENGER),
|
||||
issOrderPartNumbers: [
|
||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
"partNumber"
|
||||
'partNumber'
|
||||
),
|
||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.otherParts,
|
||||
"partNumber"
|
||||
),
|
||||
'partNumber'
|
||||
)
|
||||
],
|
||||
|
||||
issOrderPartTypes: [
|
||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
"recalibrationType"
|
||||
'recalibrationType'
|
||||
),
|
||||
...getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.otherParts,
|
||||
"recalibrationType"
|
||||
),
|
||||
],
|
||||
'recalibrationType'
|
||||
)
|
||||
]
|
||||
};
|
||||
},
|
||||
experimentSettings: (state) => {
|
||||
|
|
@ -249,7 +249,7 @@ export const useMainStore = defineStore({
|
|||
endpoint: endpoints.GetRouteInfo.url(applicationConfig.APPLICATION_ABBREVIATION),
|
||||
payload: {
|
||||
pageName: pageName
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
getHomepageName() {
|
||||
|
|
@ -366,7 +366,8 @@ export const useMainStore = defineStore({
|
|||
|
||||
// PartsOrQuestions API Actions
|
||||
async getPartsOrQuestions() {
|
||||
this.resetGlassPartsState();
|
||||
this.resetPartsAndDependencies();
|
||||
|
||||
const vehicle = this.vehicle;
|
||||
const damage = this.damage;
|
||||
const order = this.order;
|
||||
|
|
@ -461,8 +462,8 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
async getWipers() {
|
||||
const carId = this.order.vehicle.carId;
|
||||
///WARNING
|
||||
///TODO: this is temp test code until serviceLocation is complete.
|
||||
//WARNING
|
||||
//TODO: this is temp test code until serviceLocation is complete.
|
||||
//const serviceZipCode = this.order.serviceLocation.zipCode;
|
||||
const serviceZipCode = '44902';
|
||||
return globalMethods
|
||||
|
|
@ -503,7 +504,7 @@ export const useMainStore = defineStore({
|
|||
endpoint: endpoints.GetSupportingItems.url,
|
||||
payload: {
|
||||
carId: carId,
|
||||
serviceType: isRepair ? 'Repair' : 'Replace',
|
||||
damageType: isRepair ? 'Repair' : 'Replace',
|
||||
parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER,
|
||||
parts: glassPartsArray,
|
||||
numberOfRepairChips: isRepair ? numberOfChips : 0
|
||||
|
|
@ -518,21 +519,21 @@ export const useMainStore = defineStore({
|
|||
getLineItemQueryStringForPricing(availableLineItems);
|
||||
const vehicle = this.order.vehicle;
|
||||
|
||||
///WARNING
|
||||
///TODO: this is temp test code until serviceLocation is complete.
|
||||
/// and ctu is available. Also, EON may need to be implemented.
|
||||
zipCodeToUse = "44902";
|
||||
ctuToUse = "01820";
|
||||
let queryString =
|
||||
//WARNING
|
||||
//TODO: this is temp test code until serviceLocation is complete.
|
||||
// and ctu is available. Also, EON may need to be implemented.
|
||||
zipCodeToUse = '44902';
|
||||
ctuToUse = '01820';
|
||||
const queryString =
|
||||
`ParentAccountNumber=${applicationConfig.CASH_PARENT_ACCOUNT_NUMBER}` +
|
||||
`&CTU=${ctuToUse}` +
|
||||
`&CarId=${vehicle.carId}` +
|
||||
`&Make=${vehicle.make}` +
|
||||
`&Model=${vehicle.model}` +
|
||||
`&Year=${vehicle.year}` +
|
||||
`&EON=0` +
|
||||
`&ZipCode=${zipCodeToUse}` +
|
||||
`${availableLineItemsFormattedForRequest}`;
|
||||
`&CTU=${ctuToUse}` +
|
||||
`&CarId=${vehicle.carId}` +
|
||||
`&Make=${vehicle.make}` +
|
||||
`&Model=${vehicle.model}` +
|
||||
`&Year=${vehicle.year}` +
|
||||
`&EON=0` +
|
||||
`&ZipCode=${zipCodeToUse}` +
|
||||
`${availableLineItemsFormattedForRequest}`;
|
||||
|
||||
|
||||
const response = await globalMethods
|
||||
|
|
@ -544,7 +545,7 @@ export const useMainStore = defineStore({
|
|||
return [];
|
||||
});
|
||||
|
||||
availableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems)
|
||||
availableLineItems = addPricesToLineItems(availableLineItems, response.data.lineItems);
|
||||
|
||||
return availableLineItems;
|
||||
},
|
||||
|
|
@ -555,7 +556,7 @@ export const useMainStore = defineStore({
|
|||
const encodedLineItems = encodeURIComponent(JSON.stringify(lineItemsToSend));
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.GetServiceabilityDetails.method,
|
||||
endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&lineItems=${encodedLineItems}`,
|
||||
endpoint: `${endpoints.GetServiceabilityDetails.url}?zip=${serviceZipCode}&lineItems=${encodedLineItems}`
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -564,8 +565,8 @@ export const useMainStore = defineStore({
|
|||
method: endpoints.LookupVehicleByVin.method,
|
||||
endpoint: endpoints.LookupVehicleByVin.url,
|
||||
payload: {
|
||||
vin,
|
||||
},
|
||||
vin
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -607,7 +608,7 @@ export const useMainStore = defineStore({
|
|||
|
||||
if (isDamageChanging) {
|
||||
//Reset dependent state when changing
|
||||
this.resetGlassPartsState();
|
||||
this.resetPartsAndDependencies();
|
||||
|
||||
// Save new values
|
||||
this.updateIsRepair(isWindshieldRepair);
|
||||
|
|
@ -666,6 +667,8 @@ export const useMainStore = defineStore({
|
|||
this.order.vehicle.imageUrl = vehicle.imageUrl;
|
||||
this.order.vehicle.imageVifNumber = vehicle.imageVifNumber;
|
||||
this.order.vehicle.imageColor = vehicle.imageVifColor;
|
||||
|
||||
this.resetDamagePartsAndDependencies();
|
||||
},
|
||||
|
||||
updateVehicleVin(vin) {
|
||||
|
|
@ -700,7 +703,9 @@ export const useMainStore = defineStore({
|
|||
resetSupportingItemsState() {
|
||||
this.order.lineItems.supportingItems = null;
|
||||
},
|
||||
|
||||
resetVapsState() {
|
||||
this.order.lineItems.vaps = null;
|
||||
},
|
||||
resetDamageState() {
|
||||
this.order.damage.isRepair = null;
|
||||
this.order.damage.numberOfChips = null;
|
||||
|
|
@ -720,8 +725,7 @@ export const useMainStore = defineStore({
|
|||
previouslySelectedPartNumbers !== currentlySelectedPartNumbers;
|
||||
|
||||
if (haveSelectedVehiclePartsChanged) {
|
||||
this.updateGlassParts(null);
|
||||
this.resetSupportingItemsState();
|
||||
this.resetPartsAndDependencies();
|
||||
this.updateMoldingQuestionAnswers(null);
|
||||
this.updateCapabilityQuestionAnswers(null);
|
||||
this.updatePageData({ page: issPageValues.MOLDING_QUESTIONS, data: null});
|
||||
|
|
@ -729,12 +733,11 @@ export const useMainStore = defineStore({
|
|||
}
|
||||
},
|
||||
|
||||
resetISSConfigState()
|
||||
{
|
||||
this.issConfig.clientName = "Generic Insurance";
|
||||
this.issConfig.clientDisplayName = "Generic Insurance";
|
||||
resetISSConfigState() {
|
||||
this.issConfig.clientName = 'Generic Insurance';
|
||||
this.issConfig.clientDisplayName = 'Generic Insurance';
|
||||
this.issConfig.accountNumber = 0;
|
||||
this.issConfig.styleSheet = "";
|
||||
this.issConfig.styleSheet = '';
|
||||
this.issConfig.isCoverageEnabled = false;
|
||||
this.issConfig.isAuthenticated = false;
|
||||
this.issConfig.enableTPAFlow = false;
|
||||
|
|
@ -744,35 +747,36 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
|
||||
updateVehicleYear(year) {
|
||||
if(this.order.vehicle.year != year)
|
||||
if(this.order.vehicle.year !== year)
|
||||
{
|
||||
this.resetVehicleState();
|
||||
this.resetDamageState();
|
||||
this.resetDamagePartsAndDependencies();
|
||||
|
||||
this.order.vehicle.year = year;
|
||||
}
|
||||
},
|
||||
|
||||
updateVehicleMake(make) {
|
||||
if(this.order.vehicle.make != make)
|
||||
if(this.order.vehicle.make !== make)
|
||||
{
|
||||
const year = this.order.vehicle.year;
|
||||
|
||||
this.resetVehicleState();
|
||||
this.resetDamageState();
|
||||
|
||||
this.resetDamagePartsAndDependencies();
|
||||
|
||||
this.order.vehicle.year = year;
|
||||
this.order.vehicle.make = make;
|
||||
}
|
||||
},
|
||||
|
||||
updateVehicleModel(model) {
|
||||
if(this.order.vehicle.model != model)
|
||||
if(this.order.vehicle.model !== model)
|
||||
{
|
||||
const year = this.order.vehicle.year;
|
||||
const make = this.order.vehicle.make;
|
||||
|
||||
this.resetVehicleState();
|
||||
this.resetDamageState();
|
||||
this.resetDamagePartsAndDependencies();
|
||||
|
||||
this.order.vehicle.year = year;
|
||||
this.order.vehicle.make = make;
|
||||
|
|
@ -782,14 +786,14 @@ export const useMainStore = defineStore({
|
|||
|
||||
|
||||
updateVehicleStyle(style) {
|
||||
if(this.order.vehicle.style != style)
|
||||
if(this.order.vehicle.style !== style)
|
||||
{
|
||||
const year = this.order.vehicle.year;
|
||||
const make = this.order.vehicle.make;
|
||||
const model = this.order.vehicle.model;
|
||||
|
||||
this.resetVehicleState();
|
||||
this.resetDamageState();
|
||||
this.resetDamagePartsAndDependencies();
|
||||
|
||||
this.order.vehicle.year = year;
|
||||
this.order.vehicle.make = make;
|
||||
|
|
@ -854,11 +858,11 @@ export const useMainStore = defineStore({
|
|||
// if part question answers have changed, reset subsequent question answers
|
||||
const sortedPreviousResultsArray = sortArrayOfObjectsByPropertyValue(
|
||||
this.order.damage.partQuestionAnswers,
|
||||
"result"
|
||||
'result'
|
||||
);
|
||||
const sortedPartQuestionAnswersArray = sortArrayOfObjectsByPropertyValue(
|
||||
partQuestionAnswersArray,
|
||||
"result"
|
||||
'result'
|
||||
);
|
||||
const havePartQuestionAnswersChanged =
|
||||
sortedPreviousResultsArray?.length !== sortedPartQuestionAnswersArray.length ||
|
||||
|
|
@ -877,15 +881,18 @@ export const useMainStore = defineStore({
|
|||
|
||||
//Save new values
|
||||
this.updatePartQuestionAnswers(partQuestionAnswersArray);
|
||||
|
||||
this.resetSupportingItemsState();
|
||||
this.resetVapsState();
|
||||
},
|
||||
saveMoldingQuestionAnswers(moldingQuestionAnswersArray) {
|
||||
const sortedPreviousResultsArray = sortArrayOfObjectsByPropertyValue(
|
||||
this.order.damage.moldingQuestionAnswers,
|
||||
"result"
|
||||
'result'
|
||||
);
|
||||
const sortedMoldingQuestionAnswersArray = sortArrayOfObjectsByPropertyValue(
|
||||
moldingQuestionAnswersArray,
|
||||
"result"
|
||||
'result'
|
||||
);
|
||||
const haveMoldingQuestionAnswersChanged =
|
||||
sortedPreviousResultsArray?.length !== sortedMoldingQuestionAnswersArray.length ||
|
||||
|
|
@ -894,8 +901,7 @@ export const useMainStore = defineStore({
|
|||
);
|
||||
|
||||
if (haveMoldingQuestionAnswersChanged) {
|
||||
this.updateGlassParts(null);
|
||||
this.updateSupportingItems(null);
|
||||
this.resetPartsAndDependencies();
|
||||
this.updateCapabilityQuestionAnswers(null);
|
||||
this.updatePageData({
|
||||
page: issPageValues.CAPABILITY_QUESTIONS,
|
||||
|
|
@ -910,11 +916,11 @@ export const useMainStore = defineStore({
|
|||
saveCapabilityQuestionAnswers(capabilityQuestionAnswersArray) {
|
||||
const sortedPreviousResultsArray = sortArrayOfObjectsByPropertyValue(
|
||||
this.order.damage.capabilityQuestionAnswers,
|
||||
"result"
|
||||
'result'
|
||||
);
|
||||
const sortedCapabilityQuestionAnswersArray = sortArrayOfObjectsByPropertyValue(
|
||||
capabilityQuestionAnswersArray,
|
||||
"result"
|
||||
'result'
|
||||
);
|
||||
const haveCapabilityQuestionAnswersChanged =
|
||||
sortedPreviousResultsArray?.length !== sortedCapabilityQuestionAnswersArray.length ||
|
||||
|
|
@ -990,21 +996,20 @@ export const useMainStore = defineStore({
|
|||
}
|
||||
});
|
||||
},
|
||||
logPageView({ userId, sessionKey, pageName, sessionId, action, event, shouldUseSessionId, experimentsForUser })
|
||||
{
|
||||
var payload = {
|
||||
userId: userId,
|
||||
sessionKey: sessionKey,
|
||||
sessionId: sessionId,
|
||||
pageName: pageName,
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
action: action,
|
||||
event: event,
|
||||
shouldUseSessionId: shouldUseSessionId,
|
||||
experimentsForUser: experimentsForUser,
|
||||
}
|
||||
logPageView({ userId, sessionKey, pageName, sessionId, action, event, shouldUseSessionId, experimentsForUser }) {
|
||||
const payload = {
|
||||
userId: userId,
|
||||
sessionKey: sessionKey,
|
||||
sessionId: sessionId,
|
||||
pageName: pageName,
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
action: action,
|
||||
event: event,
|
||||
shouldUseSessionId: shouldUseSessionId,
|
||||
experimentsForUser: experimentsForUser
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.LogPageView.method,
|
||||
endpoint: endpoints.LogPageView.url,
|
||||
payload: payload,
|
||||
|
|
@ -1014,27 +1019,27 @@ export const useMainStore = defineStore({
|
|||
return response;
|
||||
},
|
||||
(error) => {
|
||||
console.log("Analytics Service Error: " + error.data);
|
||||
console.log('Analytics Service Error: ' + error.data);
|
||||
}
|
||||
);
|
||||
},
|
||||
logCustomEvent({ userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser})
|
||||
{
|
||||
if ( pageName == null || pageName.length == 0 )
|
||||
pageName = "none";
|
||||
if ( pageName == null || pageName.length === 0 )
|
||||
pageName = 'none';
|
||||
|
||||
var payload = {
|
||||
userId: userId,
|
||||
sessionKey: sessionKey,
|
||||
sessionId: sessionId,
|
||||
pageName: pageName,
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
category: category,
|
||||
action: action,
|
||||
label: label,
|
||||
value: value,
|
||||
shouldUseSessionId: shouldUseSessionId,
|
||||
experimentsForUser: experimentsForUser
|
||||
const payload = {
|
||||
userId: userId,
|
||||
sessionKey: sessionKey,
|
||||
sessionId: sessionId,
|
||||
pageName: pageName,
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
category: category,
|
||||
action: action,
|
||||
label: label,
|
||||
value: value,
|
||||
shouldUseSessionId: shouldUseSessionId,
|
||||
experimentsForUser: experimentsForUser
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
|
|
@ -1047,23 +1052,23 @@ export const useMainStore = defineStore({
|
|||
return response;
|
||||
},
|
||||
(error) => {
|
||||
console.log("Analytics Service Error: " + error.data);
|
||||
console.log('Analytics Service Error: ' + error.data);
|
||||
}
|
||||
);
|
||||
},
|
||||
initializeSession({ userId, sessionId, userAgent, referrer }) {
|
||||
var payload = {
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
userId: userId,
|
||||
deviceId: userId,
|
||||
sessionId: sessionId,
|
||||
userAgent: userAgent,
|
||||
operatorId: "WEB",
|
||||
userName: "SafeliteISS",
|
||||
referrer: referrer
|
||||
};
|
||||
const payload = {
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
userId: userId,
|
||||
deviceId: userId,
|
||||
sessionId: sessionId,
|
||||
userAgent: userAgent,
|
||||
operatorId: 'WEB',
|
||||
userName: 'SafeliteISS',
|
||||
referrer: referrer
|
||||
};
|
||||
|
||||
return globalMethods.callHttpClient({
|
||||
return globalMethods.callHttpClient({
|
||||
method: endpoints.InitializeSession.method,
|
||||
endpoint: endpoints.InitializeSession.url,
|
||||
payload: payload,
|
||||
|
|
@ -1073,7 +1078,7 @@ export const useMainStore = defineStore({
|
|||
return response;
|
||||
},
|
||||
(error) => {
|
||||
console.log("Analytics Service Error: " + error.data);
|
||||
console.log('Analytics Service Error: ' + error.data);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
|
@ -1098,16 +1103,16 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
|
||||
async runExperimentsForTrigger({ userId, triggerEvent, triggerValue }) {
|
||||
if (triggerEvent == experimentTriggers.SITE_ENTRY) {
|
||||
if (triggerEvent === experimentTriggers.SITE_ENTRY) {
|
||||
this.updateTriggeredSiteEntry(true);
|
||||
}
|
||||
|
||||
var payload = {
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
userId: userId,
|
||||
triggerEvent: triggerEvent,
|
||||
triggerValue: triggerValue,
|
||||
experimentOrder: this.experimentOrder
|
||||
const payload = {
|
||||
applicationName: applicationConfig.APPLICATION_NAME,
|
||||
userId: userId,
|
||||
triggerEvent: triggerEvent,
|
||||
triggerValue: triggerValue,
|
||||
experimentOrder: this.experimentOrder
|
||||
};
|
||||
|
||||
const response = await globalMethods.callHttpClient({
|
||||
|
|
@ -1152,8 +1157,7 @@ export const useMainStore = defineStore({
|
|||
this.resetRegistrationAndDependencies();
|
||||
|
||||
if (!isSelectedGlassAvailableForVehicle) {
|
||||
this.resetDamageAndDependencies();
|
||||
this.resetPartsAndDependencies();
|
||||
this.resetDamageState();
|
||||
}
|
||||
|
||||
//Save new values
|
||||
|
|
@ -1168,8 +1172,7 @@ export const useMainStore = defineStore({
|
|||
this.resetRegistrationAndDependencies();
|
||||
|
||||
if (!isSelectedGlassAvailableForVehicle) {
|
||||
this.resetDamageAndDependencies();
|
||||
this.resetPartsAndDependencies();
|
||||
this.resetDamageState();
|
||||
}
|
||||
|
||||
//Save new values
|
||||
|
|
@ -1178,42 +1181,40 @@ export const useMainStore = defineStore({
|
|||
},
|
||||
saveRegistrationLicensePlateLookup({ isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo }) {
|
||||
//Reset dependent state when changing
|
||||
if
|
||||
(
|
||||
registrationInfo?.licensePlate !== this.order.vehicle.registration?.licensePlate ||
|
||||
registrationInfo?.state !== this.order.vehicle.registration?.state
|
||||
)
|
||||
if (registrationInfo?.licensePlate !== this.order.vehicle.registration?.licensePlate ||
|
||||
registrationInfo?.state !== this.order.vehicle.registration?.state)
|
||||
{
|
||||
this.resetRegistrationAndDependencies();
|
||||
|
||||
if (!isSelectedGlassAvailableForVehicle) {
|
||||
this.resetDamageAndDependencies();
|
||||
this.resetPartsAndDependencies();
|
||||
this.resetDamageState();
|
||||
}
|
||||
|
||||
//Save new values
|
||||
this.updateVehicle(vehicleInfo);
|
||||
}
|
||||
}
|
||||
|
||||
this.updateRegistration(registrationInfo);
|
||||
},
|
||||
this.updateRegistration(registrationInfo);
|
||||
},
|
||||
|
||||
resetRegistrationAndDependencies() {
|
||||
this.resetRegistrationState();
|
||||
this.resetGlassPartsState();
|
||||
this.updateSupportingItems(null);
|
||||
this.resetSupportingItemsState();
|
||||
this.resetVapsState();
|
||||
},
|
||||
|
||||
resetDamageAndDependencies() {
|
||||
resetDamagePartsAndDependencies() {
|
||||
this.resetDamageState();
|
||||
this.resetGlassPartsState();
|
||||
this.updateSupportingItems(null);
|
||||
this.updateVaps(null);
|
||||
this.resetSupportingItemsState();
|
||||
this.resetVapsState();
|
||||
},
|
||||
|
||||
resetPartsAndDependencies() {
|
||||
this.resetGlassPartsState();
|
||||
this.updateSupportingItems(null);
|
||||
this.resetSupportingItemsState();
|
||||
this.resetVapsState();
|
||||
}
|
||||
},
|
||||
persist: true
|
||||
|
|
@ -1223,16 +1224,16 @@ export const useMainStore = defineStore({
|
|||
// Private Functions
|
||||
|
||||
function getHasRecalibrationPart(state) {
|
||||
var hasRequiresRecalibration =
|
||||
getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
"requiresRecalibration"
|
||||
)?.length > 0;
|
||||
var hasRecalibrationType =
|
||||
getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
"recalibrationType"
|
||||
)?.length > 0;
|
||||
const hasRequiresRecalibration =
|
||||
getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
'requiresRecalibration'
|
||||
)?.length > 0;
|
||||
const hasRecalibrationType =
|
||||
getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
'recalibrationType'
|
||||
)?.length > 0;
|
||||
|
||||
if (hasRequiresRecalibration) {
|
||||
if (hasRecalibrationType) {
|
||||
|
|
@ -1240,8 +1241,8 @@ function getHasRecalibrationPart(state) {
|
|||
return (
|
||||
getNonFalseValuesOfPropertyInArrayOfObjects(
|
||||
state.order.lineItems.glassParts,
|
||||
"recalibrationType"
|
||||
)[0].toLowerCase() != "unknown"
|
||||
'recalibrationType'
|
||||
)[0].toLowerCase() !== 'unknown'
|
||||
);
|
||||
} else {
|
||||
// Has 'requiresRecalibration' but no 'recalibrationType' at all
|
||||
|
|
@ -1315,9 +1316,9 @@ function getAllPartNumbers(partsOrQuestions) {
|
|||
.map((glass) => glass.parts)
|
||||
.flat()
|
||||
.map((part) => part.partNumber)
|
||||
.filter((partNumber) => !partNumber.toUpperCase().includes("FEE"))
|
||||
.filter((partNumber) => !partNumber.toUpperCase().includes('FEE'))
|
||||
.sort()
|
||||
.join(",")
|
||||
.join(',')
|
||||
: [];
|
||||
}
|
||||
|
||||
|
|
@ -1325,14 +1326,14 @@ function addPricesToLineItems(lineItems, pricingLineItems) {
|
|||
lineItems.forEach((lineItem) => {
|
||||
const lineItemIndex = pricingLineItems.findIndex(
|
||||
(pricingLineItem) => pricingLineItem.partNumber === lineItem.partNumber
|
||||
)
|
||||
);
|
||||
if (lineItem.childParts) {
|
||||
addPricesToLineItems(lineItem.childParts, pricingLineItems)
|
||||
addPricesToLineItems(lineItem.childParts, pricingLineItems);
|
||||
}
|
||||
const pricedLineItem = pricingLineItems.splice(lineItemIndex, 1)[0]
|
||||
lineItem.laborAmount = pricedLineItem.laborAmount
|
||||
lineItem.sellingPrice = pricedLineItem.sellingPrice
|
||||
lineItem.kitPrice = pricedLineItem.kitPrice
|
||||
const pricedLineItem = pricingLineItems.splice(lineItemIndex, 1)[0];
|
||||
lineItem.laborAmount = pricedLineItem.laborAmount;
|
||||
lineItem.sellingPrice = pricedLineItem.sellingPrice;
|
||||
lineItem.kitPrice = pricedLineItem.kitPrice;
|
||||
});
|
||||
return lineItems;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ body {
|
|||
}
|
||||
// Scroll page when modal isn't open
|
||||
.fade-on-route-transition {
|
||||
height: calc(100% - 80px);
|
||||
height: calc(100% - 10px);
|
||||
overflow: auto;
|
||||
}
|
||||
// Prevent scroll when modal is open
|
||||
|
|
|
|||
Loading…
Reference in a new issue