Fixed weird formatting / duplicates and added QA var's
This commit is contained in:
parent
484f1eed71
commit
eb1843d7c0
2 changed files with 306 additions and 360 deletions
|
|
@ -121,4 +121,7 @@ stages:
|
||||||
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
__VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__)
|
||||||
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
__VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__)
|
||||||
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
__VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__)
|
||||||
|
indexDeployVariables:
|
||||||
|
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||||
|
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||||
cfDistributionId: $(cfDistributionId)
|
cfDistributionId: $(cfDistributionId)
|
||||||
|
|
@ -1,106 +1,35 @@
|
||||||
<template>
|
<template>
|
||||||
<Form
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
@submit="onSubmit"
|
<div class="container-fluid shadow rounded-3 p-2 position-relative make-tall px-5">
|
||||||
@invalid-submit="onInvalidSubmit"
|
|
||||||
ref="theForm"
|
|
||||||
v-slot="{ meta }"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="container-fluid shadow rounded-3 p-2 position-relative make-tall px-5"
|
|
||||||
>
|
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" />
|
<funnelHeader cmsWidgetName="FunnelHeaderWidget" />
|
||||||
<vehicleBanner
|
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="false" />
|
||||||
cmsWidgetName="VehicleBannerWidget"
|
|
||||||
:displayGenericVehicleImage="false"
|
|
||||||
/>
|
|
||||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textboxQuestion
|
<textboxQuestion cmsWidgetName="LicensePlateNumber" v-model="licensePlate" isRequired inputId="license_plate" validationRules="license-plate-required" />
|
||||||
cmsWidgetName="LicensePlateNumber"
|
|
||||||
v-model="licensePlate"
|
|
||||||
isRequired
|
|
||||||
inputId="license_plate"
|
|
||||||
validationRules="license-plate-required"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textboxQuestion
|
<textboxQuestion cmsWidgetName="RegistrationZip" v-model="registrationZip" inputId="zip" mask="#####" validationRules="zip-required" />
|
||||||
cmsWidgetName="RegistrationZip"
|
|
||||||
v-model="registrationZip"
|
|
||||||
inputId="zip"
|
|
||||||
mask="#####"
|
|
||||||
validationRules="zip-required"
|
|
||||||
/>
|
|
||||||
<textboxQuestion
|
|
||||||
cmsWidgetName="RegistrationZip"
|
|
||||||
v-model="registrationZip"
|
|
||||||
isRequired
|
|
||||||
inputId="zip"
|
|
||||||
mask="#####"
|
|
||||||
validationRules="zip-required"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textboxQuestion
|
<textboxQuestion cmsWidgetName="EmailAddress" v-model="email" inputId="email" validationRules="email-address-required|email-address-format" />
|
||||||
cmsWidgetName="EmailAddress"
|
|
||||||
v-model="email"
|
|
||||||
inputId="email"
|
|
||||||
validationRules="email-address-required|email-address-format"
|
|
||||||
/>
|
|
||||||
<textboxQuestion
|
|
||||||
cmsWidgetName="EmailAddress"
|
|
||||||
v-model="email"
|
|
||||||
isRequired
|
|
||||||
inputId="email"
|
|
||||||
validationRules="email-address-required|email-address-format"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<alert
|
<alert class="my-3" :manualHeadline="NoServiceZipHeader" :manualCopy="NoServiceZipBody" v-if="!isRegistrationZipServicable && isVinValid && !isCarIdDifferent" alertClass="alert-danger" />
|
||||||
class="my-3"
|
|
||||||
:manualHeadline="NoServiceZipHeader"
|
|
||||||
:manualCopy="NoServiceZipBody"
|
|
||||||
v-if="!isRegistrationZipServicable && isVinValid && !isCarIdDifferent"
|
|
||||||
alertClass="alert-danger"
|
|
||||||
/>
|
|
||||||
<div class="row my-2">
|
<div class="row my-2">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<textboxQuestion
|
<textboxQuestion v-if="!isRegistrationZipServicable" cmsWidgetName="ServiceZip" v-model="serviceZip" inputId="serviceZip" validationRules="zip-required" />
|
||||||
v-if="!isRegistrationZipServicable"
|
|
||||||
cmsWidgetName="ServiceZip"
|
|
||||||
v-model="serviceZip"
|
|
||||||
inputId="serviceZip"
|
|
||||||
validationRules="zip-required"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<alert
|
<alert class="my-3" cmsWidgetName="NoMatchAlertWidget" v-if="!isVinValid" alertClass="alert-danger" />
|
||||||
class="my-3"
|
<alert class="my-3" :manualHeadline="MatchedDifferentVehicleAlertHeader" :manualCopy="MatchedDifferentVehicleAlertBody" v-if="isCarIdDifferent" alertClass="alert-warning" />
|
||||||
cmsWidgetName="NoMatchAlertWidget"
|
<funnelFooter ref="funnelFooter" cmsWidgetName="FunnelFooterWidget" :isForwardActionDisabled="!meta.valid" @back-clicked="backButtonAction" @ForwardClicked="forwardButtonAction" />
|
||||||
v-if="!isVinValid"
|
|
||||||
alertClass="alert-danger"
|
|
||||||
/>
|
|
||||||
<alert
|
|
||||||
class="my-3"
|
|
||||||
:manualHeadline="MatchedDifferentVehicleAlertHeader"
|
|
||||||
:manualCopy="MatchedDifferentVehicleAlertBody"
|
|
||||||
v-if="isCarIdDifferent"
|
|
||||||
alertClass="alert-warning"
|
|
||||||
/>
|
|
||||||
<funnelFooter
|
|
||||||
ref="funnelFooter"
|
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
|
||||||
:isForwardActionDisabled="!meta.valid"
|
|
||||||
@back-clicked="backButtonAction"
|
|
||||||
@ForwardClicked="forwardButtonAction"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -113,20 +42,38 @@ import alert from "@/ux-components/alert/alert";
|
||||||
import textboxQuestion from "@/common-components/textbox-question/textbox-question";
|
import textboxQuestion from "@/common-components/textbox-question/textbox-question";
|
||||||
|
|
||||||
// Supporting files
|
// Supporting files
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import {
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
fetchCmsContentForPage
|
||||||
|
} from "@/helpers/cms-content-helper";
|
||||||
|
import {
|
||||||
|
settleAllPromises
|
||||||
|
} from "@/helpers/layout-helper";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import {
|
||||||
import { storeMutations } from "@/constants/store-mutations";
|
storeActions
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
} from "@/constants/store-actions";
|
||||||
|
import {
|
||||||
|
storeMutations
|
||||||
|
} from "@/constants/store-mutations";
|
||||||
|
import {
|
||||||
|
errorMessages
|
||||||
|
} from "@/constants/error-messages";
|
||||||
import {
|
import {
|
||||||
getDamageString,
|
getDamageString,
|
||||||
isGlassAvailableForCarId,
|
isGlassAvailableForCarId,
|
||||||
} from "@/helpers/damage-helper";
|
} from "@/helpers/damage-helper";
|
||||||
import { required, regex } from "@/helpers/validation-rules";
|
import {
|
||||||
import { Form, defineRule } from "vee-validate";
|
required,
|
||||||
import { navigateAfterSaveToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
regex
|
||||||
|
} from "@/helpers/validation-rules";
|
||||||
|
import {
|
||||||
|
Form,
|
||||||
|
defineRule
|
||||||
|
} from "vee-validate";
|
||||||
|
import {
|
||||||
|
navigateAfterSaveToHeritageFunnel
|
||||||
|
} from "@/helpers/heritage-integration/navigation-helper";
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule(
|
defineRule(
|
||||||
|
|
@ -153,12 +100,10 @@ export default {
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage);
|
||||||
|
|
||||||
// Settle promises and get results
|
// Settle promises and get results
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [{
|
||||||
{
|
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
}, ];
|
||||||
];
|
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
|
|
@ -259,16 +204,16 @@ export default {
|
||||||
getEmailFromStore() {
|
getEmailFromStore() {
|
||||||
return store.getters.order.customer.emailAddress;
|
return store.getters.order.customer.emailAddress;
|
||||||
},
|
},
|
||||||
getServiceZipFromStore(){
|
getServiceZipFromStore() {
|
||||||
return store.getters.order.serviceLocation.zipCode
|
return store.getters.order.serviceLocation.zipCode
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
this.$router.navigate(this.navigationScenarios.CLICKED_BACK, this.$route);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const zipValidation = this.serviceZip
|
const zipValidation = this.serviceZip ?
|
||||||
? await this.validateZip(this.serviceZip)
|
await this.validateZip(this.serviceZip) :
|
||||||
: await this.validateZip(this.registrationZip);
|
await this.validateZip(this.registrationZip);
|
||||||
if (!zipValidation.data.isServiceable) {
|
if (!zipValidation.data.isServiceable) {
|
||||||
this.$refs.funnelFooter.removeLoader();
|
this.$refs.funnelFooter.removeLoader();
|
||||||
this.isVinValid = true;
|
this.isVinValid = true;
|
||||||
|
|
@ -313,13 +258,9 @@ export default {
|
||||||
);
|
);
|
||||||
|
|
||||||
const partsData = await baseMixin.methods.dispatchStoreAction(
|
const partsData = await baseMixin.methods.dispatchStoreAction(
|
||||||
this.storeActions.GET_PARTS_OR_QUESTIONS,
|
this.storeActions.GET_PARTS_OR_QUESTIONS, {
|
||||||
{
|
|
||||||
carId: vinLookup.data.vehicle.carId,
|
carId: vinLookup.data.vehicle.carId,
|
||||||
glassArray:
|
glassArray: this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle ? [] : store.getters.damage.glassToReplace,
|
||||||
this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle
|
|
||||||
? []
|
|
||||||
: store.getters.damage.glassToReplace,
|
|
||||||
zipCode: this.serviceZip ? this.serviceZip : this.registrationZip,
|
zipCode: this.serviceZip ? this.serviceZip : this.registrationZip,
|
||||||
vin: vinLookup.data.vin,
|
vin: vinLookup.data.vin,
|
||||||
},
|
},
|
||||||
|
|
@ -331,9 +272,9 @@ export default {
|
||||||
if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) {
|
if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) {
|
||||||
this.$router.navigateAfterSave(
|
this.$router.navigateAfterSave(
|
||||||
this.navigationScenarios.CLICKED_FORWARD,
|
this.navigationScenarios.CLICKED_FORWARD,
|
||||||
this.$route,
|
this.$route, {}, {
|
||||||
{},
|
displayVehicleChangeAlert: true
|
||||||
{ displayVehicleChangeAlert: true },
|
},
|
||||||
partsData.data
|
partsData.data
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|
@ -349,8 +290,10 @@ export default {
|
||||||
},
|
},
|
||||||
lookupVin(plate, state) {
|
lookupVin(plate, state) {
|
||||||
return baseMixin.methods.dispatchStoreAction(
|
return baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.LOOKUP_VIN_BY_PLATE,
|
storeActions.LOOKUP_VIN_BY_PLATE, {
|
||||||
{ licensePlate: plate, licenseState: state }
|
licensePlate: plate,
|
||||||
|
licenseState: state
|
||||||
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
updateCustomerInfo(vin, vehicleInfo, registrationState) {
|
updateCustomerInfo(vin, vehicleInfo, registrationState) {
|
||||||
|
|
@ -363,11 +306,11 @@ export default {
|
||||||
store.commit(storeMutations.UPDATE_MODEL, vehicleInfo.model);
|
store.commit(storeMutations.UPDATE_MODEL, vehicleInfo.model);
|
||||||
store.commit(storeMutations.UPDATE_STYLE, vehicleInfo.style);
|
store.commit(storeMutations.UPDATE_STYLE, vehicleInfo.style);
|
||||||
store.commit(storeMutations.UPDATE_CAR_ID, vehicleInfo.carId);
|
store.commit(storeMutations.UPDATE_CAR_ID, vehicleInfo.carId);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY,vehicleInfo.category);
|
store.commit(storeMutations.UPDATE_VEHICLE_CATEGORY, vehicleInfo.category);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL,vehicleInfo.imageUrl);
|
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_URL, vehicleInfo.imageUrl);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER,vehicleInfo.imageVifNumber);
|
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_VIF_NUMBER, vehicleInfo.imageVifNumber);
|
||||||
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR,vehicleInfo.imageColor);
|
store.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, vehicleInfo.imageColor);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE,this.licensePlate);
|
store.commit(storeMutations.UPDATE_REGISTRATION_LICENSE_PLATE, this.licensePlate);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, registrationState);
|
store.commit(storeMutations.UPDATE_REGISTRATION_STATE, registrationState);
|
||||||
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.registrationZip);
|
store.commit(storeMutations.UPDATE_REGISTRATION_ZIP_CODE, this.registrationZip);
|
||||||
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip);
|
store.commit(storeMutations.UPDATE_SERVICE_LOCATION_ZIP_CODE, this.serviceZip);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue