Merge remote-tracking branch 'origin/develop' into feature/CASH-2572
This commit is contained in:
commit
270207ec28
42 changed files with 1521 additions and 109 deletions
|
|
@ -12,7 +12,6 @@ const environmentVariables = {
|
||||||
['__VUE_APP_MY_ACCOUNT__']: "https://myaccountdev.safelite.com/",
|
['__VUE_APP_MY_ACCOUNT__']: "https://myaccountdev.safelite.com/",
|
||||||
['__VUE_APP_SAFELITE_HOP__']: "https://sv2-safelitehop-dev.safelite.com/fmgCheckoutShared.aspx",
|
['__VUE_APP_SAFELITE_HOP__']: "https://sv2-safelitehop-dev.safelite.com/fmgCheckoutShared.aspx",
|
||||||
['__VUE_APP_SESSION_TIMEOUT_MINUTES__']: 30,
|
['__VUE_APP_SESSION_TIMEOUT_MINUTES__']: 30,
|
||||||
['__VUE_APP_SOLARWINDS_MONITORING_SCRIPT__']: "",
|
|
||||||
['__VUE_APP_ADYEN_ENVIRONMENT__']: "test",
|
['__VUE_APP_ADYEN_ENVIRONMENT__']: "test",
|
||||||
['__VUE_APP_ADYEN_CLIENT_KEY__']: "test_WYGT4F5ZT5BRRL5MPWHK6QLYOIXZXROD",
|
['__VUE_APP_ADYEN_CLIENT_KEY__']: "test_WYGT4F5ZT5BRRL5MPWHK6QLYOIXZXROD",
|
||||||
['__VUE_APP_SESSION_EXPIRATION_INTERVAL_CHECK_MILLISECONDS__']: 60000,
|
['__VUE_APP_SESSION_EXPIRATION_INTERVAL_CHECK_MILLISECONDS__']: 60000,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,5 @@
|
||||||
|
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
<!-- built files will be auto injected -->
|
<!-- built files will be auto injected -->
|
||||||
|
|
||||||
<%= process.env.__VUE_APP_SOLARWINDS_MONITORING_SCRIPT__ %>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ const errorMessages = {
|
||||||
DAMAGE_TYPES_REQUIRED: "How damage occurred is required",
|
DAMAGE_TYPES_REQUIRED: "How damage occurred is required",
|
||||||
ZIP_CODE_REQUIRED: "Please enter your ZIP code",
|
ZIP_CODE_REQUIRED: "Please enter your ZIP code",
|
||||||
ZIP_CODE_FORMAT: "Zip must be 5 digits",
|
ZIP_CODE_FORMAT: "Zip must be 5 digits",
|
||||||
|
DATE_OF_BIRTH_REQUIRED: "Please enter your date of birth",
|
||||||
|
LOSS_TIME_REQUIRED: "Please enter your loss time",
|
||||||
|
LOSS_LOCATION_REQUIRED: "Please select your loss location",
|
||||||
|
SUBROGATION_REQUIRED: "Please make a selection",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { errorMessages };
|
export { errorMessages };
|
||||||
|
|
|
||||||
|
|
@ -85,3 +85,8 @@ export const parentAccountNumbers = {
|
||||||
export const NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS = [
|
export const NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS = [
|
||||||
{ name: "KentuckyFarmBureau", value: "223499" },
|
{ name: "KentuckyFarmBureau", value: "223499" },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const PARENT_ACCOUNT_NUMBERS = {
|
||||||
|
STATE_FARM: "711310",
|
||||||
|
USAA: "900040",
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ const storeMutations = {
|
||||||
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
|
UPDATE_VEHICLE_CAN_SAFELITE_SERVICE: "updateVehicleCanSafeliteService",
|
||||||
UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup",
|
UPDATE_SKIP_VIN_LOOKUP: "updateSkipVINLookup",
|
||||||
UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions",
|
UPDATE_SKIP_PART_QUESTIONS: "updateSkipPartQuestions",
|
||||||
|
UPDATE_VIN_REQUIRED: "updateVinRequired",
|
||||||
|
|
||||||
UPDATE_IS_REPAIR: "updateIsRepair",
|
UPDATE_IS_REPAIR: "updateIsRepair",
|
||||||
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
UPDATE_NUMBER_OF_CHIPS: "updateNumberOfChips",
|
||||||
|
|
@ -147,6 +148,9 @@ const storeMutations = {
|
||||||
|
|
||||||
//Affiliate Cookies
|
//Affiliate Cookies
|
||||||
UPDATE_AFFILIATE_COOKIES: "updateAffiliateCookies",
|
UPDATE_AFFILIATE_COOKIES: "updateAffiliateCookies",
|
||||||
|
|
||||||
|
// Submitted state (invalidates getters that read sessionStorage submittedState)
|
||||||
|
INCREMENT_SUBMITTED_STATE_REVISION: "incrementSubmittedStateRevision",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { storeMutations };
|
export { storeMutations };
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@
|
||||||
:min-date="minDate"
|
:min-date="minDate"
|
||||||
:max-date="maxDate"
|
:max-date="maxDate"
|
||||||
:auto-apply="autoApply"
|
:auto-apply="autoApply"
|
||||||
:text-input="textInput"
|
:text-input="resolvedTextInput"
|
||||||
|
:hide-input-icon="textInputOnly"
|
||||||
:prevent-min-max-navigation="preventMinMaxNavigation"
|
:prevent-min-max-navigation="preventMinMaxNavigation"
|
||||||
:teleport="true"
|
:teleport="true"
|
||||||
:aria-labels="{ input: questionText }"
|
:aria-labels="{ input: questionText }"
|
||||||
|
|
@ -107,6 +108,12 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
// Force manual entry: text input enabled, calendar popup never opens
|
||||||
|
// and the calendar icon is hidden.
|
||||||
|
textInputOnly: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
preventMinMaxNavigation: {
|
preventMinMaxNavigation: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
@ -155,7 +162,7 @@ export default {
|
||||||
questionText() {
|
questionText() {
|
||||||
if (!this.cmsWidgetName) return "";
|
if (!this.cmsWidgetName) return "";
|
||||||
const text = this.getCmsContent
|
const text = this.getCmsContent
|
||||||
? this.getCmsContent(this.cmsWidgetName, "BodyText")
|
? this.getCmsContent(this.cmsWidgetName, "QuestionText")
|
||||||
: "";
|
: "";
|
||||||
return this.addOptionalText ? `${text} (optional)` : text;
|
return this.addOptionalText ? `${text} (optional)` : text;
|
||||||
},
|
},
|
||||||
|
|
@ -193,6 +200,15 @@ export default {
|
||||||
clearable: this.clearable,
|
clearable: this.clearable,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
// Forwarded to VueDatePicker's `text-input` prop. When `textInputOnly`
|
||||||
|
// is set, force text input on AND tell the picker never to open its
|
||||||
|
// menu (so focus/click on the input is a no-op visually).
|
||||||
|
resolvedTextInput() {
|
||||||
|
if (this.textInputOnly) {
|
||||||
|
return { enabled: true, openMenu: false };
|
||||||
|
}
|
||||||
|
return this.textInput;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onDateChange(newValue) {
|
onDateChange(newValue) {
|
||||||
|
|
|
||||||
|
|
@ -907,7 +907,7 @@ export default {
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
isCashItacNoComp() {
|
isCashItacNoComp() {
|
||||||
return !this.isInsurance || this.isITAC || this.isNoComp;
|
return !this.isInsurance || this.isItac || this.isNoComp;
|
||||||
},
|
},
|
||||||
mobileFeeCartItemName() {
|
mobileFeeCartItemName() {
|
||||||
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
||||||
|
|
@ -971,7 +971,7 @@ export default {
|
||||||
const msrFeeLineItem = this.getMsrFeeLineItem;
|
const msrFeeLineItem = this.getMsrFeeLineItem;
|
||||||
const shouldCreateMsrFeeCartItem =
|
const shouldCreateMsrFeeCartItem =
|
||||||
this.isMSRFeeApplicable &&
|
this.isMSRFeeApplicable &&
|
||||||
(!this.isInsurance || !this.IsMSRFeeCoveredByInsurance) &&
|
(this.isCashItacNoComp || !this.IsMSRFeeCoveredByInsurance) &&
|
||||||
msrFeeLineItem &&
|
msrFeeLineItem &&
|
||||||
this.msrFeeAmount > 0;
|
this.msrFeeAmount > 0;
|
||||||
|
|
||||||
|
|
@ -1007,9 +1007,10 @@ export default {
|
||||||
return this.getCmsContent("RecycleTextBlock", "Text");
|
return this.getCmsContent("RecycleTextBlock", "Text");
|
||||||
},
|
},
|
||||||
msrToolTipBodyText() {
|
msrToolTipBodyText() {
|
||||||
let cmsContentText = this.isInsurance
|
let cmsContentText =
|
||||||
? this.getCmsContent("MSRModal", "BodyText")
|
this.isInsurance && !this.isItac && !this.isNoComp
|
||||||
: this.getCmsContent("MSRModal", "BodyText2");
|
? this.getCmsContent("MSRModal", "BodyText")
|
||||||
|
: this.getCmsContent("MSRModal", "BodyText2");
|
||||||
if (this.isInsurance && cmsContentText) {
|
if (this.isInsurance && cmsContentText) {
|
||||||
cmsContentText = cmsContentText.replaceAll(
|
cmsContentText = cmsContentText.replaceAll(
|
||||||
"{custom:mobileFee}",
|
"{custom:mobileFee}",
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="container d-flex">
|
<div class="container d-flex">
|
||||||
<div class="site-logo">
|
<div class="site-logo">
|
||||||
<a href="https://safelite.com">
|
<a
|
||||||
<img class="logo-image img-fluid" :src="imageSrc" alt="Safelite logo" />
|
:href="overrideImageSrc ? null : 'https://safelite.com'"
|
||||||
|
:class="{ 'pe-none': !!overrideImageSrc }"
|
||||||
|
:tabindex="overrideImageSrc ? -1 : null"
|
||||||
|
:aria-disabled="!!overrideImageSrc"
|
||||||
|
@click="overrideImageSrc && $event.preventDefault()">
|
||||||
|
<img
|
||||||
|
class="logo-image img-fluid"
|
||||||
|
:class="{ 'logo-image--override': !!overrideImageSrc }"
|
||||||
|
:src="imageSrc"
|
||||||
|
alt="Safelite logo" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="button-container webchat">
|
<div class="button-container webchat">
|
||||||
|
|
@ -69,6 +78,10 @@ export default {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
overrideImageSrc: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
const { webchatGlobalNonpersistedState, launchWebchat } = webchatHelper();
|
const { webchatGlobalNonpersistedState, launchWebchat } = webchatHelper();
|
||||||
|
|
@ -76,7 +89,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
imageSrc() {
|
imageSrc() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "LogoImage");
|
return this.overrideImageSrc || this.getCmsContent(this.cmsWidgetName, "LogoImage");
|
||||||
},
|
},
|
||||||
shouldShowWebchatButton() {
|
shouldShowWebchatButton() {
|
||||||
return this.webchatGlobalNonpersistedState.showWebchatButton;
|
return this.webchatGlobalNonpersistedState.showWebchatButton;
|
||||||
|
|
@ -199,6 +212,13 @@ export default {
|
||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(md) {
|
||||||
width: 165px;
|
width: 165px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&--override {
|
||||||
|
width: 200px;
|
||||||
|
@include media-breakpoint-up(md) {
|
||||||
|
width: 250px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.webchat {
|
.webchat {
|
||||||
|
|
|
||||||
160
src/fmg-components/insurance-nav-bar/insurance-nav-bar.vue
Normal file
160
src/fmg-components/insurance-nav-bar/insurance-nav-bar.vue
Normal file
|
|
@ -0,0 +1,160 @@
|
||||||
|
<template>
|
||||||
|
<div class="row"></div>
|
||||||
|
<div class="insurance-nav-bar nav-bar container-fluid g-5 my-5 px-0" id="infoBox">
|
||||||
|
<div class="row d-flex justify-content-between align-items-center vw-100">
|
||||||
|
<div v-if="!isCancelButtonHidden" class="col-auto cancel-col py-1 text-break">
|
||||||
|
<textLink
|
||||||
|
linkType="navigation"
|
||||||
|
text="Cancel verification"
|
||||||
|
useLoadingModal
|
||||||
|
@click-event="cancelClick"
|
||||||
|
href="javascript:void(0)"
|
||||||
|
data-bs-target="#footerModal"
|
||||||
|
data-bs-dismiss="modal" />
|
||||||
|
</div>
|
||||||
|
<div class="col d-flex justify-content-end align-items-center forward-group">
|
||||||
|
<div v-if="!isBackButtonHidden" class="link-col py-1 text-break">
|
||||||
|
<textLink
|
||||||
|
linkType="navigation"
|
||||||
|
:text="backLink"
|
||||||
|
useLoadingModal
|
||||||
|
@click-event="linkClick"
|
||||||
|
href="javascript:void(0)"
|
||||||
|
data-bs-target="#footerModal"
|
||||||
|
data-bs-dismiss="modal" />
|
||||||
|
</div>
|
||||||
|
<buttonMain
|
||||||
|
ref="buttonMain"
|
||||||
|
isPrimary
|
||||||
|
:buttonText="overrideButtonText || buttonText"
|
||||||
|
loaderColor="white"
|
||||||
|
:class="isForwardActionDisabled && 'form-test-invalid'"
|
||||||
|
:aria-disabled="isForwardActionDisabled"
|
||||||
|
:isDisabled="isForwardActionDisabled"
|
||||||
|
@click-event="buttonClick"
|
||||||
|
data-bs-target="#footerModal"
|
||||||
|
data-test-id="insurance-nav-bar-main-button"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
v-if="!isSubmitHidden" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import textLink from "@/ux-components/text-link/text-link";
|
||||||
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
|
import analyticsMixin from "@/mixins/analytics-mixin";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "insurance-nav-bar",
|
||||||
|
emits: ["CancelClicked", "BackClicked", "ForwardClicked"],
|
||||||
|
props: {
|
||||||
|
isForwardActionDisabled: Boolean,
|
||||||
|
isBackButtonHidden: { type: Boolean, default: false },
|
||||||
|
isCancelButtonHidden: { type: Boolean, default: false },
|
||||||
|
cmsWidgetName: String,
|
||||||
|
buttonSize: { type: Boolean, default: false },
|
||||||
|
isSubmitHidden: { type: Boolean, default: false },
|
||||||
|
overrideButtonText: String,
|
||||||
|
overrideBackButtonText: String,
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
textLink,
|
||||||
|
buttonMain,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
customButtontext: "",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
unmounted() {
|
||||||
|
document.onkeydown = null;
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
backLink() {
|
||||||
|
return (
|
||||||
|
this.overrideBackButtonText ||
|
||||||
|
this.getCmsContent(this.cmsWidgetName, "BackButtonText")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
buttonText() {
|
||||||
|
return this.customButtontext
|
||||||
|
? this.customButtontext
|
||||||
|
: this.getCmsContent(this.cmsWidgetName, "ForwardButtonText");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
updateButtonText(newText) {
|
||||||
|
this.customButtontext = newText;
|
||||||
|
},
|
||||||
|
removeLoader() {
|
||||||
|
this.$refs.buttonMain.removeLoader();
|
||||||
|
document.onkeydown = function (e) {
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
buttonClick() {
|
||||||
|
//prevent keyboard input after button click
|
||||||
|
document.onkeydown = function (e) {
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
// check session expired and initSession to recreate cookies
|
||||||
|
if (analyticsMixin.methods.sessionExpired()) {
|
||||||
|
this.routeReturnUser();
|
||||||
|
} else {
|
||||||
|
this.$emit("ForwardClicked");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
linkClick() {
|
||||||
|
// check session expired and initSession to recreate cookies
|
||||||
|
if (analyticsMixin.methods.sessionExpired()) {
|
||||||
|
this.routeReturnUser();
|
||||||
|
} else {
|
||||||
|
this.$emit("BackClicked");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancelClick() {
|
||||||
|
// check session expired and initSession to recreate cookies
|
||||||
|
if (analyticsMixin.methods.sessionExpired()) {
|
||||||
|
this.routeReturnUser();
|
||||||
|
} else {
|
||||||
|
this.$emit("CancelClicked");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
routeReturnUser() {
|
||||||
|
this.$router.sendToReturnUser();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.nav-bar {
|
||||||
|
overflow: visible;
|
||||||
|
display: flex;
|
||||||
|
padding: 0;
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
& > .container-fluid {
|
||||||
|
overflow-x: visible; // needed to fix hidden footer on some iphones
|
||||||
|
}
|
||||||
|
.forward-group {
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
@media only screen and (min-width: 340px) {
|
||||||
|
.btn-primary {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -57,6 +57,7 @@ export default {
|
||||||
buttonSize: { type: Boolean, default: false },
|
buttonSize: { type: Boolean, default: false },
|
||||||
isSubmitHidden: { type: Boolean, default: false },
|
isSubmitHidden: { type: Boolean, default: false },
|
||||||
overrideButtonText: String,
|
overrideButtonText: String,
|
||||||
|
overrideBackButtonText: String,
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
textLink,
|
textLink,
|
||||||
|
|
@ -73,7 +74,10 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
backLink() {
|
backLink() {
|
||||||
return this.getCmsContent(this.cmsWidgetName, "BackButtonText");
|
return (
|
||||||
|
this.overrideBackButtonText ||
|
||||||
|
this.getCmsContent(this.cmsWidgetName, "BackButtonText")
|
||||||
|
);
|
||||||
},
|
},
|
||||||
buttonText() {
|
buttonText() {
|
||||||
return this.customButtontext
|
return this.customButtontext
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,15 @@
|
||||||
|
// .NET serializes an unset DateTime as DateTime.MinValue ("0001-01-01T00:00:00").
|
||||||
|
// Treat that as "no date" so it doesn't masquerade as a real, validation-passing value.
|
||||||
|
const DOTNET_MIN_DATE_PREFIX = "0001-01-01";
|
||||||
|
|
||||||
|
export function isDotNetMinDate(value) {
|
||||||
|
return typeof value === "string" && value.startsWith(DOTNET_MIN_DATE_PREFIX);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function normalizeDotNetMinDate(value) {
|
||||||
|
return isDotNetMinDate(value) ? null : value;
|
||||||
|
}
|
||||||
|
|
||||||
export function getDateDifferenceInDays(startDate, endDate) {
|
export function getDateDifferenceInDays(startDate, endDate) {
|
||||||
// Create date objects from the input strings
|
// Create date objects from the input strings
|
||||||
var date1 = new Date(endDate);
|
var date1 = new Date(endDate);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
|
|
@ -81,7 +85,7 @@ import afterpayBreakout from "../payment-method/afterpay-breakout/afterpay-break
|
||||||
import modal from "@/digital-components/modal/modal";
|
import modal from "@/digital-components/modal/modal";
|
||||||
import contentGroupModal from "@/fmg-components/content-group-modal/content-group-modal.vue";
|
import contentGroupModal from "@/fmg-components/content-group-modal/content-group-modal.vue";
|
||||||
import textBlock from "@/digital-components/text-block/text-block.vue";
|
import textBlock from "@/digital-components/text-block/text-block.vue";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
export default {
|
export default {
|
||||||
name: "coverage-statement",
|
name: "coverage-statement",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
|
|
@ -89,6 +93,7 @@ export default {
|
||||||
return {
|
return {
|
||||||
isClaimAndCoverage: this.isClaimAndCoverageFromStore(),
|
isClaimAndCoverage: this.isClaimAndCoverageFromStore(),
|
||||||
isRecalibrationOnOrder: this.isRecalibrationOnOrderFromStore(),
|
isRecalibrationOnOrder: this.isRecalibrationOnOrderFromStore(),
|
||||||
|
clientConfig: {},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
@ -107,15 +112,26 @@ export default {
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`coverage-statement clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -162,6 +178,9 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
deductibleAmount() {
|
deductibleAmount() {
|
||||||
return this.$store.getters.order.policy.currentDeductible;
|
return this.$store.getters.order.policy.currentDeductible;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("duplicate-check.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
@ -55,6 +55,15 @@ function setupMocks() {
|
||||||
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
||||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn((widgetName, fieldName) => {
|
||||||
|
return mockCmsContent?.[widgetName]?.[fieldName] ?? "";
|
||||||
|
}),
|
||||||
|
setCmsContent: jest.fn(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
route: { name: "duplicate-check", query: {}, params: {} },
|
route: { name: "duplicate-check", query: {}, params: {} },
|
||||||
router: {
|
router: {
|
||||||
|
|
@ -62,6 +71,7 @@ function setupMocks() {
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
|
mixins: [mockMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
const wrapper = shallowMount(duplicateCheck, mountOptions);
|
const wrapper = shallowMount(duplicateCheck, mountOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,53 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
<!--
|
|
||||||
... Page code goes here.
|
<textBlock
|
||||||
-->
|
cmsWidgetName="DupCheckPageTitleWidget"
|
||||||
<navbar
|
typeStyle="h1"
|
||||||
|
:customText="pageTitleText"
|
||||||
|
class="mb-5 text-left text-md-left cc-page-title" />
|
||||||
|
|
||||||
|
<textBlock
|
||||||
|
cmsWidgetName="DupCheckPageInstructionsWidget"
|
||||||
|
typeStyle="body"
|
||||||
|
:customText="pageInstructionsText"
|
||||||
|
class="mb-5 text-left text-md-left cc-page-instructions" />
|
||||||
|
|
||||||
|
<buttonQuestion
|
||||||
|
:questionText="existingClaimsQuestionText"
|
||||||
|
:answers="existingClaimsAnswers"
|
||||||
|
class="mb-4"
|
||||||
|
groupName="existingClaimsQuestion"
|
||||||
|
buttonTypeString="listButton"
|
||||||
|
isRequired
|
||||||
|
v-model="existingClaimsSelectedValue" />
|
||||||
|
|
||||||
|
<div class="or-divider mb-4" role="separator" aria-label="or">
|
||||||
|
<span class="or-divider-text">or</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<buttonQuestion
|
||||||
|
:answers="startNewClaimAnswers"
|
||||||
|
class="mb-4"
|
||||||
|
groupName="existingClaimsQuestion"
|
||||||
|
buttonTypeString="listButton"
|
||||||
|
isRequired
|
||||||
|
v-model="startNewClaimSelectedValue" />
|
||||||
|
|
||||||
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,27 +58,38 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
|
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "duplicate-check",
|
name: "duplicate-check",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
|
textBlock,
|
||||||
|
buttonQuestion,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
|
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
|
|
@ -50,14 +97,57 @@ export default {
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`duplicate-check clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
pageTitleText() {
|
||||||
|
return this.getCmsContent("DupCheckPageTitleWidget", "Text");
|
||||||
|
},
|
||||||
|
pageInstructionsText() {
|
||||||
|
return this.getCmsContent("DupCheckPageInstructionsWidget", "Text");
|
||||||
|
},
|
||||||
|
existingClaimsQuestionText() {
|
||||||
|
return this.getCmsContent("ExistingClaimsListWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
existingClaimsAnswers() {
|
||||||
|
return this.getCmsContent("ExistingClaimsListWidget", "Answers");
|
||||||
|
},
|
||||||
|
startNewClaimQuestionText() {
|
||||||
|
return this.getCmsContent("StartNewClaimWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
startNewClaimAnswers() {
|
||||||
|
const answers = this.getCmsContent("StartNewClaimWidget", "Answers");
|
||||||
|
if (!Array.isArray(answers)) return [];
|
||||||
|
return answers.map((answer) => ({
|
||||||
|
buttonLabel: answer.Text,
|
||||||
|
value: answer.Name,
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelButtonAction() {
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
@ -76,3 +166,30 @@ export default {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.cc-page-title {
|
||||||
|
font-size: 20px !important;
|
||||||
|
line-height: 1.325;
|
||||||
|
font-weight: 300;
|
||||||
|
color: $black;
|
||||||
|
}
|
||||||
|
.or-divider {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
color: $gray-600;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
flex: 1;
|
||||||
|
border-bottom: 1px solid $gray-500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.or-divider-text {
|
||||||
|
padding: 0 0.75rem;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
text-transform: lowercase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("endorsements.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
@ -55,13 +55,23 @@ function setupMocks() {
|
||||||
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
||||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn((widgetName, fieldName) => {
|
||||||
|
return mockCmsContent?.[widgetName]?.[fieldName] ?? "";
|
||||||
|
}),
|
||||||
|
setCmsContent: jest.fn(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
route: { name: "duplicate-check", query: {}, params: {} },
|
route: { name: "endorsements", query: {}, params: {} },
|
||||||
router: {
|
router: {
|
||||||
navigate: jest.fn(),
|
navigate: jest.fn(),
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
|
mixins: [mockMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
const wrapper = shallowMount(endorsements, mountOptions);
|
const wrapper = shallowMount(endorsements, mountOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,50 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
<!--
|
|
||||||
... Page code goes here.
|
<textBlock
|
||||||
-->
|
cmsWidgetName="EndorsementsPageAdditionalInfoWidget"
|
||||||
<navbar
|
typeStyle="h1"
|
||||||
|
:customText="endorsementHeading"
|
||||||
|
class="mb-5 text-left text-md-left page-title" />
|
||||||
|
|
||||||
|
<textBlock
|
||||||
|
cmsWidgetName="MoreDetailsWidget"
|
||||||
|
typeStyle="body"
|
||||||
|
:customText="moreDetailsText"
|
||||||
|
class="mb-5 text-left text-md-left page-instructions" />
|
||||||
|
|
||||||
|
<buttonQuestion
|
||||||
|
:questionText="schoolEndorsementQuestionText"
|
||||||
|
:answers="schoolEndorsementAnswers"
|
||||||
|
class="mb-4"
|
||||||
|
groupName="schoolEndorsementQuestion"
|
||||||
|
buttonTypeString="listButton"
|
||||||
|
isRequired
|
||||||
|
v-model="schoolEndorsementSelectedValue" />
|
||||||
|
|
||||||
|
<buttonQuestion
|
||||||
|
:questionText="parkingLotEndorsementQuestionText"
|
||||||
|
:answers="parkingLotEndorsementAnswers"
|
||||||
|
class="mb-4"
|
||||||
|
groupName="parkingLotEndorsementQuestion"
|
||||||
|
buttonTypeString="listButton"
|
||||||
|
isRequired
|
||||||
|
v-model="parkingLotEndorsementSelectedValue" />
|
||||||
|
|
||||||
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,42 +55,91 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||||
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "endorsements",
|
name: "endorsements",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
|
buttonQuestion,
|
||||||
|
textBlock,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`endorsements clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
endorsementHeading() {
|
||||||
|
return this.getCmsContent("EndorsementsPageAdditionalInfoWidget", "Text");
|
||||||
|
},
|
||||||
|
moreDetailsText() {
|
||||||
|
return this.getCmsContent("MoreDetailsWidget", "Text");
|
||||||
|
},
|
||||||
|
schoolEndorsementQuestionText() {
|
||||||
|
return this.getCmsContent("SchoolEndorsmentQuestionWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
schoolEndorsementAnswers() {
|
||||||
|
return this.getCmsContent("SchoolEndorsmentQuestionWidget", "Answers");
|
||||||
|
},
|
||||||
|
parkingLotEndorsementQuestionText() {
|
||||||
|
return this.getCmsContent("ParkingLotQuestionWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
parkingLotEndorsementAnswers() {
|
||||||
|
return this.getCmsContent("ParkingLotQuestionWidget", "Answers");
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelButtonAction() {
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
@ -76,3 +158,18 @@ export default {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss">
|
||||||
|
.page-title {
|
||||||
|
font-size: 20px !important;
|
||||||
|
line-height: 1.325;
|
||||||
|
font-weight: 300;
|
||||||
|
color: $black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-instructions {
|
||||||
|
font-size: 16px !important;
|
||||||
|
font-weight: 400;
|
||||||
|
color: $gray-600;
|
||||||
|
line-height: 1.625;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const zip = store.getters.order.serviceLocation.zipCode;
|
const zip = store.getters.order.serviceLocation.zipCode;
|
||||||
|
const isVinLookupRequired = store.getters.vehicle.vinRequired;
|
||||||
|
|
||||||
var vinByAddressPromise;
|
var vinByAddressPromise;
|
||||||
if (zip) {
|
if (zip) {
|
||||||
|
|
@ -133,8 +134,9 @@ export default {
|
||||||
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0];
|
resultMap.cmsContent.FunnelFooterWidget.ForwardButtonText = forwardTextOption[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var indexToRemove;
|
||||||
if (!zip || resultMap.vinByAddress === false) {
|
if (!zip || resultMap.vinByAddress === false) {
|
||||||
var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||||
(answer) => answer.Name === "HomeAddress"
|
(answer) => answer.Name === "HomeAddress"
|
||||||
);
|
);
|
||||||
if (indexToRemove) {
|
if (indexToRemove) {
|
||||||
|
|
@ -142,6 +144,17 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isVinLookupRequired) {
|
||||||
|
resultMap.cmsContent.FunnelSubHeaderWidget =
|
||||||
|
resultMap.cmsContent.FunnelSubHeaderWidget_VinLookupRequired;
|
||||||
|
indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(
|
||||||
|
(answer) => answer.Name === "Decline"
|
||||||
|
);
|
||||||
|
if (indexToRemove) {
|
||||||
|
resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (store.getters.externalParameterState?.isExternalParameter) {
|
||||||
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
if (store.getters.externalParameterCustomer?.phoneNumber) {
|
||||||
|
|
|
||||||
|
|
@ -182,7 +182,7 @@ export default {
|
||||||
|
|
||||||
await this.dispatchStoreAction(
|
await this.dispatchStoreAction(
|
||||||
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
|
||||||
this.selectedAccount.parentAccountNumber.toString(),
|
Number(this.selectedAccount.parentAccountNumber).toString(),
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("policy-driver.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
|
|
@ -8,10 +12,11 @@
|
||||||
<!--
|
<!--
|
||||||
... Page code goes here.
|
... Page code goes here.
|
||||||
-->
|
-->
|
||||||
<navbar
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,42 +27,69 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "policy-driver",
|
name: "policy-driver",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`policy-driver clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelButtonAction() {
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("policy-info-submitted.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
|
|
@ -8,10 +12,11 @@
|
||||||
<!--
|
<!--
|
||||||
... Page code goes here.
|
... Page code goes here.
|
||||||
-->
|
-->
|
||||||
<navbar
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,42 +27,69 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "policy-info-submitted",
|
name: "policy-info-submitted",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`policy-info-submitted clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelButtonAction() {
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
<template>
|
||||||
|
<div class="more-policy-questions">
|
||||||
|
<buttonQuestion
|
||||||
|
:questionText="questionText"
|
||||||
|
isMultiSelect
|
||||||
|
:answers="answersToDisplay"
|
||||||
|
:groupName="groupName"
|
||||||
|
buttonTypeString="checkbox"
|
||||||
|
isRequired
|
||||||
|
v-model="selectedValues" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||||
|
import store from "@/store";
|
||||||
|
import { PARENT_ACCOUNT_NUMBERS } from "@/constants/insurance";
|
||||||
|
|
||||||
|
const STATE_FARM_ONLY_ANSWER_NAMES = new Set(["ThirdPartyVehicle", "Injuries"]);
|
||||||
|
const HIDDEN_FOR_STATE_FARM_ANSWER_NAMES = new Set(["OtherResponsibleParty"]);
|
||||||
|
// Maps an answer's Name to the CMS widget that supplies a State Farm-specific
|
||||||
|
// label override. The widget's "Text" property replaces the answer's Text.
|
||||||
|
const STATE_FARM_TEXT_OVERRIDES = {
|
||||||
|
AdditionalDamage: "AdditionalDamageStateFarmWidget",
|
||||||
|
Rental: "RentalStateFarmWidget",
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "morePolicyQuestions",
|
||||||
|
props: {
|
||||||
|
modelValue: Array,
|
||||||
|
groupName: String,
|
||||||
|
cmsWidgetName: String,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
questionText() {
|
||||||
|
return this.getCmsContent(this.cmsWidgetName, "QuestionText");
|
||||||
|
},
|
||||||
|
answersFromCms() {
|
||||||
|
return this.getCmsContent(this.cmsWidgetName, "Answers");
|
||||||
|
},
|
||||||
|
isStateFarm() {
|
||||||
|
return (
|
||||||
|
store.getters.order?.payment?.parentAccountNumber?.toString() ===
|
||||||
|
PARENT_ACCOUNT_NUMBERS.STATE_FARM
|
||||||
|
);
|
||||||
|
},
|
||||||
|
stateFarmTextOverrides() {
|
||||||
|
return Object.fromEntries(
|
||||||
|
Object.entries(STATE_FARM_TEXT_OVERRIDES).map(([name, widget]) => [
|
||||||
|
name,
|
||||||
|
this.getCmsContent(widget, "Text"),
|
||||||
|
])
|
||||||
|
);
|
||||||
|
},
|
||||||
|
answersToDisplay() {
|
||||||
|
if (!Array.isArray(this.answersFromCms)) return [];
|
||||||
|
return this.answersFromCms
|
||||||
|
.filter((ans) => {
|
||||||
|
if (STATE_FARM_ONLY_ANSWER_NAMES.has(ans?.Name)) {
|
||||||
|
return this.isStateFarm;
|
||||||
|
}
|
||||||
|
if (HIDDEN_FOR_STATE_FARM_ANSWER_NAMES.has(ans?.Name)) {
|
||||||
|
return !this.isStateFarm;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.map((ans) => {
|
||||||
|
if (!this.isStateFarm) return ans;
|
||||||
|
const overrideText = this.stateFarmTextOverrides[ans?.Name];
|
||||||
|
if (overrideText) {
|
||||||
|
return { ...ans, Text: overrideText };
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
selectedValues: {
|
||||||
|
get() {
|
||||||
|
return this.modelValue;
|
||||||
|
},
|
||||||
|
set(newValue) {
|
||||||
|
this.$emit("update:modelValue", newValue);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
buttonQuestion,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.more-policy-questions {
|
||||||
|
.ui-checkbox {
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -28,7 +28,7 @@ describe("policy-info.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
@ -55,6 +55,15 @@ function setupMocks() {
|
||||||
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
||||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||||
|
|
||||||
|
const mockMixin = {
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn((widgetName, fieldName) => {
|
||||||
|
return mockCmsContent?.[widgetName]?.[fieldName] ?? "";
|
||||||
|
}),
|
||||||
|
setCmsContent: jest.fn(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
route: { name: "policy-info", query: {}, params: {} },
|
route: { name: "policy-info", query: {}, params: {} },
|
||||||
router: {
|
router: {
|
||||||
|
|
@ -62,6 +71,7 @@ function setupMocks() {
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
|
mixins: [mockMixin],
|
||||||
});
|
});
|
||||||
|
|
||||||
const wrapper = shallowMount(policyInfo, mountOptions);
|
const wrapper = shallowMount(policyInfo, mountOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,208 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
<!--
|
|
||||||
... Page code goes here.
|
<textBlock
|
||||||
-->
|
cmsWidgetName="PageTitleWidget"
|
||||||
<navbar
|
typeStyle="h1"
|
||||||
|
:customText="pageTitleText"
|
||||||
|
class="mb-5 text-left text-md-left cc-page-title" />
|
||||||
|
|
||||||
|
<textBlock
|
||||||
|
cmsWidgetName="PageInstructionsWidget"
|
||||||
|
typeStyle="body"
|
||||||
|
:customText="pageInstructionsText"
|
||||||
|
class="mb-5 text-left text-md-left" />
|
||||||
|
|
||||||
|
<textboxQuestion
|
||||||
|
isRequired
|
||||||
|
class="mb-1"
|
||||||
|
:cmsWidgetName="policyNumberWidgetName"
|
||||||
|
v-model="policyNumber"
|
||||||
|
inputId="policyNumber"
|
||||||
|
validationRules="policy-number-required" />
|
||||||
|
<span
|
||||||
|
v-if="displayPolicyHelperText"
|
||||||
|
class="d-block mb-5 helper-text"
|
||||||
|
v-html="policyHelperText"></span>
|
||||||
|
|
||||||
|
<datePickerPopup
|
||||||
|
v-if="displayDateOfBirth"
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="DateOfBirthWidget"
|
||||||
|
v-model="dateOfBirth"
|
||||||
|
customInputId="dateOfBirth"
|
||||||
|
placeholderText="MM/DD/YYYY"
|
||||||
|
validationRules="date-of-birth-required"
|
||||||
|
format="MM/dd/yyyy"
|
||||||
|
modelType="MM/dd/yyyy"
|
||||||
|
:enableTimePicker="false"
|
||||||
|
:textInputOnly="true"
|
||||||
|
:maxDate="today"
|
||||||
|
:preventMinMaxNavigation="true" />
|
||||||
|
|
||||||
|
<textboxQuestion
|
||||||
|
v-if="displayLastName"
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="LastNameWidget"
|
||||||
|
v-model="lastName"
|
||||||
|
inputId="lastName"
|
||||||
|
validationRules="last-name-required" />
|
||||||
|
|
||||||
|
<textboxQuestion
|
||||||
|
v-if="displayStreetAddress"
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="StreetAddressWidget"
|
||||||
|
v-model="streetAddress"
|
||||||
|
inputId="streetAddress"
|
||||||
|
validationRules="street-address-required" />
|
||||||
|
|
||||||
|
<textboxQuestion
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="ZipWidget"
|
||||||
|
v-model="policyZip"
|
||||||
|
inputId="policyZip"
|
||||||
|
maxLength="5"
|
||||||
|
validationRules="zip-code-required|zip-code-format" />
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-8">
|
||||||
|
<textboxQuestion
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="PhoneWidget"
|
||||||
|
v-model="phoneNumber"
|
||||||
|
inputId="phoneNumber"
|
||||||
|
mask="###-###-####"
|
||||||
|
validationRules="phone-number-required" />
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md-4">
|
||||||
|
<textboxQuestion
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="PhoneExtensionWidget"
|
||||||
|
v-model="phoneExtension"
|
||||||
|
inputId="phoneExtension" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<datePickerPopup
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="DateOfLossWidget"
|
||||||
|
v-model="dateOfLoss"
|
||||||
|
customInputId="dateOfLoss"
|
||||||
|
placeholderText="MM/DD/YYYY"
|
||||||
|
validationRules="date-of-loss-required"
|
||||||
|
format="MM/dd/yyyy"
|
||||||
|
modelType="MM/dd/yyyy"
|
||||||
|
:enableTimePicker="false"
|
||||||
|
:textInput="true"
|
||||||
|
:maxDate="today"
|
||||||
|
:preventMinMaxNavigation="true" />
|
||||||
|
|
||||||
|
<dropdownQuestion
|
||||||
|
v-if="displayLossTime"
|
||||||
|
isRequired
|
||||||
|
:questionText="timeOfLossQuestionText"
|
||||||
|
class="mb-4"
|
||||||
|
v-model="lossTime"
|
||||||
|
cmsWidgetName="TimeOfLossWidget"
|
||||||
|
customDropdownId="lossTime"
|
||||||
|
:options="lossTimeOptions"
|
||||||
|
:valueAsKey="true"
|
||||||
|
validationRules="loss-time-required"
|
||||||
|
:labelBold="true" />
|
||||||
|
|
||||||
|
<dropdownQuestion
|
||||||
|
isRequired
|
||||||
|
:questionText="damageTypesQuestionText"
|
||||||
|
class="mb-4"
|
||||||
|
v-model="damageCause"
|
||||||
|
cmsWidgetName="DamageTypesWidget"
|
||||||
|
customDropdownId="damageTypes"
|
||||||
|
:options="damageTypesOptions"
|
||||||
|
:valueAsKey="true"
|
||||||
|
validationRules="damage-types-required"
|
||||||
|
:labelBold="true" />
|
||||||
|
|
||||||
|
<buttonQuestion
|
||||||
|
v-if="displaySubrogation"
|
||||||
|
:questionText="subrogationQuestionText"
|
||||||
|
:answers="subrogationAnswers"
|
||||||
|
class="mb-4"
|
||||||
|
groupName="SubrogationQuestion"
|
||||||
|
buttonTypeString="listButton"
|
||||||
|
isRequired
|
||||||
|
validationRules="subrogation-required"
|
||||||
|
v-model="subrogationSelectedValue" />
|
||||||
|
|
||||||
|
<dropdownQuestion
|
||||||
|
v-if="displayLossState"
|
||||||
|
class="mb-4"
|
||||||
|
customDropdownId="policyState"
|
||||||
|
cmsWidgetName="StateQuestionWidget"
|
||||||
|
v-model="policyState"
|
||||||
|
ref="policyState"
|
||||||
|
:options="stateOptions"
|
||||||
|
validationRules="state-required"
|
||||||
|
autocomplete="address-level1"
|
||||||
|
placeHolderText="Select State"
|
||||||
|
:labelBold="true" />
|
||||||
|
|
||||||
|
<dropdownQuestion
|
||||||
|
v-if="displayLossLocation"
|
||||||
|
:questionText="lossLocationQuestionText"
|
||||||
|
class="mb-4"
|
||||||
|
v-model="lossLocation"
|
||||||
|
cmsWidgetName="LossLocationQuestionWidget"
|
||||||
|
customDropdownId="lossLocation"
|
||||||
|
:options="lossLocationOptions"
|
||||||
|
:valueAsKey="true"
|
||||||
|
validationRules="loss-location-required"
|
||||||
|
:labelBold="true" />
|
||||||
|
|
||||||
|
<textboxQuestion
|
||||||
|
v-if="displayLossCity"
|
||||||
|
isRequired
|
||||||
|
class="mb-4"
|
||||||
|
cmsWidgetName="CityWidget"
|
||||||
|
v-model="city"
|
||||||
|
inputId="city"
|
||||||
|
validationRules="city-required" />
|
||||||
|
|
||||||
|
<hr class="mt-4 mb-0" />
|
||||||
|
|
||||||
|
<morePolicyQuestions
|
||||||
|
ref="morePolicyQuestions"
|
||||||
|
cmsWidgetName="MorePolicyQuestionsWidget"
|
||||||
|
v-model="morePolicyQuestions"
|
||||||
|
groupName="MorePolicyQuestionsQuestion" />
|
||||||
|
|
||||||
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
@back-clicked="backButtonAction"
|
isBackButtonHidden
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
|
|
||||||
|
<span
|
||||||
|
v-if="displayDisclaimerText"
|
||||||
|
class="d-block mb-5 disclaimer-text"
|
||||||
|
v-html="disclaimerText"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,27 +211,205 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import { Form } from "vee-validate";
|
import textBlock from "@/digital-components/text-block/text-block";
|
||||||
|
import textboxQuestion from "@/digital-components/textbox-question/textbox-question";
|
||||||
|
import datePickerPopup from "@/digital-components/date-picker-popup/date-picker-popup";
|
||||||
|
import dropdownQuestion from "@/digital-components/dropdown-question/dropdown-question";
|
||||||
|
import morePolicyQuestions from "@/layouts/policy-info/more-policy-questions/more-policy-questions";
|
||||||
|
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||||
|
import { stateOptions } from "@/constants/state-options";
|
||||||
|
import { Form, defineRule } from "vee-validate";
|
||||||
|
import { required } from "@/helpers/validation-rules";
|
||||||
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
|
import { regex } from "@/helpers/validation-rules";
|
||||||
|
import { PARENT_ACCOUNT_NUMBERS } from "@/constants/insurance";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
|
defineRule("policy-number-required", required(errorMessages.POLICY_NUMBER_REQUIRED));
|
||||||
|
defineRule("zip-code-required", required(errorMessages.ZIP_REQUIRED));
|
||||||
|
defineRule("zip-code-format", regex(/(^\d{5}$)|(^\d{5}-\d{4}$)/, errorMessages.ZIP_FORMAT));
|
||||||
|
defineRule("phone-number-required", required(errorMessages.PHONE_REQUIRED));
|
||||||
|
defineRule("date-of-loss-required", required(errorMessages.DATE_OF_LOSS_REQUIRED));
|
||||||
|
defineRule("damage-types-required", required(errorMessages.DAMAGE_TYPES_REQUIRED));
|
||||||
|
defineRule("state-required", required(errorMessages.STATE_REQUIRED));
|
||||||
|
defineRule("city-required", required(errorMessages.CITY_REQUIRED));
|
||||||
|
defineRule("date-of-birth-required", required(errorMessages.DATE_OF_BIRTH_REQUIRED));
|
||||||
|
defineRule("last-name-required", required(errorMessages.LAST_NAME_REQUIRED));
|
||||||
|
defineRule("street-address-required", required(errorMessages.STREET_ADDRESS_REQUIRED));
|
||||||
|
defineRule("loss-time-required", required(errorMessages.LOSS_TIME_REQUIRED));
|
||||||
|
defineRule("loss-location-required", required(errorMessages.LOSS_LOCATION_REQUIRED));
|
||||||
|
defineRule("subrogation-required", required(errorMessages.SUBROGATION_REQUIRED));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "policy-info",
|
name: "policy-info",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
policyNumber: this.getPolicyNumberFromStore(),
|
||||||
|
policyZip: this.getPolicyZipFromStore(),
|
||||||
|
phoneNumber: this.getPhoneNumberFromStore(),
|
||||||
|
phoneExtension: this.getPhoneExtensionFromStore(),
|
||||||
|
dateOfLoss: this.getDateOfLossFromStore(),
|
||||||
|
lastName: this.getLastNameFromStore(),
|
||||||
|
streetAddress: this.getStreetAddressFromStore(),
|
||||||
|
damageCause: this.getDamageCauseFromStore(),
|
||||||
|
policyState: this.getPolicyStateFromStore(),
|
||||||
|
city: this.getCityFromStore(),
|
||||||
|
dateOfBirth: this.getDateOfBirthFromStore(),
|
||||||
|
lossTime: this.getLossTimeFromStore(),
|
||||||
|
morePolicyQuestions: this.getMorePolicyQuestionsFromStore(),
|
||||||
|
subrogationSelectedValue: this.getSubrogationSelectedValueFromStore(),
|
||||||
|
lossLocation: this.getLossLocationFromStore(),
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
|
textBlock,
|
||||||
|
textboxQuestion,
|
||||||
|
datePickerPopup,
|
||||||
|
dropdownQuestion,
|
||||||
|
morePolicyQuestions,
|
||||||
|
buttonQuestion,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
stateOptions() {
|
||||||
|
return stateOptions;
|
||||||
|
},
|
||||||
|
today() {
|
||||||
|
return new Date();
|
||||||
|
},
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
pageTitleText() {
|
||||||
|
return (
|
||||||
|
this.clientConfig?.PageTitleOverrideWidget?.Text ||
|
||||||
|
this.getCmsContent("PageTitleWidget", "Text")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
pageInstructionsText() {
|
||||||
|
return (
|
||||||
|
this.clientConfig?.PageInstructionsOverrideWidget?.Text ||
|
||||||
|
this.getCmsContent("PageInstructionsWidget", "Text")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
isUSAA() {
|
||||||
|
return (
|
||||||
|
store.getters.order?.payment?.parentAccountNumber?.toString() ===
|
||||||
|
PARENT_ACCOUNT_NUMBERS.USAA
|
||||||
|
);
|
||||||
|
},
|
||||||
|
policyNumberWidgetName() {
|
||||||
|
console.log("isUSAA", this.isUSAA);
|
||||||
|
return this.isUSAA ? "PolicyNumberUSAAWidget" : "PolicyNumberWidget";
|
||||||
|
},
|
||||||
|
policyHelperText() {
|
||||||
|
return this.clientConfig?.PolicyHelperTextOverrideWidget?.Text;
|
||||||
|
},
|
||||||
|
disclaimerText() {
|
||||||
|
return this.clientConfig?.DisclaimerWidget?.Text;
|
||||||
|
},
|
||||||
|
displayDisclaimerText() {
|
||||||
|
return this.disclaimerText !== null && this.disclaimerText !== "";
|
||||||
|
},
|
||||||
|
damageTypesQuestionText() {
|
||||||
|
return this.getCmsContent("DamageTypesWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
damageTypesOptions() {
|
||||||
|
const options = {};
|
||||||
|
|
||||||
|
const answers = this.getCmsContent("DamageTypesWidget", "Answers");
|
||||||
|
for (const answer of answers) {
|
||||||
|
options[answer.Name] = answer.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
},
|
||||||
|
lossTimeOptions() {
|
||||||
|
const options = {};
|
||||||
|
|
||||||
|
const answers = this.getCmsContent("TimeOfLossWidget", "Answers");
|
||||||
|
for (const answer of answers) {
|
||||||
|
options[answer.Name] = answer.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
},
|
||||||
|
timeOfLossQuestionText() {
|
||||||
|
return this.getCmsContent("TimeOfLossWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
lossLocationOptions() {
|
||||||
|
const options = {};
|
||||||
|
|
||||||
|
const answers = this.getCmsContent("LossLocationQuestionWidget", "Answers");
|
||||||
|
for (const answer of answers) {
|
||||||
|
options[answer.Name] = answer.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return options;
|
||||||
|
},
|
||||||
|
parsedClientConfig() {
|
||||||
|
const raw = this.clientConfig?.ConfigWidget?.Text;
|
||||||
|
if (!raw) return {};
|
||||||
|
try {
|
||||||
|
return JSON.parse(raw);
|
||||||
|
} catch (err) {
|
||||||
|
console.warn("Failed to parse clientConfig.ConfigWidget.Text", err);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
displayLossState() {
|
||||||
|
return this.parsedClientConfig.displayLossState ?? false;
|
||||||
|
},
|
||||||
|
displayLossCity() {
|
||||||
|
return this.parsedClientConfig.displayLossCity ?? false;
|
||||||
|
},
|
||||||
|
displayLossLocation() {
|
||||||
|
return this.parsedClientConfig.displayLossLocation ?? false;
|
||||||
|
},
|
||||||
|
displaySubrogation() {
|
||||||
|
return this.parsedClientConfig.displaySubrogation ?? false;
|
||||||
|
},
|
||||||
|
displayStreetAddress() {
|
||||||
|
return this.parsedClientConfig.displayStreetAddress ?? false;
|
||||||
|
},
|
||||||
|
displayDateOfBirth() {
|
||||||
|
return this.parsedClientConfig.displayDateOfBirth ?? false;
|
||||||
|
},
|
||||||
|
displayLastName() {
|
||||||
|
return this.parsedClientConfig.displayLastName ?? false;
|
||||||
|
},
|
||||||
|
displayLossTime() {
|
||||||
|
return this.parsedClientConfig.displayLossTime ?? false;
|
||||||
|
},
|
||||||
|
displayPolicyHelperText() {
|
||||||
|
return this.policyHelperText !== null && this.policyHelperText !== "";
|
||||||
|
},
|
||||||
|
subrogationQuestionText() {
|
||||||
|
return this.getCmsContent("SubrogationQuestionWidget", "QuestionText");
|
||||||
|
},
|
||||||
|
subrogationAnswers() {
|
||||||
|
return this.getCmsContent("SubrogationQuestionWidget", "Answers");
|
||||||
|
},
|
||||||
|
lossLocationQuestionText() {
|
||||||
|
return this.getCmsContent("LossLocationQuestionWidget", "QuestionText");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
|
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
|
|
@ -50,21 +417,104 @@ export default {
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`policy-infoclientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
backButtonAction() {
|
getPolicyNumberFromStore() {
|
||||||
|
return store.getters.order.policy.policyNumber;
|
||||||
|
},
|
||||||
|
getPolicyZipFromStore() {
|
||||||
|
return store.getters.order.policy.zipCode;
|
||||||
|
},
|
||||||
|
getPhoneNumberFromStore() {
|
||||||
|
return store.getters.order.policy.phoneNumber;
|
||||||
|
},
|
||||||
|
getPhoneExtensionFromStore() {
|
||||||
|
return store.getters.order.policy.phoneExtension;
|
||||||
|
},
|
||||||
|
getDateOfLossFromStore() {
|
||||||
|
return store.getters.order.damage.dateOfLoss;
|
||||||
|
},
|
||||||
|
getDamageCauseFromStore() {
|
||||||
|
return store.getters.order.damage.damageCause;
|
||||||
|
},
|
||||||
|
getPolicyStateFromStore() {
|
||||||
|
return store.getters.order.policy.state;
|
||||||
|
},
|
||||||
|
getCityFromStore() {
|
||||||
|
return store.getters.order.policy.city;
|
||||||
|
},
|
||||||
|
getDateOfBirthFromStore() {
|
||||||
|
return store.getters.order.policy.dateOfBirth;
|
||||||
|
},
|
||||||
|
getLastNameFromStore() {
|
||||||
|
return store.getters.order.policy.lastName;
|
||||||
|
},
|
||||||
|
getStreetAddressFromStore() {
|
||||||
|
return store.getters.order.policy.streetAddress;
|
||||||
|
},
|
||||||
|
getLossTimeFromStore() {
|
||||||
|
return store.getters.order.policy.lossTime;
|
||||||
|
},
|
||||||
|
getSubrogationSelectedValueFromStore() {
|
||||||
|
return store.getters.order.policy.subrogation;
|
||||||
|
},
|
||||||
|
getMorePolicyQuestionsFromStore() {
|
||||||
|
return store.getters.order.policy.morePolicyQuestions ?? [];
|
||||||
|
},
|
||||||
|
getLossLocationFromStore() {
|
||||||
|
return store.getters.order.policy.lossLocation;
|
||||||
|
},
|
||||||
|
cancelButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
this.pageName
|
this.pageName
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_INSURANCE_DETAILS,
|
||||||
|
{
|
||||||
|
policyNumber: this.policyNumber,
|
||||||
|
zipCode: this.policyZip,
|
||||||
|
phoneNumber: this.phoneNumber,
|
||||||
|
phoneExtension: this.phoneExtension,
|
||||||
|
state: this.policyState,
|
||||||
|
city: this.city,
|
||||||
|
morePolicyQuestions: this.morePolicyQuestions,
|
||||||
|
lossLocation: this.lossLocation,
|
||||||
|
lossTime: this.lossTime,
|
||||||
|
lastName: this.lastName,
|
||||||
|
dateOfBirth: this.dateOfBirth,
|
||||||
|
subrogation: this.subrogationSelectedValue,
|
||||||
|
streetAddress: this.streetAddress,
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
this.dispatchStoreAction(
|
||||||
|
this.storeActions.SAVE_DAMAGE_DETAILS,
|
||||||
|
{
|
||||||
|
dateOfLoss: this.dateOfLoss,
|
||||||
|
damageCause: this.damageCause,
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
this.$router.navigateWithSaving(
|
this.$router.navigateWithSaving(
|
||||||
this.navigationScenarios.CLICKED_FORWARD,
|
this.navigationScenarios.CLICKED_FORWARD,
|
||||||
this.pageName
|
this.pageName
|
||||||
|
|
@ -76,3 +526,34 @@ export default {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.cc-page-title {
|
||||||
|
font-size: 20px !important;
|
||||||
|
line-height: 1.325;
|
||||||
|
font-weight: 300;
|
||||||
|
color: $black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cc-page-instructions {
|
||||||
|
font-size: 16px !important;
|
||||||
|
font-weight: 400;
|
||||||
|
color: $gray-600;
|
||||||
|
line-height: 1.625;
|
||||||
|
}
|
||||||
|
|
||||||
|
.helper-text {
|
||||||
|
font-size: 14px !important;
|
||||||
|
font-weight: 400;
|
||||||
|
color: $gray-600;
|
||||||
|
line-height: 1.625;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.disclaimer-text {
|
||||||
|
font-size: 12px !important;
|
||||||
|
font-weight: 400;
|
||||||
|
color: $gray-600;
|
||||||
|
line-height: 1.625;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("policy-vehicle.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
|
|
@ -13,18 +17,11 @@
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
@click-event="forwardButtonAction" />
|
@click-event="forwardButtonAction" />
|
||||||
|
|
||||||
<textLink
|
<insuranceNavBar
|
||||||
class="pt-3"
|
|
||||||
useLoadingModal
|
|
||||||
linkType="text"
|
|
||||||
href="javascript:void(0)"
|
|
||||||
:text="cancelVerificationCopy"
|
|
||||||
@click-event="cancelVerificationAction" />
|
|
||||||
|
|
||||||
<navbar
|
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
|
|
||||||
|
|
@ -37,12 +34,12 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import buttonMain from "@/ux-components/button-main/button-main";
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
import textLink from "@/ux-components/text-link/text-link.vue";
|
|
||||||
import { parentAccountNumbers } from "@/constants/insurance";
|
import { parentAccountNumbers } from "@/constants/insurance";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
|
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
|
|
@ -53,39 +50,51 @@ export default {
|
||||||
name: "policy-vehicle",
|
name: "policy-vehicle",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
textLink,
|
|
||||||
buttonMain,
|
buttonMain,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`policy-vehicle clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
vehicleNotListedQuestionText() {
|
vehicleNotListedQuestionText() {
|
||||||
return this.getCmsContent("VehicleNotListedWidget", "Text");
|
return this.getCmsContent("VehicleNotListedWidget", "Text");
|
||||||
},
|
},
|
||||||
cancelVerificationCopy() {
|
|
||||||
return this.getCmsContent("CancelVerificationWidget", "Text");
|
|
||||||
},
|
|
||||||
amFamDisclaimerWidget() {
|
amFamDisclaimerWidget() {
|
||||||
return this.getCmsContent("AmFamDisclaimerWidget", "Text");
|
return this.getCmsContent("AmFamDisclaimerWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
@ -101,7 +110,7 @@ export default {
|
||||||
parentAccountNumberFromStore() {
|
parentAccountNumberFromStore() {
|
||||||
return store.getters.order?.payment?.parentAccountNumber;
|
return store.getters.order?.payment?.parentAccountNumber;
|
||||||
},
|
},
|
||||||
cancelVerificationAction() {
|
cancelButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
this.pageName
|
this.pageName
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("recalibration-info.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
@ -56,7 +56,7 @@ function setupMocks() {
|
||||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||||
|
|
||||||
const mountOptions = getMountOptions({
|
const mountOptions = getMountOptions({
|
||||||
route: { name: "policy-vehicle", query: {}, params: {} },
|
route: { name: "recalibration-info", query: {}, params: {} },
|
||||||
router: {
|
router: {
|
||||||
navigate: jest.fn(),
|
navigate: jest.fn(),
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
|
<div class="page-gradient"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
|
|
@ -8,10 +12,11 @@
|
||||||
<!--
|
<!--
|
||||||
... Page code goes here.
|
... Page code goes here.
|
||||||
-->
|
-->
|
||||||
<navbar
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,42 +27,68 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import store from "@/store";
|
||||||
|
import { debugLog } from "@/helpers/debug-log-helper";
|
||||||
export default {
|
export default {
|
||||||
name: "recalibration-info",
|
name: "recalibration-info",
|
||||||
mixins: [],
|
mixins: [],
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
clientConfig: {},
|
||||||
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const pageName = to.name;
|
const pageName = to.name;
|
||||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||||
|
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||||
|
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||||
const promiseResultMap = [
|
const promiseResultMap = [
|
||||||
{
|
{
|
||||||
resultKey: "cmsContent",
|
resultKey: "cmsContent",
|
||||||
promise: cmsContentPromise,
|
promise: cmsContentPromise,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
resultKey: "clientConfig",
|
||||||
|
promise: clientConfigPromise,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
|
vm.clientConfig = resultMap.clientConfig;
|
||||||
|
debugLog(
|
||||||
|
`recalibration-info clientConfig::${clientConfigPageName}`,
|
||||||
|
JSON.stringify(vm.clientConfig)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelButtonAction() {
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,8 @@
|
||||||
:zipCodeFromParent="zipCode"
|
:zipCodeFromParent="zipCode"
|
||||||
:isShopQuestionDisplayed="isShopQuestionDisplayed"
|
:isShopQuestionDisplayed="isShopQuestionDisplayed"
|
||||||
@shop-selected="onShopSelected"
|
@shop-selected="onShopSelected"
|
||||||
@updated-serviceability="setServiceabilityDetails" />
|
@updated-serviceability="setServiceabilityDetails"
|
||||||
|
@updated-mobile-fee-part="setMobileFeePart" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<textBlock
|
<textBlock
|
||||||
|
|
@ -736,6 +737,8 @@ export default {
|
||||||
this.isMobileStaticRecalibrationApplicable &&
|
this.isMobileStaticRecalibrationApplicable &&
|
||||||
this.mobileFeeHasPrice &&
|
this.mobileFeeHasPrice &&
|
||||||
this.isInsurance &&
|
this.isInsurance &&
|
||||||
|
!this.isITAC &&
|
||||||
|
!this.isNoComp &&
|
||||||
!this.mobileFeePart?.isInsurable
|
!this.mobileFeePart?.isInsurable
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
@ -1316,6 +1319,15 @@ export default {
|
||||||
moreShopTimeSlots.mobileTimeSlotsData.days
|
moreShopTimeSlots.mobileTimeSlotsData.days
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!this.selectableDatesMobile.estimatedServiceMinutesMinimum) {
|
||||||
|
this.selectableDatesMobile.estimatedServiceMinutesMinimum =
|
||||||
|
moreShopTimeSlots.mobileTimeSlotsData.estimatedServiceMinutesMinimum;
|
||||||
|
}
|
||||||
|
if (!this.selectableDatesMobile.estimatedServiceMinutesMaximum) {
|
||||||
|
this.selectableDatesMobile.estimatedServiceMinutesMaximum =
|
||||||
|
moreShopTimeSlots.mobileTimeSlotsData.estimatedServiceMinutesMaximum;
|
||||||
|
}
|
||||||
|
|
||||||
return moreShopTimeSlots;
|
return moreShopTimeSlots;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
:zipCodeFromParent="zipCodeFromParent"
|
:zipCodeFromParent="zipCodeFromParent"
|
||||||
@shop-selected="onShopSelected"
|
@shop-selected="onShopSelected"
|
||||||
@updated-serviceability="setServiceabilityDetails"
|
@updated-serviceability="setServiceabilityDetails"
|
||||||
|
@updated-mobile-fee-part="setMobileFeePart"
|
||||||
cmsWidgetName="YourSafeliteShopWidget" />
|
cmsWidgetName="YourSafeliteShopWidget" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -76,6 +77,9 @@ export default {
|
||||||
setServiceabilityDetails(serviceabilityDetails) {
|
setServiceabilityDetails(serviceabilityDetails) {
|
||||||
this.$emit("updated-serviceability", serviceabilityDetails);
|
this.$emit("updated-serviceability", serviceabilityDetails);
|
||||||
},
|
},
|
||||||
|
setMobileFeePart(mobileFeePart) {
|
||||||
|
this.$emit("updated-mobile-fee-part", mobileFeePart);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ import {
|
||||||
getServiceabilityDetails,
|
getServiceabilityDetails,
|
||||||
getClosestApplicableShops,
|
getClosestApplicableShops,
|
||||||
getShopProviderData,
|
getShopProviderData,
|
||||||
|
getPricedMobileFeePart,
|
||||||
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
} from "@/layouts/service-location/helpers/service-location-helper/service-location-helper";
|
||||||
|
|
||||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
@ -338,6 +339,14 @@ export default {
|
||||||
);
|
);
|
||||||
|
|
||||||
this.$emit("updated-serviceability", serviceabilityDetails.data);
|
this.$emit("updated-serviceability", serviceabilityDetails.data);
|
||||||
|
|
||||||
|
// retrieve mobile fee part
|
||||||
|
const mobileFeePart = await getPricedMobileFeePart(
|
||||||
|
this.zipCodeData.zipCode,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
|
||||||
|
this.$emit("updated-mobile-fee-part", mobileFeePart);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.closeModal();
|
this.closeModal();
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ export default {
|
||||||
canSafeliteService: this.canSafeliteServiceFromStore(),
|
canSafeliteService: this.canSafeliteServiceFromStore(),
|
||||||
skipVINLookup: this.getSkipVINLookupfromStore(),
|
skipVINLookup: this.getSkipVINLookupfromStore(),
|
||||||
skipPartQuestions: this.getSkipPartQuestionsfromStore(),
|
skipPartQuestions: this.getSkipPartQuestionsfromStore(),
|
||||||
|
vinRequired: this.getVinRequiredFromStore(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -490,6 +491,7 @@ export default {
|
||||||
this.isBigTruck = result?.data.isBigTruck;
|
this.isBigTruck = result?.data.isBigTruck;
|
||||||
this.skipVINLookup = result?.data.skipVINLookup;
|
this.skipVINLookup = result?.data.skipVINLookup;
|
||||||
this.skipPartQuestions = result?.data.skipPartQuestions;
|
this.skipPartQuestions = result?.data.skipPartQuestions;
|
||||||
|
this.vinRequired = result?.data.vinRequired;
|
||||||
},
|
},
|
||||||
resetAlert() {
|
resetAlert() {
|
||||||
this.displayNoServiceAlert = false;
|
this.displayNoServiceAlert = false;
|
||||||
|
|
@ -548,6 +550,7 @@ export default {
|
||||||
imageVifColor: this.imageVifColor,
|
imageVifColor: this.imageVifColor,
|
||||||
skipVINLookup: this.skipVINLookup,
|
skipVINLookup: this.skipVINLookup,
|
||||||
skipPartQuestions: this.skipPartQuestions,
|
skipPartQuestions: this.skipPartQuestions,
|
||||||
|
vinRequired: this.vinRequired,
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
@ -639,6 +642,9 @@ export default {
|
||||||
getSkipPartQuestionsfromStore() {
|
getSkipPartQuestionsfromStore() {
|
||||||
return store.getters.vehicle.skipPartQuestions;
|
return store.getters.vehicle.skipPartQuestions;
|
||||||
},
|
},
|
||||||
|
getVinRequiredFromStore() {
|
||||||
|
return store.getters.vehicle.vinRequired;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ describe("verify-details.vue", () => {
|
||||||
|
|
||||||
test("renders navbar component", () => {
|
test("renders navbar component", () => {
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks();
|
||||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("renders Form component", () => {
|
test("renders Form component", () => {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||||
<funnelHeader cmsWidgetName="FunnelHeaderWidget" ref="funnelHeader" />
|
<funnelHeader
|
||||||
|
cmsWidgetName="FunnelHeaderWidget"
|
||||||
|
ref="funnelHeader"
|
||||||
|
:overrideImageSrc="clientLogoImageSrc" />
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||||
|
|
@ -8,10 +11,11 @@
|
||||||
<!--
|
<!--
|
||||||
... Page code goes here.
|
... Page code goes here.
|
||||||
-->
|
-->
|
||||||
<navbar
|
<insuranceNavBar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
:isForwardActionDisabled="!meta.valid"
|
:isForwardActionDisabled="!meta.valid"
|
||||||
|
@cancel-clicked="cancelButtonAction"
|
||||||
@back-clicked="backButtonAction"
|
@back-clicked="backButtonAction"
|
||||||
@ForwardClicked="forwardButtonAction" />
|
@ForwardClicked="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -22,7 +26,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import { Form } from "vee-validate";
|
import { Form } from "vee-validate";
|
||||||
|
|
||||||
|
|
@ -38,7 +42,7 @@ export default {
|
||||||
components: {
|
components: {
|
||||||
Form,
|
Form,
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
navbar,
|
insuranceNavBar,
|
||||||
funnelSubHeader,
|
funnelSubHeader,
|
||||||
},
|
},
|
||||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||||
|
|
@ -57,7 +61,19 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
clientLogoImageSrc() {
|
||||||
|
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
cancelButtonAction() {
|
||||||
|
this.$router.navigateWithoutSaving(
|
||||||
|
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
this.pageName
|
||||||
|
);
|
||||||
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
this.$router.navigateWithoutSaving(
|
this.$router.navigateWithoutSaving(
|
||||||
this.navigationScenarios.CLICKED_BACK,
|
this.navigationScenarios.CLICKED_BACK,
|
||||||
|
|
|
||||||
|
|
@ -404,6 +404,13 @@ export default {
|
||||||
payload.orderNumber = "";
|
payload.orderNumber = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Referral Sequence Number
|
||||||
|
if (order.referralSequenceNumber) {
|
||||||
|
payload.referralSequenceNumber = order.referralSequenceNumber;
|
||||||
|
} else {
|
||||||
|
payload.referralSequenceNumber = "";
|
||||||
|
}
|
||||||
|
|
||||||
// Pricing
|
// Pricing
|
||||||
// Only fire for completed orders?
|
// Only fire for completed orders?
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -423,6 +423,7 @@ describe("analyticsMixin.js", () => {
|
||||||
},
|
},
|
||||||
workOrderNumber: "01820-111111",
|
workOrderNumber: "01820-111111",
|
||||||
workOrderId: "222222222222",
|
workOrderId: "222222222222",
|
||||||
|
referralSequenceNumber: "1234567",
|
||||||
};
|
};
|
||||||
store.getters.isRecalibrationOnOrder = true;
|
store.getters.isRecalibrationOnOrder = true;
|
||||||
store.getters.isRecalibrationOnSubmittedState = false;
|
store.getters.isRecalibrationOnSubmittedState = false;
|
||||||
|
|
@ -667,6 +668,14 @@ describe("analyticsMixin.js", () => {
|
||||||
expect(glassString).toMatch(/(\w+\/\w+)?(,\w+\/\w+)*/);
|
expect(glassString).toMatch(/(\w+\/\w+)?(,\w+\/\w+)*/);
|
||||||
expect(promoString).toMatch(/(\w+)?(,\w+)*/);
|
expect(promoString).toMatch(/(\w+)?(,\w+)*/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Pushes referralSequenceNumber when present on order", () => {
|
||||||
|
window.dataLayer = [];
|
||||||
|
|
||||||
|
analyticsMixin.methods.pushOrderToDataLayer();
|
||||||
|
|
||||||
|
expect(window.dataLayer[0].referralSequenceNumber).toBe("1234567");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Obj is not null after action prepended", () => {
|
test("Obj is not null after action prepended", () => {
|
||||||
|
|
|
||||||
|
|
@ -446,7 +446,7 @@ const routingTable = function () {
|
||||||
pageName: routeData.POLICY_INFO.name,
|
pageName: routeData.POLICY_INFO.name,
|
||||||
maps: [
|
maps: [
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
destinationPageData: routeData.INSURANCE_COMPANY,
|
destinationPageData: routeData.INSURANCE_COMPANY,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -471,6 +471,10 @@ const routingTable = function () {
|
||||||
{
|
{
|
||||||
pageName: routeData.DUPLICATE_CHECK.name,
|
pageName: routeData.DUPLICATE_CHECK.name,
|
||||||
maps: [
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
destinationPageData: routeData.INSURANCE_COMPANY,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.POLICY_INFO,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
|
|
@ -486,7 +490,7 @@ const routingTable = function () {
|
||||||
maps: [
|
maps: [
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.DUPLICATE_CHECK,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
@ -501,9 +505,13 @@ const routingTable = function () {
|
||||||
{
|
{
|
||||||
pageName: routeData.POLICY_DRIVER.name,
|
pageName: routeData.POLICY_DRIVER.name,
|
||||||
maps: [
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.POLICY_VEHICLE,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
@ -514,9 +522,13 @@ const routingTable = function () {
|
||||||
{
|
{
|
||||||
pageName: routeData.ENDORSEMENTS.name,
|
pageName: routeData.ENDORSEMENTS.name,
|
||||||
maps: [
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.POLICY_DRIVER,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
@ -527,9 +539,13 @@ const routingTable = function () {
|
||||||
{
|
{
|
||||||
pageName: routeData.POLICY_INFO_SUBMITTED.name,
|
pageName: routeData.POLICY_INFO_SUBMITTED.name,
|
||||||
maps: [
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.ENDORSEMENTS,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
@ -540,9 +556,13 @@ const routingTable = function () {
|
||||||
{
|
{
|
||||||
pageName: routeData.RECALIBRATION_INFO.name,
|
pageName: routeData.RECALIBRATION_INFO.name,
|
||||||
maps: [
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.POLICY_INFO_SUBMITTED,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
@ -559,7 +579,7 @@ const routingTable = function () {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK_RECALIBRATION_INFO,
|
scenario: navigationScenarios.CLICKED_BACK_RECALIBRATION_INFO,
|
||||||
destinationPageData: routeData.RECALIBRATION_INFO,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK_NON_CLAIM_AND_COVERAGE,
|
scenario: navigationScenarios.CLICKED_BACK_NON_CLAIM_AND_COVERAGE,
|
||||||
|
|
@ -574,9 +594,13 @@ const routingTable = function () {
|
||||||
{
|
{
|
||||||
pageName: routeData.VERIFY_DETAILS.name,
|
pageName: routeData.VERIFY_DETAILS.name,
|
||||||
maps: [
|
maps: [
|
||||||
|
{
|
||||||
|
scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||||
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_BACK,
|
scenario: navigationScenarios.CLICKED_BACK,
|
||||||
destinationPageData: routeData.DUPLICATE_CHECK,
|
destinationPageData: routeData.POLICY_INFO,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
scenario: navigationScenarios.CLICKED_FORWARD,
|
scenario: navigationScenarios.CLICKED_FORWARD,
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ import {
|
||||||
getPromoCodeWithoutBundleIdentifier,
|
getPromoCodeWithoutBundleIdentifier,
|
||||||
removeCurrentlyActivePromoCodesFromInactivePromos,
|
removeCurrentlyActivePromoCodesFromInactivePromos,
|
||||||
} from "@/helpers/promotions-helper";
|
} from "@/helpers/promotions-helper";
|
||||||
import { getDateDifferenceInDays } from "@/helpers/date-helper";
|
import { getDateDifferenceInDays, normalizeDotNetMinDate } from "@/helpers/date-helper";
|
||||||
import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations";
|
import sharedMutations from "./vuex-shared-mutations/vuexSharedMutations";
|
||||||
import {
|
import {
|
||||||
coverageStatus,
|
coverageStatus,
|
||||||
|
|
@ -84,6 +84,7 @@ const getDefaultState = () => {
|
||||||
},
|
},
|
||||||
skipVINLookup: false,
|
skipVINLookup: false,
|
||||||
skipPartQuestions: false,
|
skipPartQuestions: false,
|
||||||
|
vinRequired: false,
|
||||||
},
|
},
|
||||||
serviceLocation: {
|
serviceLocation: {
|
||||||
address: null,
|
address: null,
|
||||||
|
|
@ -175,11 +176,18 @@ const getDefaultState = () => {
|
||||||
additionalAuthFlag: null,
|
additionalAuthFlag: null,
|
||||||
isNoComp: false,
|
isNoComp: false,
|
||||||
insuranceCompanyName: null,
|
insuranceCompanyName: null,
|
||||||
|
phoneNumber: null,
|
||||||
|
phoneExtension: null,
|
||||||
streetAddress: null,
|
streetAddress: null,
|
||||||
apartment: null,
|
apartment: null,
|
||||||
city: null,
|
city: null,
|
||||||
state: null,
|
state: null,
|
||||||
zipCode: null,
|
zipCode: null,
|
||||||
|
dateOfBirth: null,
|
||||||
|
lossTime: null,
|
||||||
|
lossLocation: null,
|
||||||
|
lastName: null,
|
||||||
|
subrogation: null,
|
||||||
},
|
},
|
||||||
schedule: {
|
schedule: {
|
||||||
date: null,
|
date: null,
|
||||||
|
|
@ -225,6 +233,7 @@ const getDefaultState = () => {
|
||||||
expiryTime: null,
|
expiryTime: null,
|
||||||
idempotencyKey: null,
|
idempotencyKey: null,
|
||||||
},
|
},
|
||||||
|
submittedStateRevision: 0,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -266,6 +275,9 @@ export const mutations = {
|
||||||
updateSkipVINLookup(state, skipVINLookup) {
|
updateSkipVINLookup(state, skipVINLookup) {
|
||||||
state.order.vehicle.skipVINLookup = skipVINLookup;
|
state.order.vehicle.skipVINLookup = skipVINLookup;
|
||||||
},
|
},
|
||||||
|
updateVinRequired(state, vinRequired) {
|
||||||
|
state.order.vehicle.vinRequired = vinRequired;
|
||||||
|
},
|
||||||
updateSkipPartQuestions(state, skipPartQuestions) {
|
updateSkipPartQuestions(state, skipPartQuestions) {
|
||||||
state.order.vehicle.skipPartQuestions = skipPartQuestions;
|
state.order.vehicle.skipPartQuestions = skipPartQuestions;
|
||||||
},
|
},
|
||||||
|
|
@ -342,6 +354,12 @@ export const mutations = {
|
||||||
state.order.payment.accountName = accountName;
|
state.order.payment.accountName = accountName;
|
||||||
state.order.policy.insuranceCompanyName = accountName;
|
state.order.policy.insuranceCompanyName = accountName;
|
||||||
},
|
},
|
||||||
|
updatePhoneNumber(state, phoneNumber) {
|
||||||
|
state.order.policy.phoneNumber = phoneNumber;
|
||||||
|
},
|
||||||
|
updatePhoneExtension(state, phoneExtension) {
|
||||||
|
state.order.policy.phoneExtension = phoneExtension;
|
||||||
|
},
|
||||||
updateStreetAddress(state, streetAddress) {
|
updateStreetAddress(state, streetAddress) {
|
||||||
state.order.policy.streetAddress = streetAddress;
|
state.order.policy.streetAddress = streetAddress;
|
||||||
},
|
},
|
||||||
|
|
@ -551,6 +569,15 @@ export const mutations = {
|
||||||
state.order.policy.state = insuranceDetails.state;
|
state.order.policy.state = insuranceDetails.state;
|
||||||
state.order.policy.zipCode = insuranceDetails.zipCode;
|
state.order.policy.zipCode = insuranceDetails.zipCode;
|
||||||
state.order.policy.claimNumber = insuranceDetails.claimNumber;
|
state.order.policy.claimNumber = insuranceDetails.claimNumber;
|
||||||
|
state.order.policy.phoneNumber = insuranceDetails.phoneNumber;
|
||||||
|
state.order.policy.phoneExtension = insuranceDetails.phoneExtension;
|
||||||
|
state.order.policy.morePolicyQuestions = insuranceDetails.morePolicyQuestions;
|
||||||
|
state.order.policy.dateOfBirth = insuranceDetails.dateOfBirth;
|
||||||
|
state.order.policy.lossTime = insuranceDetails.lossTime;
|
||||||
|
state.order.policy.lastName = insuranceDetails.lastName;
|
||||||
|
state.order.policy.lossLocation = insuranceDetails.lossLocation;
|
||||||
|
state.order.policy.subrogation = insuranceDetails.subrogation;
|
||||||
|
state.order.policy.streetAddress = insuranceDetails.streetAddress;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateDamageDetails(state, damageDetails) {
|
updateDamageDetails(state, damageDetails) {
|
||||||
|
|
@ -745,6 +772,11 @@ export const mutations = {
|
||||||
resetState(state) {
|
resetState(state) {
|
||||||
Object.assign(state, getDefaultState());
|
Object.assign(state, getDefaultState());
|
||||||
},
|
},
|
||||||
|
// Bumps when submittedState sessionStorage is created, updated, or cleared so getters
|
||||||
|
// that read sessionStorage (coverageIsVerified, etc.) invalidate their Vuex cache.
|
||||||
|
incrementSubmittedStateRevision(state) {
|
||||||
|
state.submittedStateRevision = (state.submittedStateRevision ?? 0) + 1;
|
||||||
|
},
|
||||||
resetSaveSessionPromise(state) {
|
resetSaveSessionPromise(state) {
|
||||||
state.applicationUser.saveSessionPromise = null;
|
state.applicationUser.saveSessionPromise = null;
|
||||||
},
|
},
|
||||||
|
|
@ -815,12 +847,15 @@ export const mutations = {
|
||||||
vehicleSpecialClass: sessionInformation.order.vehicle?.vehicleSpecialClass,
|
vehicleSpecialClass: sessionInformation.order.vehicle?.vehicleSpecialClass,
|
||||||
isBigTruck: sessionInformation.order.vehicle?.isBigTruck,
|
isBigTruck: sessionInformation.order.vehicle?.isBigTruck,
|
||||||
canSafeliteService: sessionInformation.order.vehicle?.canSafeliteService,
|
canSafeliteService: sessionInformation.order.vehicle?.canSafeliteService,
|
||||||
|
vinRequired: sessionInformation.order.vehicle?.vinRequired,
|
||||||
});
|
});
|
||||||
|
|
||||||
state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace;
|
state.order.damage.glassToReplace = sessionInformation.order.damage.glassToReplace;
|
||||||
state.order.damage.isRepair = sessionInformation.order.damage.isRepair;
|
state.order.damage.isRepair = sessionInformation.order.damage.isRepair;
|
||||||
state.order.damage.numberOfChips = sessionInformation.order.damage.numberOfChips;
|
state.order.damage.numberOfChips = sessionInformation.order.damage.numberOfChips;
|
||||||
state.order.damage.dateOfLoss = sessionInformation.order.damage?.dateOfLoss;
|
state.order.damage.dateOfLoss = normalizeDotNetMinDate(
|
||||||
|
sessionInformation.order.damage?.dateOfLoss
|
||||||
|
);
|
||||||
state.order.damage.damageCause = sessionInformation.order.damage?.damageCause;
|
state.order.damage.damageCause = sessionInformation.order.damage?.damageCause;
|
||||||
|
|
||||||
state.order.damage.partQuestionAnswers =
|
state.order.damage.partQuestionAnswers =
|
||||||
|
|
@ -1004,6 +1039,7 @@ export const getters = {
|
||||||
return !!nonWindshieldItems?.length;
|
return !!nonWindshieldItems?.length;
|
||||||
},
|
},
|
||||||
coverageIsVerified: (state) => {
|
coverageIsVerified: (state) => {
|
||||||
|
state.submittedStateRevision;
|
||||||
let order;
|
let order;
|
||||||
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
order = JSON.parse(
|
order = JSON.parse(
|
||||||
|
|
@ -1036,6 +1072,7 @@ export const getters = {
|
||||||
return getHasRecalibrationPart(state);
|
return getHasRecalibrationPart(state);
|
||||||
},
|
},
|
||||||
isRecalibrationOnSubmittedState: (state) => {
|
isRecalibrationOnSubmittedState: (state) => {
|
||||||
|
state.submittedStateRevision;
|
||||||
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
return getHasRecalibrationPart({
|
return getHasRecalibrationPart({
|
||||||
order: JSON.parse(
|
order: JSON.parse(
|
||||||
|
|
@ -1046,6 +1083,7 @@ export const getters = {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
shouldHideRecalibration: (state) => {
|
shouldHideRecalibration: (state) => {
|
||||||
|
state.submittedStateRevision;
|
||||||
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
state = JSON.parse(
|
state = JSON.parse(
|
||||||
window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)
|
window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE)
|
||||||
|
|
@ -2584,6 +2622,7 @@ export const actions = {
|
||||||
vehicleSpecialClass: vehicle.vehicleSpecialClass,
|
vehicleSpecialClass: vehicle.vehicleSpecialClass,
|
||||||
isBigTruck: vehicle.isBigTruck,
|
isBigTruck: vehicle.isBigTruck,
|
||||||
canSafeliteService: vehicle.canSafeliteService,
|
canSafeliteService: vehicle.canSafeliteService,
|
||||||
|
vinRequired: vehicle.vinRequired,
|
||||||
registration: {
|
registration: {
|
||||||
firstName: vehicle.registration.firstName,
|
firstName: vehicle.registration.firstName,
|
||||||
lastName: vehicle.registration.lastName,
|
lastName: vehicle.registration.lastName,
|
||||||
|
|
@ -2815,6 +2854,7 @@ export const actions = {
|
||||||
imageVifColor,
|
imageVifColor,
|
||||||
skipVINLookup,
|
skipVINLookup,
|
||||||
skipPartQuestions,
|
skipPartQuestions,
|
||||||
|
vinRequired,
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
|
|
@ -2842,6 +2882,7 @@ export const actions = {
|
||||||
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);
|
context.commit(storeMutations.UPDATE_VEHICLE_IMAGE_COLOR, imageVifColor);
|
||||||
context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup);
|
context.commit(storeMutations.UPDATE_SKIP_VIN_LOOKUP, skipVINLookup);
|
||||||
context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions);
|
context.commit(storeMutations.UPDATE_SKIP_PART_QUESTIONS, skipPartQuestions);
|
||||||
|
context.commit(storeMutations.UPDATE_VIN_REQUIRED, vinRequired);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -3696,6 +3737,8 @@ export const actions = {
|
||||||
|
|
||||||
//restore affiliate cookies
|
//restore affiliate cookies
|
||||||
context.commit(storeMutations.UPDATE_AFFILIATE_COOKIES, affiliateCookies);
|
context.commit(storeMutations.UPDATE_AFFILIATE_COOKIES, affiliateCookies);
|
||||||
|
|
||||||
|
context.commit(storeMutations.INCREMENT_SUBMITTED_STATE_REVISION);
|
||||||
},
|
},
|
||||||
|
|
||||||
addDonationToSubmittedState(context, donationAmount) {
|
addDonationToSubmittedState(context, donationAmount) {
|
||||||
|
|
@ -3725,11 +3768,15 @@ export const actions = {
|
||||||
sessionStorageKeyConstants.SUBMITTED_STATE,
|
sessionStorageKeyConstants.SUBMITTED_STATE,
|
||||||
JSON.stringify(submittedState)
|
JSON.stringify(submittedState)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
context.commit(storeMutations.INCREMENT_SUBMITTED_STATE_REVISION);
|
||||||
},
|
},
|
||||||
|
|
||||||
resetSubmittedState(context) {
|
resetSubmittedState(context) {
|
||||||
// clear from local storage
|
// clear from local storage
|
||||||
window.sessionStorage.removeItem(sessionStorageKeyConstants.SUBMITTED_STATE);
|
window.sessionStorage.removeItem(sessionStorageKeyConstants.SUBMITTED_STATE);
|
||||||
|
|
||||||
|
context.commit(storeMutations.INCREMENT_SUBMITTED_STATE_REVISION);
|
||||||
},
|
},
|
||||||
resetExternalParameterState(context) {
|
resetExternalParameterState(context) {
|
||||||
if (context.getters.isExternalParameter) {
|
if (context.getters.isExternalParameter) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
import globalMethods from "@/global-methods";
|
import globalMethods from "@/global-methods";
|
||||||
|
import store from "@/store";
|
||||||
import { mutations, state, actions, getters } from "@/store";
|
import { mutations, state, actions, getters } from "@/store";
|
||||||
import { storeMutations } from "@/constants/store-mutations";
|
import { storeMutations } from "@/constants/store-mutations";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
import { sessionStorageKeyConstants } from "@/constants/session-storage";
|
||||||
import { experimentTriggers } from "@/constants/experiments";
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
import { routeData } from "@/router/constants/routes";
|
import { routeData } from "@/router/constants/routes";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
|
|
@ -363,6 +365,14 @@ describe("Mutations", () => {
|
||||||
expect(state.order.customer.phoneNumber).toEqual("555-555-5555");
|
expect(state.order.customer.phoneNumber).toEqual("555-555-5555");
|
||||||
expect(state.order.customer.isSmsOptIn).toEqual(true);
|
expect(state.order.customer.isSmsOptIn).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("incrementSubmittedStateRevision, should increment submittedStateRevision", () => {
|
||||||
|
const storeState = { submittedStateRevision: 0 };
|
||||||
|
|
||||||
|
mutations.incrementSubmittedStateRevision(storeState);
|
||||||
|
|
||||||
|
expect(storeState.submittedStateRevision).toEqual(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Actions", () => {
|
describe("Actions", () => {
|
||||||
|
|
@ -3610,6 +3620,85 @@ describe("Actions", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("submittedStateRevision", () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
mutations.resetState(store.state);
|
||||||
|
window.sessionStorage.removeItem(sessionStorageKeyConstants.SUBMITTED_STATE);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("resetSubmittedState action commits INCREMENT_SUBMITTED_STATE_REVISION", async () => {
|
||||||
|
const context = { commit: jest.fn() };
|
||||||
|
|
||||||
|
await actions.resetSubmittedState(context);
|
||||||
|
|
||||||
|
expect(context.commit).toHaveBeenCalledWith(
|
||||||
|
storeMutations.INCREMENT_SUBMITTED_STATE_REVISION
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("createSubmittedState action commits INCREMENT_SUBMITTED_STATE_REVISION at end", async () => {
|
||||||
|
const context = {
|
||||||
|
commit: jest.fn(),
|
||||||
|
state: {
|
||||||
|
order: {
|
||||||
|
payment: { insuranceCoverage: { isVerified: false } },
|
||||||
|
policy: { currentDeductible: 0 },
|
||||||
|
lineItems: {},
|
||||||
|
},
|
||||||
|
applicationUser: {
|
||||||
|
experiments: [],
|
||||||
|
affiliateCookies: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
await actions.createSubmittedState(context);
|
||||||
|
|
||||||
|
expect(context.commit).toHaveBeenCalledWith(
|
||||||
|
storeMutations.INCREMENT_SUBMITTED_STATE_REVISION
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("addDonationToSubmittedState action commits INCREMENT_SUBMITTED_STATE_REVISION", async () => {
|
||||||
|
window.sessionStorage.setItem(
|
||||||
|
sessionStorageKeyConstants.SUBMITTED_STATE,
|
||||||
|
JSON.stringify({
|
||||||
|
order: {
|
||||||
|
lineItems: { supportingItems: [] },
|
||||||
|
},
|
||||||
|
applicationUser: {},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const context = { commit: jest.fn() };
|
||||||
|
|
||||||
|
await actions.addDonationToSubmittedState(context, 5);
|
||||||
|
|
||||||
|
expect(context.commit).toHaveBeenCalledWith(
|
||||||
|
storeMutations.INCREMENT_SUBMITTED_STATE_REVISION
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("coverageIsVerified re-evaluates after resetSubmittedState clears sessionStorage", () => {
|
||||||
|
window.sessionStorage.setItem(
|
||||||
|
sessionStorageKeyConstants.SUBMITTED_STATE,
|
||||||
|
JSON.stringify({
|
||||||
|
order: {
|
||||||
|
payment: { insuranceCoverage: { isVerified: true } },
|
||||||
|
policy: { currentDeductible: 500 },
|
||||||
|
},
|
||||||
|
applicationUser: {},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(store.getters.coverageIsVerified).toBe(true);
|
||||||
|
|
||||||
|
store.dispatch(storeActions.RESET_SUBMITTED_STATE);
|
||||||
|
|
||||||
|
expect(store.getters.coverageIsVerified).toBe(false);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("Getters", () => {
|
describe("Getters", () => {
|
||||||
it("Vehicle getter, should return vehicle data", () => {
|
it("Vehicle getter, should return vehicle data", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -102,3 +102,8 @@ option,
|
||||||
.btn {
|
.btn {
|
||||||
letter-spacing: 0.03rem;
|
letter-spacing: 0.03rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.page-gradient {
|
||||||
|
height: 12px;
|
||||||
|
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,10 @@
|
||||||
<div
|
<div
|
||||||
:aria-label="buttonLabel"
|
:aria-label="buttonLabel"
|
||||||
class="button-content list-button-content d-flex flex-column justify-content-center py-3 px-4 p-md-4">
|
class="button-content list-button-content d-flex flex-column justify-content-center py-3 px-4 p-md-4">
|
||||||
<span class="m-0" :class="[textPosition, labelBold ? 'span-bold' : '']">
|
<span
|
||||||
{{ buttonLabel }}
|
class="m-0"
|
||||||
</span>
|
:class="[textPosition, labelBold ? 'span-bold' : '']"
|
||||||
|
v-html="buttonLabel"></span>
|
||||||
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="textPosition">
|
<span v-if="buttonLabelSubCopy" class="m-0 small" :class="textPosition">
|
||||||
{{ buttonLabelSubCopy }}
|
{{ buttonLabelSubCopy }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue