Merge remote-tracking branch 'origin/develop' into feature/CASH-2752
This commit is contained in:
commit
c30aa3c1a6
23 changed files with 517 additions and 212 deletions
|
|
@ -56,6 +56,10 @@ const endpoints = {
|
|||
url: "/parts/api/v1/parts/parts-or-questions",
|
||||
method: "POST",
|
||||
},
|
||||
GetPartsOrQuestionsV3: {
|
||||
url: "/parts/api/v3/parts/parts-or-questions",
|
||||
method: "POST",
|
||||
},
|
||||
GetParts: {
|
||||
url: "/parts/api/v1/parts/parts",
|
||||
method: "POST",
|
||||
|
|
|
|||
|
|
@ -6,4 +6,5 @@ export const headerKeys = {
|
|||
TRANSACTION_ID: "X-Transaction-Id",
|
||||
EON: "X-Enterprise-Order-Number",
|
||||
LOG_ENABLED: "log-enabled",
|
||||
PAGE_NAME_TO_LOG: "X-Page-Name-To-Log",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -89,4 +89,5 @@ export const NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS = [
|
|||
export const PARENT_ACCOUNT_NUMBERS = {
|
||||
STATE_FARM: "711310",
|
||||
USAA: "900040",
|
||||
GEICO: "250034",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -39,6 +39,14 @@ export default {
|
|||
default: "dark-header",
|
||||
},
|
||||
alignLeft: Boolean,
|
||||
overrideHeaderText: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
overrideHeaderSubText: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
components: {
|
||||
buttonBack,
|
||||
|
|
@ -48,10 +56,13 @@ export default {
|
|||
return this.getCmsContent(this.cmsWidgetName, "HeaderSubText");
|
||||
},
|
||||
text() {
|
||||
return this.getCmsContent(this.cmsWidgetName, "HeaderText");
|
||||
return this.overrideHeaderText || this.getCmsContent(this.cmsWidgetName, "HeaderText");
|
||||
},
|
||||
subText() {
|
||||
return this.getCmsContent(this.cmsWidgetName, "HeaderSubText");
|
||||
return (
|
||||
this.overrideHeaderSubText ||
|
||||
this.getCmsContent(this.cmsWidgetName, "HeaderSubText")
|
||||
);
|
||||
},
|
||||
backButtonAccessibleText() {
|
||||
return this.getCmsContent(this.cmsWidgetName, "BackButtonAccessibleText");
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export default {
|
|||
[headerKeys.APPLICATION_NAME]: applicationConfig.APPLICATION_NAME,
|
||||
[headerKeys.SESSION_SEQUENCE_NUMBER]: getSessionKeyValue(),
|
||||
[headerKeys.REFERRAL_SEQUENCE_NUMBER]: order?.referralSequenceNumber,
|
||||
[headerKeys.PAGE_NAME_TO_LOG]: pageNameToLog,
|
||||
[headerKeys.TRANSACTION_ID]: crypto.randomUUID(),
|
||||
[headerKeys.EON]: order?.eon,
|
||||
[headerKeys.LOG_ENABLED]: store.getters.applicationUser?.loggingOption ?? false,
|
||||
|
|
|
|||
|
|
@ -3,29 +3,48 @@ import store from "@/store";
|
|||
import { dynamicStrings } from "@/constants/dynamic-strings";
|
||||
|
||||
export function fetchCmsContentForPage(fmgPage) {
|
||||
return store.dispatch(storeActions.GET_PAGE_DATA, { pageName: fmgPage }).then((response) => {
|
||||
const pageDataFromCms = {};
|
||||
return store
|
||||
.dispatch(storeActions.GET_PAGE_DATA, { pageName: fmgPage })
|
||||
.then((response) => {
|
||||
const pageDataFromCms = {};
|
||||
|
||||
response.data.Result.forEach((widget) => {
|
||||
let widgetWithReplacements = findAndReplaceGlobalStateValues(widget.Model, widget.Name);
|
||||
response.data.Result.forEach((widget) => {
|
||||
let widgetWithReplacements = findAndReplaceGlobalStateValues(
|
||||
widget.Model,
|
||||
widget.Name
|
||||
);
|
||||
|
||||
// If we already have this widget, push it on the collection
|
||||
if (widgetWithReplacements.Name in pageDataFromCms) {
|
||||
pageDataFromCms[widgetWithReplacements.Name].push(widgetWithReplacements.Model);
|
||||
return;
|
||||
// If we already have this widget, push it on the collection
|
||||
if (widgetWithReplacements.Name in pageDataFromCms) {
|
||||
pageDataFromCms[widgetWithReplacements.Name].push(widgetWithReplacements.Model);
|
||||
return;
|
||||
}
|
||||
|
||||
pageDataFromCms[widgetWithReplacements.Name] = [widgetWithReplacements.Model];
|
||||
});
|
||||
|
||||
Object.keys(pageDataFromCms).forEach((key) => {
|
||||
if (pageDataFromCms[key].length === 1) {
|
||||
pageDataFromCms[key] = pageDataFromCms[key][0];
|
||||
}
|
||||
});
|
||||
|
||||
return pageDataFromCms;
|
||||
})
|
||||
.catch((error) => {
|
||||
// Client-specific config pages are optional. When one doesn't exist
|
||||
// the CMS returns a 404 - treat that as "no overrides" instead of an
|
||||
// error so callers receive an empty config object.
|
||||
const isClientConfigPage = typeof fmgPage === "string" && fmgPage.startsWith("client_");
|
||||
const status = error?.status ?? error?.response?.status;
|
||||
const isNotFound = status == 404;
|
||||
|
||||
if (isClientConfigPage && isNotFound) {
|
||||
return {};
|
||||
}
|
||||
|
||||
pageDataFromCms[widgetWithReplacements.Name] = [widgetWithReplacements.Model];
|
||||
return Promise.reject(error);
|
||||
});
|
||||
|
||||
Object.keys(pageDataFromCms).forEach((key) => {
|
||||
if (pageDataFromCms[key].length === 1) {
|
||||
pageDataFromCms[key] = pageDataFromCms[key][0];
|
||||
}
|
||||
});
|
||||
|
||||
return pageDataFromCms;
|
||||
});
|
||||
}
|
||||
|
||||
// Function to convert a string, into a matching global state item.
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`coverage-statement clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -182,7 +182,7 @@ export default {
|
|||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
deductibleAmount() {
|
||||
return this.$store.getters.order.policy.currentDeductible;
|
||||
return Number(this.$store.getters.order.policy.currentDeductible);
|
||||
},
|
||||
cashPrice() {
|
||||
const lineItems = this.$store.getters.order.lineItems;
|
||||
|
|
|
|||
|
|
@ -8,19 +8,10 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="DupCheckPageTitleWidget"
|
||||
typeStyle="h1"
|
||||
:customText="pageTitleText"
|
||||
class="text-left text-md-left cc-page-title" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="DupCheckPageInstructionsWidget"
|
||||
typeStyle="body"
|
||||
:customText="pageInstructionsText"
|
||||
class="mb-4 text-left text-md-left cc-page-instructions" />
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader"
|
||||
:alignLeft="true" />
|
||||
|
||||
<buttonQuestion
|
||||
:questionText="existingClaimsQuestionText"
|
||||
|
|
@ -60,7 +51,6 @@
|
|||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||
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";
|
||||
|
||||
|
|
@ -82,7 +72,6 @@ export default {
|
|||
funnelHeader,
|
||||
insuranceNavBar,
|
||||
funnelSubHeader,
|
||||
textBlock,
|
||||
buttonQuestion,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
|
|
@ -105,7 +94,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`duplicate-check clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -116,12 +105,6 @@ export default {
|
|||
clientLogoImageSrc() {
|
||||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
pageTitleText() {
|
||||
return this.getCmsContent("DupCheckPageTitleWidget", "Text");
|
||||
},
|
||||
pageInstructionsText() {
|
||||
return this.getCmsContent("DupCheckPageInstructionsWidget", "Text");
|
||||
},
|
||||
existingClaimsQuestionText() {
|
||||
return this.getCmsContent("ExistingClaimsListWidget", "QuestionText");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -8,19 +8,10 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="EndorsementsPageAdditionalInfoWidget"
|
||||
typeStyle="h1"
|
||||
:customText="endorsementHeading"
|
||||
class="text-left text-md-left page-title" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="MoreDetailsWidget"
|
||||
typeStyle="body"
|
||||
:customText="moreDetailsText"
|
||||
class="mb-4 text-left text-md-left page-instructions" />
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader"
|
||||
:alignLeft="true" />
|
||||
|
||||
<buttonQuestion
|
||||
:questionText="schoolEndorsementQuestionText"
|
||||
|
|
@ -64,7 +55,6 @@ 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 {
|
||||
name: "endorsements",
|
||||
|
|
@ -80,7 +70,6 @@ export default {
|
|||
insuranceNavBar,
|
||||
funnelSubHeader,
|
||||
buttonQuestion,
|
||||
textBlock,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -101,7 +90,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`endorsements clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -113,12 +102,6 @@ export default {
|
|||
clientLogoImageSrc() {
|
||||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
endorsementHeading() {
|
||||
return this.getCmsContent("EndorsementsPageAdditionalInfoWidget", "Text");
|
||||
},
|
||||
moreDetailsText() {
|
||||
return this.getCmsContent("MoreDetailsWidget", "Text");
|
||||
},
|
||||
schoolEndorsementQuestionText() {
|
||||
return this.getCmsContent("SchoolEndorsmentQuestionWidget", "QuestionText");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@
|
|||
isRequired
|
||||
class="mb-4"
|
||||
cmsWidgetName="ApartmentWidget"
|
||||
v-model="apartment"
|
||||
inputId="apartment" />
|
||||
v-model="streetAddress2"
|
||||
inputId="streetAddress2" />
|
||||
|
||||
<textboxQuestion
|
||||
isRequired
|
||||
|
|
@ -112,6 +112,14 @@
|
|||
maxLength="5"
|
||||
validationRules="zip-code-required|zip-code-format" />
|
||||
|
||||
<hr class="mb-5" />
|
||||
|
||||
<saveProgressModalQuestion
|
||||
modalWidgetName="SaveProgressModalWidget"
|
||||
modalName="SaveProgressModal"
|
||||
v-if="showSaveProgressModal"
|
||||
pageName="insurance-details" />
|
||||
|
||||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="navbar"
|
||||
|
|
@ -140,7 +148,12 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
|||
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||
import { stateOptions } from "@/constants/state-options";
|
||||
import { regex } from "@/helpers/validation-rules";
|
||||
import { NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS } from "@/constants/insurance";
|
||||
import {
|
||||
NON_MANAGED_SHOW_CLAIM_NUMBER_PARENTS,
|
||||
coverageStatus,
|
||||
coverageStatusEnum,
|
||||
} from "@/constants/insurance";
|
||||
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule(
|
||||
|
|
@ -166,11 +179,12 @@ export default {
|
|||
dateOfLoss: this.getDateOfLossFromStore(),
|
||||
damageCause: this.getDamageCauseFromStore(),
|
||||
streetAddress: this.getStreetAddressFromStore(),
|
||||
apartment: this.getApartmentFromStore(),
|
||||
streetAddress2: this.getStreetAddress2FromStore(),
|
||||
city: this.getCityFromStore(),
|
||||
policyState: this.getPolicyStateFromStore(),
|
||||
policyZip: this.getPolicyZipFromStore(),
|
||||
claimNumber: this.getClaimNumberFromStore(),
|
||||
showSaveProgressModal: null,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
|
|
@ -182,6 +196,7 @@ export default {
|
|||
datePickerPopup,
|
||||
dropdownQuestion,
|
||||
textBlock,
|
||||
saveProgressModalQuestion,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -194,8 +209,11 @@ export default {
|
|||
},
|
||||
];
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
const emailFromStore = store.getters.order.customer.emailAddress;
|
||||
const showSaveProgressModal = !(emailFromStore?.length > 0);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.showSaveProgressModal = showSaveProgressModal;
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -242,19 +260,19 @@ export default {
|
|||
return store.getters.order.damage.damageCause ?? "";
|
||||
},
|
||||
getStreetAddressFromStore() {
|
||||
return store.getters.order.policy.streetAddress ?? "";
|
||||
return store.getters.order.policy.policyAddress.streetAddress ?? "";
|
||||
},
|
||||
getApartmentFromStore() {
|
||||
return store.getters.order.policy.apartment ?? "";
|
||||
getStreetAddress2FromStore() {
|
||||
return store.getters.order.policy.policyAddress.streetAddress2 ?? "";
|
||||
},
|
||||
getCityFromStore() {
|
||||
return store.getters.order.policy.city ?? "";
|
||||
return store.getters.order.policy.policyAddress.city ?? "";
|
||||
},
|
||||
getPolicyStateFromStore() {
|
||||
return store.getters.order.policy.state ?? "";
|
||||
return store.getters.order.policy.policyAddress.state ?? "";
|
||||
},
|
||||
getPolicyZipFromStore() {
|
||||
return store.getters.order.policy.zipCode ?? "";
|
||||
return store.getters.order.policy.policyAddress.zipCode ?? "";
|
||||
},
|
||||
getClaimNumberFromStore() {
|
||||
return store.getters.order.policy.claimNumber ?? "";
|
||||
|
|
@ -271,11 +289,15 @@ export default {
|
|||
{
|
||||
policyNumber: this.policyNumber,
|
||||
streetAddress: this.streetAddress,
|
||||
apartment: this.apartment,
|
||||
streetAddress2: this.streetAddress2,
|
||||
city: this.city,
|
||||
state: this.policyState,
|
||||
zipCode: this.policyZip,
|
||||
claimNumber: this.claimNumber,
|
||||
currentDeductible: 7777,
|
||||
originalDeductible: 7777,
|
||||
coverageStatus: coverageStatusEnum(coverageStatus.PENDING),
|
||||
coverageSubStatus: "",
|
||||
},
|
||||
false
|
||||
);
|
||||
|
|
|
|||
|
|
@ -567,14 +567,14 @@ export default {
|
|||
|
||||
this.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||
|
||||
const shouldUseAdyen = experimentMixin.methods.hasSettingEqualTo(
|
||||
const shouldUseCybersource = experimentMixin.methods.hasSettingEqualTo(
|
||||
experimentSettings.USE_ADYEN_PAYMENT,
|
||||
"true"
|
||||
"false"
|
||||
);
|
||||
|
||||
const scenarioName = shouldUseAdyen
|
||||
? this.navigationScenarios.CLICKED_PAY_NOW_ADYEN
|
||||
: this.navigationScenarios.CLICKED_PAY_NOW;
|
||||
const scenarioName = shouldUseCybersource
|
||||
? this.navigationScenarios.CLICKED_PAY_NOW
|
||||
: this.navigationScenarios.CLICKED_PAY_NOW_ADYEN;
|
||||
|
||||
this.$router.navigateWithoutSaving(scenarioName, this.pageName);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -55,6 +55,15 @@ function setupMocks() {
|
|||
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||
|
||||
const mockMixin = {
|
||||
methods: {
|
||||
getCmsContent: jest.fn((widgetName, fieldName) => {
|
||||
return mockCmsContent?.[widgetName]?.[fieldName] ?? "";
|
||||
}),
|
||||
setCmsContent: jest.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
const mountOptions = getMountOptions({
|
||||
route: { name: "policy-driver", query: {}, params: {} },
|
||||
router: {
|
||||
|
|
@ -62,6 +71,7 @@ function setupMocks() {
|
|||
navigateWithSaving: jest.fn(),
|
||||
navigateWithoutSaving: jest.fn(),
|
||||
},
|
||||
mixins: [mockMixin],
|
||||
});
|
||||
|
||||
const wrapper = shallowMount(policyDriver, mountOptions);
|
||||
|
|
|
|||
|
|
@ -8,10 +8,20 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
<!--
|
||||
... Page code goes here.
|
||||
-->
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader mb-4"
|
||||
:alignLeft="true" />
|
||||
|
||||
<buttonQuestion
|
||||
:questionText="driverSelectionText"
|
||||
:answers="driverSelectionAnswers"
|
||||
class="mb-4"
|
||||
groupName="driverQuestion"
|
||||
buttonTypeString="listButton"
|
||||
isRequired
|
||||
v-model="driverSelectionValue" />
|
||||
|
||||
<insuranceNavBar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="navbar"
|
||||
|
|
@ -29,6 +39,7 @@
|
|||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
import buttonQuestion from "@/digital-components/button-question/button-question";
|
||||
import { Form } from "vee-validate";
|
||||
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
|
|
@ -49,6 +60,7 @@ export default {
|
|||
funnelHeader,
|
||||
insuranceNavBar,
|
||||
funnelSubHeader,
|
||||
buttonQuestion,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -69,7 +81,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`policy-driver clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -81,6 +93,12 @@ export default {
|
|||
clientLogoImageSrc() {
|
||||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
driverSelectionText() {
|
||||
return this.getCmsContent("DriverSelectionWidget", "QuestionText");
|
||||
},
|
||||
driverSelectionAnswers() {
|
||||
return this.getCmsContent("DriverSelectionWidget", "Answers");
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -26,11 +26,6 @@ describe("policy-info-submitted.vue", () => {
|
|||
expect(wrapper.findComponent({ name: "funnelSubHeader" }).exists()).toBe(true);
|
||||
});
|
||||
|
||||
test("renders navbar component", () => {
|
||||
const { wrapper } = setupMocks();
|
||||
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||
});
|
||||
|
||||
test("renders Form component", () => {
|
||||
const { wrapper } = setupMocks();
|
||||
expect(wrapper.findComponent({ name: "Form" }).exists()).toBe(true);
|
||||
|
|
@ -55,13 +50,23 @@ function setupMocks() {
|
|||
fetchCmsContentForPage.mockResolvedValue(mockCmsContent);
|
||||
settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent });
|
||||
|
||||
const mockMixin = {
|
||||
methods: {
|
||||
getCmsContent: jest.fn((widgetName, fieldName) => {
|
||||
return mockCmsContent?.[widgetName]?.[fieldName] ?? "";
|
||||
}),
|
||||
setCmsContent: jest.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
const mountOptions = getMountOptions({
|
||||
route: { name: "policy-vehicle", query: {}, params: {} },
|
||||
route: { name: "endorsements", query: {}, params: {} },
|
||||
router: {
|
||||
navigate: jest.fn(),
|
||||
navigateWithSaving: jest.fn(),
|
||||
navigateWithoutSaving: jest.fn(),
|
||||
},
|
||||
mixins: [mockMixin],
|
||||
});
|
||||
|
||||
const wrapper = shallowMount(policyInfoSubmitted, mountOptions);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm">
|
||||
<funnelHeader
|
||||
cmsWidgetName="FunnelHeaderWidget"
|
||||
ref="funnelHeader"
|
||||
|
|
@ -8,17 +8,25 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
<!--
|
||||
... Page code goes here.
|
||||
-->
|
||||
<insuranceNavBar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="navbar"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@cancel-clicked="cancelButtonAction"
|
||||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader pb-4"
|
||||
:alignLeft="true" />
|
||||
|
||||
<buttonMain
|
||||
ref="buttonMain"
|
||||
class="mb-3"
|
||||
isPrimary
|
||||
:buttonText="ContinueButtonCopy"
|
||||
loaderColor="white"
|
||||
:aria-disabled="false"
|
||||
:isDisabled="false"
|
||||
@click-event="forwardButtonAction" />
|
||||
|
||||
<span
|
||||
v-if="displayDisclaimerText"
|
||||
class="d-block mb-5 disclaimer-text"
|
||||
v-html="disclaimerText"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -27,8 +35,9 @@
|
|||
|
||||
<script>
|
||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
import { parentAccountNumbers } from "@/constants/insurance";
|
||||
import buttonMain from "@/ux-components/button-main/button-main";
|
||||
import { Form } from "vee-validate";
|
||||
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
|
|
@ -46,8 +55,8 @@ export default {
|
|||
},
|
||||
components: {
|
||||
Form,
|
||||
buttonMain,
|
||||
funnelHeader,
|
||||
insuranceNavBar,
|
||||
funnelSubHeader,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
|
|
@ -69,7 +78,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`policy-info-submitted clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -81,23 +90,23 @@ export default {
|
|||
clientLogoImageSrc() {
|
||||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
ContinueButtonCopy() {
|
||||
return this.getCmsContent("ContinueButtonWidget", "QuestionText");
|
||||
},
|
||||
disclaimerText() {
|
||||
return this.clientConfig?.DisclaimerWidget?.Text;
|
||||
},
|
||||
displayDisclaimerText() {
|
||||
return this.disclaimerText !== null && this.disclaimerText !== "";
|
||||
},
|
||||
parentAccountNumbers() {
|
||||
return parentAccountNumbers;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
cancelButtonAction() {
|
||||
forwardButtonAction() {
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||
this.pageName
|
||||
);
|
||||
},
|
||||
backButtonAction() {
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_BACK,
|
||||
this.pageName
|
||||
);
|
||||
},
|
||||
async forwardButtonAction() {
|
||||
this.$router.navigateWithSaving(
|
||||
this.navigationScenarios.CLICKED_FORWARD,
|
||||
this.pageName
|
||||
);
|
||||
|
|
@ -108,3 +117,12 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.disclaimer-text {
|
||||
font-size: 12px !important;
|
||||
font-weight: 400;
|
||||
color: $gray-600;
|
||||
line-height: 1.625;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -8,19 +8,12 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="PageTitleWidget"
|
||||
typeStyle="h1"
|
||||
:customText="pageTitleText"
|
||||
class="text-left text-md-left cc-page-title" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="PageInstructionsWidget"
|
||||
typeStyle="body"
|
||||
:customText="pageInstructionsText"
|
||||
class="mb-4 text-left text-md-left" />
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader pb-4"
|
||||
:alignLeft="true"
|
||||
:overrideHeaderText="subHeaderTextOverride"
|
||||
:overrideHeaderSubText="subHeaderSubTextOverride" />
|
||||
|
||||
<textboxQuestion
|
||||
isRequired
|
||||
|
|
@ -46,7 +39,7 @@
|
|||
format="MM/dd/yyyy"
|
||||
modelType="MM/dd/yyyy"
|
||||
:enableTimePicker="false"
|
||||
:textInputOnly="true"
|
||||
:textInput="true"
|
||||
:maxDate="today"
|
||||
:preventMinMaxNavigation="true" />
|
||||
|
||||
|
|
@ -213,7 +206,6 @@
|
|||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
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";
|
||||
|
|
@ -274,7 +266,6 @@ export default {
|
|||
funnelHeader,
|
||||
insuranceNavBar,
|
||||
funnelSubHeader,
|
||||
textBlock,
|
||||
textboxQuestion,
|
||||
datePickerPopup,
|
||||
dropdownQuestion,
|
||||
|
|
@ -291,17 +282,11 @@ export default {
|
|||
clientLogoImageSrc() {
|
||||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
pageTitleText() {
|
||||
return (
|
||||
this.clientConfig?.PageTitleOverrideWidget?.Text ||
|
||||
this.getCmsContent("PageTitleWidget", "Text")
|
||||
);
|
||||
subHeaderTextOverride() {
|
||||
return this.clientConfig?.PageTitleOverrideWidget?.Text || "";
|
||||
},
|
||||
pageInstructionsText() {
|
||||
return (
|
||||
this.clientConfig?.PageInstructionsOverrideWidget?.Text ||
|
||||
this.getCmsContent("PageInstructionsWidget", "Text")
|
||||
);
|
||||
subHeaderSubTextOverride() {
|
||||
return this.clientConfig?.PageInstructionsOverrideWidget?.Text || "";
|
||||
},
|
||||
isUSAA() {
|
||||
return (
|
||||
|
|
@ -425,7 +410,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`policy-infoclientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@
|
|||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
|
||||
<div v-if="showAmFamDisclaimer" v-html="amFamDisclaimerWidget"></div>
|
||||
<span
|
||||
v-if="displayDisclaimerText"
|
||||
class="d-block mb-5 disclaimer-text"
|
||||
v-html="disclaimerText"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -83,7 +86,7 @@ export default {
|
|||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`policy-vehicle clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -98,11 +101,11 @@ export default {
|
|||
vehicleNotListedQuestionText() {
|
||||
return this.getCmsContent("VehicleNotListedWidget", "Text");
|
||||
},
|
||||
amFamDisclaimerWidget() {
|
||||
return this.getCmsContent("AmFamDisclaimerWidget", "Text");
|
||||
disclaimerText() {
|
||||
return this.clientConfig?.DisclaimerWidget?.Text;
|
||||
},
|
||||
showAmFamDisclaimer() {
|
||||
return this.parentAccountNumberFromStore() === this.parentAccountNumbers.CONNECT;
|
||||
displayDisclaimerText() {
|
||||
return this.disclaimerText !== null && this.disclaimerText !== "";
|
||||
},
|
||||
parentAccountNumbers() {
|
||||
return parentAccountNumbers;
|
||||
|
|
@ -147,4 +150,11 @@ export default {
|
|||
.policy-vehicle-subheader {
|
||||
padding-top: 22px;
|
||||
}
|
||||
|
||||
.disclaimer-text {
|
||||
font-size: 12px !important;
|
||||
font-weight: 400;
|
||||
color: $gray-600;
|
||||
line-height: 1.625;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ describe("recalibration-info.vue", () => {
|
|||
|
||||
test("renders navbar component", () => {
|
||||
const { wrapper } = setupMocks();
|
||||
expect(wrapper.findComponent({ name: "insuranceNavBar" }).exists()).toBe(true);
|
||||
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
|
||||
});
|
||||
|
||||
test("renders Form component", () => {
|
||||
|
|
|
|||
|
|
@ -8,15 +8,34 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
<!--
|
||||
... Page code goes here.
|
||||
-->
|
||||
<insuranceNavBar
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader mb-4"
|
||||
:alignLeft="true" />
|
||||
|
||||
<img
|
||||
:src="recalibrationInfoDesktopImage"
|
||||
alt=""
|
||||
class="recal-image recal-image--desktop mb-4" />
|
||||
<img
|
||||
:src="recalibrationInfoMobileImage"
|
||||
alt=""
|
||||
class="recal-image recal-image--mobile mb-4" />
|
||||
|
||||
<div class="adas-body-text mb-7" v-html="adasBodyText"></div>
|
||||
|
||||
<hr class="mb-5" />
|
||||
|
||||
<saveProgressModalQuestion
|
||||
modalWidgetName="SaveProgressModalWidget"
|
||||
modalName="SaveProgressModal"
|
||||
v-if="showSaveProgressModal"
|
||||
pageName="recalibration-info" />
|
||||
|
||||
<navbar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="navbar"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@cancel-clicked="cancelButtonAction"
|
||||
@back-clicked="backButtonAction"
|
||||
@ForwardClicked="forwardButtonAction" />
|
||||
</div>
|
||||
|
|
@ -27,27 +46,34 @@
|
|||
|
||||
<script>
|
||||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||
import navbar from "@/fmg-components/nav-bar/nav-bar";
|
||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
import saveProgressModalQuestion from "@/fmg-components/save-progress-modal-question/save-progress-modal-question";
|
||||
import { Form } from "vee-validate";
|
||||
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||
import store from "@/store";
|
||||
import { debugLog } from "@/helpers/debug-log-helper";
|
||||
|
||||
export default {
|
||||
name: "recalibration-info",
|
||||
mixins: [],
|
||||
data() {
|
||||
return {
|
||||
clientConfig: {},
|
||||
recalibrationInfoDesktopImage: "",
|
||||
recalibrationInfoMobileImage: "",
|
||||
adasBodyText: "",
|
||||
showSaveProgressModal: null,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
Form,
|
||||
funnelHeader,
|
||||
insuranceNavBar,
|
||||
navbar,
|
||||
funnelSubHeader,
|
||||
saveProgressModalQuestion,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
|
|
@ -66,9 +92,15 @@ export default {
|
|||
},
|
||||
];
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
const emailFromStore = store.getters.order.customer.emailAddress;
|
||||
const showSaveProgressModal = !(emailFromStore?.length > 0);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig;
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
vm.showSaveProgressModal = showSaveProgressModal;
|
||||
vm.recalibrationInfoDesktopImage = vm.getCmsContent("AdasInfoDesktopWidget", "Image");
|
||||
vm.recalibrationInfoMobileImage = vm.getCmsContent("AdasInfoMobileWidget", "Image");
|
||||
vm.adasBodyText = vm.getCmsContent("AdasInfoDesktopWidget", "BodyText");
|
||||
debugLog(
|
||||
`recalibration-info clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
|
|
@ -83,12 +115,6 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
cancelButtonAction() {
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||
this.pageName
|
||||
);
|
||||
},
|
||||
backButtonAction() {
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_BACK,
|
||||
|
|
@ -107,3 +133,22 @@ export default {
|
|||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// Both images are rendered; CSS swaps them at the md breakpoint so no JS
|
||||
// resize listeners are needed.
|
||||
.recal-image--desktop {
|
||||
display: none;
|
||||
}
|
||||
.recal-image--mobile {
|
||||
display: block;
|
||||
}
|
||||
@include media-breakpoint-up(md) {
|
||||
.recal-image--desktop {
|
||||
display: block;
|
||||
}
|
||||
.recal-image--mobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -4,13 +4,63 @@
|
|||
cmsWidgetName="FunnelHeaderWidget"
|
||||
ref="funnelHeader"
|
||||
:overrideImageSrc="clientLogoImageSrc" />
|
||||
<div class="page-gradient"></div>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 col-md-10 col-lg-8 col-xl-7">
|
||||
<funnelSubHeader class="pb-4" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
<!--
|
||||
... Page code goes here.
|
||||
-->
|
||||
<funnelSubHeader
|
||||
cmsWidgetName="FunnelSubHeaderWidget"
|
||||
class="siteSubHeader pb-4"
|
||||
:alignLeft="true" />
|
||||
|
||||
<textboxQuestion
|
||||
isRequired
|
||||
class="mb-4"
|
||||
cmsWidgetName="PolicyNumberWidget"
|
||||
v-model="policyNumber"
|
||||
inputId="policyNumber"
|
||||
validationRules="policy-number-required" />
|
||||
|
||||
<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
|
||||
isRequired
|
||||
class="mb-4"
|
||||
cmsWidgetName="ZipWidget"
|
||||
v-model="policyZip"
|
||||
inputId="policyZip"
|
||||
maxLength="5"
|
||||
validationRules="zip-code-required|zip-code-format" />
|
||||
|
||||
<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" />
|
||||
|
||||
<insuranceNavBar
|
||||
cmsWidgetName="FunnelFooterWidget"
|
||||
ref="navbar"
|
||||
|
|
@ -28,25 +78,51 @@
|
|||
import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||
import insuranceNavBar from "@/fmg-components/insurance-nav-bar/insurance-nav-bar";
|
||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||
import { Form } from "vee-validate";
|
||||
import datePickerPopup from "@/digital-components/date-picker-popup/date-picker-popup";
|
||||
import textboxQuestion from "@/digital-components/textbox-question/textbox-question";
|
||||
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 { settleAllPromises } from "@/helpers/layout-helper";
|
||||
import { debugLog } from "@/helpers/debug-log-helper";
|
||||
import store from "@/store";
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
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("date-of-loss-required", required(errorMessages.DATE_OF_LOSS_REQUIRED));
|
||||
defineRule("date-of-birth-required", required(errorMessages.DATE_OF_BIRTH_REQUIRED));
|
||||
|
||||
export default {
|
||||
name: "verify-details",
|
||||
mixins: [],
|
||||
data() {
|
||||
return {};
|
||||
return {
|
||||
clientConfig: {},
|
||||
policyNumber: this.getPolicyNumberFromStore(),
|
||||
policyZip: this.getPolicyZipFromStore(),
|
||||
dateOfLoss: this.getDateOfLossFromStore(),
|
||||
dateOfBirth: this.getDateOfBirthFromStore(),
|
||||
};
|
||||
},
|
||||
components: {
|
||||
Form,
|
||||
funnelHeader,
|
||||
insuranceNavBar,
|
||||
funnelSubHeader,
|
||||
datePickerPopup,
|
||||
textboxQuestion,
|
||||
},
|
||||
// Ensure CMS content is fetched during route navigation without depending on `to`/`from`
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
const clientConfigPageName = `client_${store.getters.order.payment.parentAccountNumber}`;
|
||||
const clientConfigPromise = fetchCmsContentForPage(clientConfigPageName);
|
||||
|
||||
const pageName = to.name;
|
||||
const cmsContentPromise = fetchCmsContentForPage(pageName);
|
||||
const promiseResultMap = [
|
||||
|
|
@ -54,10 +130,19 @@ export default {
|
|||
resultKey: "cmsContent",
|
||||
promise: cmsContentPromise,
|
||||
},
|
||||
{
|
||||
resultKey: "clientConfig",
|
||||
promise: clientConfigPromise,
|
||||
},
|
||||
];
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.clientConfig = resultMap.clientConfig ?? {};
|
||||
debugLog(
|
||||
`verify-details clientConfig::${clientConfigPageName}`,
|
||||
JSON.stringify(vm.clientConfig)
|
||||
);
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -65,9 +150,43 @@ export default {
|
|||
clientLogoImageSrc() {
|
||||
return this.clientConfig?.ClientLogoWidget?.Image || "";
|
||||
},
|
||||
today() {
|
||||
return new Date();
|
||||
},
|
||||
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 {};
|
||||
}
|
||||
},
|
||||
isGeico() {
|
||||
return (
|
||||
store.getters.order?.payment?.parentAccountNumber?.toString() ===
|
||||
PARENT_ACCOUNT_NUMBERS.GEICO
|
||||
);
|
||||
},
|
||||
displayDateOfBirth() {
|
||||
return this.parsedClientConfig.displayDateOfBirth && this.isGeico ? true : false;
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
getPolicyNumberFromStore() {
|
||||
return store.getters.order.policy.policyNumber;
|
||||
},
|
||||
getPolicyZipFromStore() {
|
||||
return store.getters.order.policy.zipCode;
|
||||
},
|
||||
getDateOfLossFromStore() {
|
||||
return store.getters.order.damage.dateOfLoss;
|
||||
},
|
||||
getDateOfBirthFromStore() {
|
||||
return store.getters.order.policy.dateOfBirth;
|
||||
},
|
||||
cancelButtonAction() {
|
||||
this.$router.navigateWithoutSaving(
|
||||
this.navigationScenarios.CLICKED_CANCEL_VERIFICATION,
|
||||
|
|
@ -92,3 +211,18 @@ export default {
|
|||
},
|
||||
};
|
||||
</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;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -264,6 +264,9 @@ export default {
|
|||
sessionData.coverageSubStatus = order?.payment?.insuranceCoverage?.coverageSubStatus;
|
||||
sessionData.isNoComp = order?.policy?.isNoComp;
|
||||
sessionData.isItac = order?.policy?.isItac;
|
||||
sessionData.isClaimAndCoverage = order.payment.isClaimAndCoverage;
|
||||
sessionData.vinRequired = order.vehicle.vinRequired ?? false;
|
||||
sessionData.installOemGlass = order.damage?.installOemGlass ?? false;
|
||||
sessionData.subTotalPrice = getSubTotal(order?.lineItems);
|
||||
sessionData.totalPrice = getAmountDue(order?.lineItems, true);
|
||||
sessionData.userAgent = navigator.userAgent;
|
||||
|
|
@ -602,8 +605,13 @@ export default {
|
|||
[part],
|
||||
false
|
||||
);
|
||||
let isQuotePageDiscount = productType == partTypeStrings.QUOTE_PAGE_DISCOUNT;
|
||||
|
||||
if (productSku == "DISCOUNT" || productType == "SERVICE PACKAGE DISCOUNT") {
|
||||
if (
|
||||
productSku == "DISCOUNT" ||
|
||||
productType == "SERVICE PACKAGE DISCOUNT" ||
|
||||
isQuotePageDiscount
|
||||
) {
|
||||
if (coupon) {
|
||||
coupon += ",";
|
||||
}
|
||||
|
|
@ -614,6 +622,7 @@ export default {
|
|||
}
|
||||
|
||||
discount += productPrice * -1;
|
||||
subTotal += isQuotePageDiscount ? productPrice : 0;
|
||||
} else {
|
||||
products.push({
|
||||
productType: productType,
|
||||
|
|
@ -663,6 +672,12 @@ export default {
|
|||
var repairFee = supportingItems.filter(function (lineItem) {
|
||||
return lineItem.partType.indexOf("REPAIR FEE") !== -1;
|
||||
});
|
||||
var replaceFee = supportingItems.filter(function (lineItem) {
|
||||
return lineItem.partType.indexOf("REPLACE FEE") !== -1;
|
||||
});
|
||||
var quotePageDiscount = supportingItems.filter(function (lineItem) {
|
||||
return lineItem.partType.indexOf(partTypeStrings.QUOTE_PAGE_DISCOUNT) !== -1;
|
||||
});
|
||||
|
||||
var vaps =
|
||||
submittedOrder.lineItems && submittedOrder.lineItems.vaps
|
||||
|
|
@ -701,6 +716,12 @@ export default {
|
|||
if (rainRepel) {
|
||||
combinedLineItems = combinedLineItems.concat(rainRepel);
|
||||
}
|
||||
if (replaceFee) {
|
||||
combinedLineItems = combinedLineItems.concat(replaceFee);
|
||||
}
|
||||
if (quotePageDiscount) {
|
||||
combinedLineItems = combinedLineItems.concat(quotePageDiscount);
|
||||
}
|
||||
|
||||
//Remove child Parts if any
|
||||
combinedLineItems.forEach((lineItem) => {
|
||||
|
|
|
|||
|
|
@ -178,11 +178,13 @@ const getDefaultState = () => {
|
|||
insuranceCompanyName: null,
|
||||
phoneNumber: null,
|
||||
phoneExtension: null,
|
||||
streetAddress: null,
|
||||
apartment: null,
|
||||
city: null,
|
||||
state: null,
|
||||
zipCode: null,
|
||||
policyAddress: {
|
||||
streetAddress: null,
|
||||
streetAddress2: null,
|
||||
city: null,
|
||||
state: null,
|
||||
zipCode: null,
|
||||
},
|
||||
dateOfBirth: null,
|
||||
lossTime: null,
|
||||
lossLocation: null,
|
||||
|
|
@ -361,19 +363,19 @@ export const mutations = {
|
|||
state.order.policy.phoneExtension = phoneExtension;
|
||||
},
|
||||
updateStreetAddress(state, streetAddress) {
|
||||
state.order.policy.streetAddress = streetAddress;
|
||||
state.order.policy.policyAddress.streetAddress = streetAddress;
|
||||
},
|
||||
updateApartment(state, apartment) {
|
||||
state.order.policy.apartment = apartment;
|
||||
updateStreetAddress2(state, streetAddress2) {
|
||||
state.order.policy.policyAddress.streetAddress2 = streetAddress2;
|
||||
},
|
||||
updateCity(state, city) {
|
||||
state.order.policy.city = city;
|
||||
state.order.policy.policyAddress.city = city;
|
||||
},
|
||||
updateState(state, stateValue) {
|
||||
state.order.policy.state = stateValue;
|
||||
state.order.policy.policyAddress.state = stateValue;
|
||||
},
|
||||
updateZipCode(state, zipCode) {
|
||||
state.order.policy.zipCode = zipCode;
|
||||
state.order.policy.policyAddress.zipCode = zipCode;
|
||||
},
|
||||
updateClaimNumber(state, claimNumber) {
|
||||
state.order.policy.claimNumber = claimNumber;
|
||||
|
|
@ -405,11 +407,11 @@ export const mutations = {
|
|||
state.order.policy.policyNumber = null;
|
||||
state.order.policy.claimNumber = null;
|
||||
state.order.policy.insuranceCompanyName = null;
|
||||
state.order.policy.streetAddress = null;
|
||||
state.order.policy.apartment = null;
|
||||
state.order.policy.city = null;
|
||||
state.order.policy.state = null;
|
||||
state.order.policy.zipCode = null;
|
||||
state.order.policy.policyAddress.streetAddress = null;
|
||||
state.order.policy.policyAddress.streetAddress2 = null;
|
||||
state.order.policy.policyAddress.city = null;
|
||||
state.order.policy.policyAddress.state = null;
|
||||
state.order.policy.policyAddress.zipCode = null;
|
||||
state.order.damage.dateOfLoss = null;
|
||||
state.order.damage.damageCause = null;
|
||||
},
|
||||
|
|
@ -563,11 +565,11 @@ export const mutations = {
|
|||
updateInsuranceDetails(state, insuranceDetails) {
|
||||
if (insuranceDetails) {
|
||||
state.order.policy.policyNumber = insuranceDetails.policyNumber;
|
||||
state.order.policy.streetAddress = insuranceDetails.streetAddress;
|
||||
state.order.policy.apartment = insuranceDetails.apartment;
|
||||
state.order.policy.city = insuranceDetails.city;
|
||||
state.order.policy.state = insuranceDetails.state;
|
||||
state.order.policy.zipCode = insuranceDetails.zipCode;
|
||||
state.order.policy.policyAddress.streetAddress = insuranceDetails.streetAddress;
|
||||
state.order.policy.policyAddress.streetAddress2 = insuranceDetails.streetAddress2;
|
||||
state.order.policy.policyAddress.city = insuranceDetails.city;
|
||||
state.order.policy.policyAddress.state = insuranceDetails.state;
|
||||
state.order.policy.policyAddress.zipCode = insuranceDetails.zipCode;
|
||||
state.order.policy.claimNumber = insuranceDetails.claimNumber;
|
||||
state.order.policy.phoneNumber = insuranceDetails.phoneNumber;
|
||||
state.order.policy.phoneExtension = insuranceDetails.phoneExtension;
|
||||
|
|
@ -577,8 +579,15 @@ export const mutations = {
|
|||
state.order.policy.lastName = insuranceDetails.lastName;
|
||||
state.order.policy.lossLocation = insuranceDetails.lossLocation;
|
||||
state.order.policy.subrogation = insuranceDetails.subrogation;
|
||||
state.order.policy.streetAddress = insuranceDetails.streetAddress;
|
||||
state.order.policy.currentDeductible = insuranceDetails.currentDeductible;
|
||||
state.order.policy.originalDeductible = insuranceDetails.originalDeductible;
|
||||
state.order.payment.insuranceCoverage.coverageStatus = coverageStatusValue(
|
||||
insuranceDetails.coverageStatus
|
||||
);
|
||||
state.order.payment.insuranceCoverage.coverageSubStatus =
|
||||
insuranceDetails.coverageSubStatus;
|
||||
}
|
||||
console.log("::::" + state.order.payment.insuranceCoverage.coverageStatus);
|
||||
},
|
||||
updateDamageDetails(state, damageDetails) {
|
||||
if (damageDetails) {
|
||||
|
|
@ -976,13 +985,20 @@ export const mutations = {
|
|||
? true
|
||||
: false;
|
||||
state.order.policy.policyNumber = sessionInformation.order.policy?.policyNumber;
|
||||
state.order.policy.claimNumber = sessionInformation.order.policy?.claimNumber;
|
||||
state.order.policy.insuranceCompanyName =
|
||||
sessionInformation.order.policy?.insuranceCompanyName;
|
||||
//state.order.policy.streetAddress = sessionInformation.order.policy?.streetAddress;
|
||||
//state.order.policy.apartment = sessionInformation.order.policy?.apartment;
|
||||
//state.order.policy.city = sessionInformation.order.policy?.city;
|
||||
//state.order.policy.state = sessionInformation.order.policy?.state;
|
||||
//state.order.policy.zipCode = sessionInformation.order.policy?.zipCode;
|
||||
|
||||
if (!state.order.policy.policyAddress) {
|
||||
state.order.policy.policyAddress = {};
|
||||
}
|
||||
const sessionPolicyAddress = sessionInformation.order.policy?.address;
|
||||
state.order.policy.policyAddress.streetAddress = sessionPolicyAddress?.streetAddress;
|
||||
state.order.policy.policyAddress.streetAddress2 = sessionPolicyAddress?.streetAddress2;
|
||||
state.order.policy.policyAddress.city = sessionPolicyAddress?.city;
|
||||
state.order.policy.policyAddress.state = sessionPolicyAddress?.state;
|
||||
state.order.policy.policyAddress.zipCode = sessionPolicyAddress?.zipCode;
|
||||
|
||||
state.order.policy.isNoComp =
|
||||
coverageTypeValue(sessionInformation?.order.insuranceCoverage.coverageType) ===
|
||||
coverageType.NOCOMP
|
||||
|
|
@ -1818,6 +1834,9 @@ export const actions = {
|
|||
coverageSubStatus,
|
||||
isNoComp,
|
||||
isItac,
|
||||
isClaimAndCoverage,
|
||||
vinRequired,
|
||||
installOemGlass,
|
||||
subTotalPrice,
|
||||
totalPrice,
|
||||
userAgent,
|
||||
|
|
@ -1868,6 +1887,9 @@ export const actions = {
|
|||
deductible: deductible,
|
||||
isNoComp: isNoComp,
|
||||
isItac: isItac,
|
||||
isClaimAndCoverage: isClaimAndCoverage,
|
||||
vinRequired: vinRequired,
|
||||
installOemGlass: installOemGlass,
|
||||
subTotalPrice: subTotalPrice,
|
||||
totalPrice: totalPrice,
|
||||
userAgent: userAgent,
|
||||
|
|
@ -1970,10 +1992,14 @@ export const actions = {
|
|||
// create a new array to avoid mutating state
|
||||
const glassArrayForPayload = convertGlassPieceNamingForApi(glassArray);
|
||||
|
||||
const partsOrQuestionsEndpoint = vehicle.vinRequired
|
||||
? endpoints.GetPartsOrQuestionsV3
|
||||
: endpoints.GetPartsOrQuestions;
|
||||
|
||||
const response = await globalMethods
|
||||
.callHttpClient({
|
||||
method: endpoints.GetPartsOrQuestions.method,
|
||||
endpoint: endpoints.GetPartsOrQuestions.url,
|
||||
method: partsOrQuestionsEndpoint.method,
|
||||
endpoint: partsOrQuestionsEndpoint.url,
|
||||
payload: {
|
||||
carId: carId,
|
||||
glassPieces: glassArrayForPayload,
|
||||
|
|
@ -2016,6 +2042,7 @@ export const actions = {
|
|||
const vehicle = context.getters.vehicle;
|
||||
const damage = context.getters.damage;
|
||||
const order = context.state.order;
|
||||
const payment = context.getters.payment;
|
||||
|
||||
const carId = vehicle.carId;
|
||||
const glassArray = damage.glassToReplace;
|
||||
|
|
@ -2024,6 +2051,7 @@ export const actions = {
|
|||
const vin = vehicle.vin;
|
||||
const serviceType = order.serviceLocation?.appointmentType;
|
||||
const referralSeqNumber = order.referralSequenceNumber;
|
||||
const parentAccountNumber = payment.parentAccountNumber;
|
||||
|
||||
// create a new array to avoid mutating state
|
||||
const glassArrayForPayload = convertGlassPieceNamingForApi(glassArray);
|
||||
|
|
@ -2040,6 +2068,7 @@ export const actions = {
|
|||
vin: vin,
|
||||
serviceType: serviceType,
|
||||
referralSeqNumber: referralSeqNumber,
|
||||
parentAccountNumber: parentAccountNumber,
|
||||
},
|
||||
logApiCall: true,
|
||||
pageNameToLog: pageNameToLog,
|
||||
|
|
@ -2648,6 +2677,8 @@ export const actions = {
|
|||
moldingQuestionAnswers: order.damage.moldingQuestionAnswers,
|
||||
capabilityQuestionAnswers: order.damage.capabilityQuestionAnswers,
|
||||
installOemGlass: order.damage.installOemGlass,
|
||||
dateOfLoss: order.damage.dateOfLoss,
|
||||
damageCause: order.damage.damageCause,
|
||||
},
|
||||
lineItems: {
|
||||
glassParts: lineItems.glassParts,
|
||||
|
|
@ -2699,6 +2730,15 @@ export const actions = {
|
|||
isNoComp: order.policy?.isNoComp,
|
||||
currentDeductible: order.policy?.currentDeductible,
|
||||
originalDeductible: order.policy?.originalDeductible,
|
||||
policyAddress: {
|
||||
streetAddress: order.policy?.policyAddress?.streetAddress,
|
||||
streetAddress2: order.policy?.policyAddress?.streetAddress2,
|
||||
city: order.policy?.policyAddress?.city,
|
||||
state: order.policy?.policyAddress?.state,
|
||||
zipCode: order.policy?.policyAddress?.zipCode,
|
||||
},
|
||||
policyNumber: order.policy?.policyNumber,
|
||||
claimNumber: order.policy?.claimNumber,
|
||||
},
|
||||
serviceLocation: {
|
||||
streetAddress: order.serviceLocation.address,
|
||||
|
|
|
|||
|
|
@ -106,10 +106,4 @@ option,
|
|||
.page-gradient {
|
||||
height: 12px;
|
||||
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0));
|
||||
|
||||
// Pull the page content up under the header gradient on insurance pages
|
||||
// (every insurance page renders the container right after .page-gradient).
|
||||
& + .container {
|
||||
margin-top: -22px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue