Fixing merge conflicts
This commit is contained in:
commit
6df4b1400c
27 changed files with 431 additions and 386 deletions
|
|
@ -175,17 +175,11 @@ stages:
|
|||
indexDeployVariables:
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||
- template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps
|
||||
parameters:
|
||||
awsCliContainer: awscli
|
||||
distributionId: $(apiCfDistributionId)
|
||||
paths: /*
|
||||
awsProfile: $(qaDeploymentProfile)
|
||||
- template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps
|
||||
parameters:
|
||||
awsCliContainer: awscli
|
||||
distributionId: $(cfDistributionId)
|
||||
paths: /iss/*
|
||||
paths: /*
|
||||
awsProfile: $(qaDeploymentProfile)
|
||||
|
||||
# Prod Build/Deploy
|
||||
|
|
@ -230,17 +224,11 @@ stages:
|
|||
indexDeployVariables:
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__)
|
||||
__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__)
|
||||
- template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps
|
||||
parameters:
|
||||
awsCliContainer: awscli
|
||||
distributionId: $(apiCfDistributionId)
|
||||
paths: /*
|
||||
awsProfile: $(prodDeploymentProfile)
|
||||
- template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps
|
||||
parameters:
|
||||
awsCliContainer: awscli
|
||||
distributionId: $(cfDistributionId)
|
||||
paths: /iss/*
|
||||
paths: /*
|
||||
awsProfile: $(prodDeploymentProfile)
|
||||
- template: templates/digital/auto-tag.yml@AzureDevOps
|
||||
parameters:
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
]">
|
||||
<input
|
||||
class="form-control"
|
||||
v-model.trim="value"
|
||||
v-model.trim.lazy="value"
|
||||
v-maska="mask"
|
||||
:type="type"
|
||||
:ref="inputId"
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
alertClass="alert-warning"
|
||||
:manualHeadline="alertFewMoreQuestionsHeader"
|
||||
:manualCopy="alertFewMoreQuestionsCopy"
|
||||
v-bind:isDismissible="false"
|
||||
v-bind:isDismissible="false"
|
||||
class="mt-5"/>
|
||||
<div v-for="(questionsDatum, i) in questionsData" :key="questionsDatum.key">
|
||||
<questionChain
|
||||
|
|
@ -29,6 +29,7 @@
|
|||
:validationRules="validationRules" />
|
||||
</div>
|
||||
<siteFooter
|
||||
class="mt-3"
|
||||
ref="siteFooter"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!isMetaValid"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
|
||||
<footer class="footer container-fluid g-5 px-0 py-3 " id="infoBox">
|
||||
<div class="row d-flex flex-row-reverse align-items-center vw-100 mx-0">
|
||||
<div class="col button-col d-flex px-0" id="stacked" >
|
||||
<buttonMain
|
||||
<div>
|
||||
<footer class="footer container-fluid g-5 px-0" id="infoBox">
|
||||
<div class="row d-flex flex-row-reverse align-items-center vw-100 mx-0">
|
||||
<div class="col button-col d-flex px-0" id="stacked" >
|
||||
<buttonMain
|
||||
v-if="!isForwardButtonHidden"
|
||||
ref="buttonMain"
|
||||
isPrimary
|
||||
|
|
@ -16,9 +16,9 @@
|
|||
data-bs-target="#footerModal"
|
||||
data-bs-dismiss="modal"
|
||||
data-test-id="site-footer-main-button" />
|
||||
</div>
|
||||
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 px-0 text-break">
|
||||
<textLink
|
||||
</div>
|
||||
<div v-if="!isBackButtonHidden" class="col-auto link-col py-1 px-0 text-break">
|
||||
<textLink
|
||||
linkType="navigation"
|
||||
:text="backLink"
|
||||
@click-event="linkClick"
|
||||
|
|
@ -26,11 +26,12 @@
|
|||
data-bs-target="#footerModal"
|
||||
data-bs-dismiss="modal"
|
||||
data-test-id="site-footer-back-button" />
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
<div class="footerImage" id="imgCity" v-if="footerImageURL" >
|
||||
<img id="siteFooterImage" :src="footerImageURL" />
|
||||
</div>
|
||||
</footer>
|
||||
<div class="footerImage" id="imgCity" v-if="footerImageURL" >
|
||||
<img id="siteFooterImage" :src="footerImageURL" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -77,8 +78,8 @@ export default {
|
|||
},
|
||||
buttonText() {
|
||||
return this.customButtontext
|
||||
? this.customButtontext
|
||||
: this.getCmsContent(this.cmsWidgetName, "ForwardButtonText");
|
||||
? this.customButtontext
|
||||
: this.getCmsContent(this.cmsWidgetName, "ForwardButtonText");
|
||||
},
|
||||
footerImageURL()
|
||||
{
|
||||
|
|
@ -126,6 +127,7 @@ export default {
|
|||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
display: flex;
|
||||
overflow: visible;
|
||||
a {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<div class="menu-modal-container">
|
||||
<button class="menu-button" type="button" :class="[isActive ? 'active' : '']" data-bs-toggle="modal" data-bs-target="#footerModal" aria-label="Hamburger Menu (modal window)">
|
||||
<button class="menu-button" type="button" :class="[isActive ? 'active' : '']" aria-label="Hamburger Menu (modal window)" @click="toggle()">
|
||||
<div class="bar1"></div>
|
||||
<div class="bar2"></div>
|
||||
<div class="bar3"></div>
|
||||
</button>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal menu-modal fade" data-bs-backdrop="false" id="footerModal" tabindex="-1" aria-labelledby="footerModalLabel" aria-hidden="true" v-on="{ 'show.bs.modal' : show, 'hide.bs.modal' : hide }">
|
||||
<div class="modal menu-modal fade" data-bs-backdrop="false" id="footerModal" tabindex="-1" aria-labelledby="footerModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-fullscreen">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header visually-hidden">
|
||||
|
|
@ -53,6 +53,8 @@
|
|||
|
||||
<script>
|
||||
import textLink from "@/ux-components/text-link/text-link";
|
||||
import { Modal } from "bootstrap";
|
||||
|
||||
export default {
|
||||
name: 'menuModal',
|
||||
data() {
|
||||
|
|
@ -62,17 +64,25 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.currentFooterAndHeaderHeight = this.getFooterInfoBoxHeight() + 56;
|
||||
this.isActive = true;
|
||||
document.querySelector('.fade-on-route-transition').scrollTo({
|
||||
top: 0, behavior: 'instant'
|
||||
});
|
||||
},
|
||||
hide() {
|
||||
var self = this;
|
||||
self.isActive = false;
|
||||
},
|
||||
toggle() {
|
||||
if(this.isActive){
|
||||
//hide modal
|
||||
this.isActive = false;
|
||||
const modal = Modal.getInstance(document.getElementById("footerModal"));
|
||||
modal?.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
//show modal
|
||||
this.currentFooterAndHeaderHeight = this.getFooterInfoBoxHeight() + 56;
|
||||
this.isActive = true;
|
||||
const modal = Modal.getOrCreateInstance(document.getElementById("footerModal"));
|
||||
modal?.show();
|
||||
document.querySelector('.fade-on-route-transition').scrollTo({
|
||||
top: 0, behavior: 'instant'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
textLink,
|
||||
|
|
@ -127,6 +137,7 @@ export default {
|
|||
border-top: 1px solid $gray-300;
|
||||
overflow-x: visible;
|
||||
overflow-y: visible;
|
||||
z-index: 2;
|
||||
.modal-body {
|
||||
padding: 2rem;
|
||||
.ccpa-icon {
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ export default({
|
|||
<style lang="scss" scoped>
|
||||
.site-header {
|
||||
height: 56px;
|
||||
position: relative;
|
||||
}
|
||||
.alert {
|
||||
left: 0;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ import buttonBack from "@/iss-components/site-sub-header/button-back/button-back
|
|||
cmsWidgetName: String,
|
||||
hasBackButton: Boolean,
|
||||
justification: String,
|
||||
issContainingPage: String
|
||||
issContainingPage: String,
|
||||
darkGraySubText: Boolean,
|
||||
},
|
||||
computed: {
|
||||
content() {
|
||||
|
|
@ -53,9 +54,15 @@ import buttonBack from "@/iss-components/site-sub-header/button-back/button-back
|
|||
'justify-content-center';
|
||||
},
|
||||
alternateFormatting() {
|
||||
return (this.issContainingPage?.toLowerCase() === 'service-packages') ?
|
||||
'service-packages-subtext mt-4 mb-2 px-5' :
|
||||
'small';
|
||||
//override for service-packages unique style
|
||||
if (this.issContainingPage?.toLowerCase() === 'service-packages')
|
||||
{
|
||||
return 'service-packages-subtext mt-4 mb-2 px-5';
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.darkGraySubText ? "dark-gray" : "light-gray";
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -84,9 +91,14 @@ import buttonBack from "@/iss-components/site-sub-header/button-back/button-back
|
|||
color: inherit;
|
||||
}
|
||||
}
|
||||
p.small {
|
||||
p.light-gray {
|
||||
color: $gray-550;
|
||||
}
|
||||
|
||||
p.dark-gray {
|
||||
color: $darker-gray;
|
||||
}
|
||||
|
||||
p.service-packages-subtext {
|
||||
font-weight: 500 !important;
|
||||
line-height: 24px;
|
||||
|
|
|
|||
|
|
@ -41,14 +41,13 @@
|
|||
<alert
|
||||
ref="alertVinLookupsByHomeAddressNotAllowed"
|
||||
v-if="displayVinLookupByHomeAddressNotAllowedAlert"
|
||||
class="mb-4 mt-4"
|
||||
class="mt-4"
|
||||
cmsWidgetName="AlertVinLookupsByHomeAddressNotAllowedWidget"
|
||||
alertClass="alert-danger"
|
||||
v-bind:isDismissible="false" />
|
||||
|
||||
<customerQuestions ref="customerQuestions" v-model="customerQuestions" />
|
||||
|
||||
<siteFooter
|
||||
class="mt-5"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
ref="siteFooter"
|
||||
:isDisabled="!meta.valid"
|
||||
|
|
@ -234,7 +233,7 @@ export default {
|
|||
isSelectedGlassAvailableForVehicle: this.isSelectedGlassAvailableForVehicle,
|
||||
vehicleInfo:
|
||||
Object.keys(vehicleInfoToCommit).length === 0
|
||||
? useMainStore().order.vehicle
|
||||
? null
|
||||
: vehicleInfoToCommit,
|
||||
registrationInfo: {
|
||||
firstName: this.customerQuestions.firstName,
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
validationRules="state-required"
|
||||
class="mt-4 mb-2"/>
|
||||
<siteFooter
|
||||
class="mt-5"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
cms-widget-name="SiteFooterWidget"
|
||||
@back-clicked="backButtonAction"
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<siteFooter
|
||||
class="mt-5"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
ref="siteFooter"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
|
|
@ -66,7 +67,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
customerQuestions: this.getPolicyHolderDetailsFromStore(),
|
||||
vehiclesFound: [],
|
||||
vehiclesFound: [],
|
||||
};
|
||||
},
|
||||
setup() {
|
||||
|
|
@ -91,8 +92,8 @@ export default {
|
|||
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
methods:
|
||||
{
|
||||
|
|
@ -101,8 +102,8 @@ export default {
|
|||
},
|
||||
|
||||
async forwardButtonAction()
|
||||
{
|
||||
this.mainStore.updatePolicyHolderDetails(this.customerQuestions);
|
||||
{
|
||||
this.mainStore.updatePolicyHolderDetails(this.customerQuestions);
|
||||
return this.navigateForward();
|
||||
},
|
||||
|
||||
|
|
@ -114,7 +115,7 @@ export default {
|
|||
{},
|
||||
{},
|
||||
this.vehiclesFound
|
||||
);
|
||||
);
|
||||
else
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_UNVERIFIED,
|
||||
|
|
@ -135,7 +136,7 @@ export default {
|
|||
firstName : this.mainStore.order.customer.firstName,
|
||||
lastName : this.mainStore.order.customer.lastName,
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
computed:{
|
||||
isCoverageEnabled(){
|
||||
|
|
@ -143,7 +144,7 @@ export default {
|
|||
},
|
||||
vehiclesCount(){
|
||||
return this.vehiclesFound.length;
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
siteHeader,
|
||||
|
|
|
|||
|
|
@ -1,43 +1,34 @@
|
|||
import policyVehicles from "@/layouts/policy-vehicles/policy-vehicles";
|
||||
import { settleAllPromises } from "@/helpers/layout-helper.js";
|
||||
import { shallowMount } from "@vue/test-utils";
|
||||
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||
import { useMainStore } from "@/store";
|
||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||
import {vehicleSelectionOptions} from "@/constants/vehicle-selection-options";
|
||||
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
|
||||
import baseMixin from "@/mixins/base-mixin";
|
||||
import { getRandomString, getRandomInt } from '@/helpers/data-generation.js';
|
||||
import { endorsementOptions } from '@/constants/endorsement-options.js';
|
||||
import policyVehicles from '@/layouts/policy-vehicles/policy-vehicles.vue';
|
||||
import { settleAllPromises } from '@/helpers/layout-helper';
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import { getMountOptions } from '@/helpers/unit-test-helper';
|
||||
import { useMainStore } from '@/store';
|
||||
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper';
|
||||
import { navigationScenarios } from '@/router/router-constants/navigation-scenarios';
|
||||
import baseMixin from '@/mixins/base-mixin';
|
||||
import { getRandomString, getRandomInt } from '@/helpers/data-generation';
|
||||
import { endorsementOptions } from '@/constants/endorsement-options';
|
||||
import { createTestingPinia } from '@pinia/testing';
|
||||
import { issPageValues } from "@/router/router-constants/issPage-values";
|
||||
import { vehicleSelectionOptions } from "@/constants/vehicle-selection-options";
|
||||
|
||||
// Mock fetchCmsContentForPage
|
||||
jest.mock("@/helpers/cms-content-helper", () => ({
|
||||
jest.mock('@/helpers/cms-content-helper', () => ({
|
||||
fetchCmsContentForPage: jest.fn(),
|
||||
doesCopyContainRouterLink: jest.fn(),
|
||||
splitCopyOnCMSPlaceHolder: jest.fn().mockImplementation(() => "test"),
|
||||
splitCopyOnCMSPlaceHolder: jest.fn().mockImplementation(() => 'test'),
|
||||
getRouterLinkRouteFromCopy: jest.fn(),
|
||||
getRouterLinkDisplayTextFromCopy: jest.fn(),
|
||||
splitCMSCopyOnParagraphTag: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock our module for promises.
|
||||
jest.mock("@/helpers/layout-helper.js", () => ({
|
||||
jest.mock('@/helpers/layout-helper.js', () => ({
|
||||
settleAllPromises: jest.fn(),
|
||||
}));
|
||||
|
||||
describe("policy-vehicles.vue", () => {
|
||||
test("Should navigate to CLICKED_BACK if backButtonAction is run", async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
// Act
|
||||
await wrapper.vm.backButtonAction();
|
||||
|
||||
//Assert
|
||||
expect(wrapper.vm.$router.navigate).toBeCalled();
|
||||
});
|
||||
test("Should navigate to CLICKED_BACK if backButtonAction is run", async () => {
|
||||
describe('policy-vehicles.vue', () => {
|
||||
test('Should navigate to CLICKED_BACK if backButtonAction is run', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -48,9 +39,9 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(wrapper.vm.$router.navigate).toBeCalled();
|
||||
});
|
||||
|
||||
describe("forwardButtonAction", () => {
|
||||
describe('forwardButtonAction', () => {
|
||||
|
||||
test("Selected VIN matches vehicle listed in system => update vehicle and navigate forward with CLICKED_FORWARD_LISTED_VEHICLE scenario.", async () => {
|
||||
test('Selected VIN matches vehicle listed in system => update vehicle and navigate forward with CLICKED_FORWARD_LISTED_VEHICLE scenario.', async () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -94,10 +85,10 @@ describe("policy-vehicles.vue", () => {
|
|||
);
|
||||
});
|
||||
|
||||
test("Error in lookupVehicleByVin call => bailout true and navigate forward with CLICKED_FORWARD_WITH_BAILOUT scenario.", async () => {
|
||||
test('Error in lookupVehicleByVin call => bailout true and navigate forward with CLICKED_FORWARD_WITH_BAILOUT scenario.', async () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
||||
const vin = getRandomString(17,17);
|
||||
await wrapper.setData({
|
||||
selectedVehicleVin: vin,
|
||||
|
|
@ -120,7 +111,7 @@ describe("policy-vehicles.vue", () => {
|
|||
);
|
||||
});
|
||||
|
||||
test("vehicle not listed => navigate forward with CLICKED_FORWARD_NON_LISTED_VEHICLE scenario.", async () => {
|
||||
test('vehicle not listed => navigate forward with CLICKED_FORWARD_NON_LISTED_VEHICLE scenario.', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks({});
|
||||
|
||||
|
|
@ -141,8 +132,8 @@ describe("policy-vehicles.vue", () => {
|
|||
});
|
||||
})
|
||||
|
||||
describe("noCompensationForSelectedVehicle computed property", () => {
|
||||
it("No vehicle match => returns true", async () => {
|
||||
describe('noCompensationForSelectedVehicle computed property', () => {
|
||||
it('No vehicle match => returns true', async () => {
|
||||
// Arrange
|
||||
const selectedVin = getRandomString(17,17);
|
||||
const otherVin = getRandomString(17,17);
|
||||
|
|
@ -162,7 +153,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it("Coverages list empty => true", () => {
|
||||
it('Coverages list empty => true', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const testValues = {
|
||||
|
|
@ -182,7 +173,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBeTruthy();
|
||||
});
|
||||
|
||||
it("Coverages list non-empty => false", () => {
|
||||
it('Coverages list non-empty => false', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const testValues = {
|
||||
|
|
@ -207,9 +198,9 @@ describe("policy-vehicles.vue", () => {
|
|||
});
|
||||
})
|
||||
|
||||
describe("deductibleForSelectedVehicle computed property", () => {
|
||||
describe('deductibleForSelectedVehicle computed property', () => {
|
||||
|
||||
it("No vehicle match => undefined returned", () => {
|
||||
it('No vehicle match => undefined returned', () => {
|
||||
// Arrange
|
||||
const selectedVin = getRandomString(17,17);
|
||||
const otherVin = getRandomString(17,17);
|
||||
|
|
@ -229,7 +220,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBe(undefined);
|
||||
});
|
||||
|
||||
it("Vehicle match with empty coverages list => 0 returned", () => {
|
||||
it('Vehicle match with empty coverages list => 0 returned', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const testValues = {
|
||||
|
|
@ -249,7 +240,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBe(0);
|
||||
});
|
||||
|
||||
it("Coverages list non empty => deductible from first coverage returned", () => {
|
||||
it('Coverages list non empty => deductible from first coverage returned', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const firstDeductible = getRandomInt(1,1000);
|
||||
|
|
@ -277,11 +268,11 @@ describe("policy-vehicles.vue", () => {
|
|||
// Assert
|
||||
expect(result).toBe(firstDeductible);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
describe("repairWaivedForSelectedVehicle computed property", () => {
|
||||
describe('repairWaivedForSelectedVehicle computed property', () => {
|
||||
|
||||
it("No vehicle match => false returned", () => {
|
||||
it('No vehicle match => false returned', () => {
|
||||
// Arrange
|
||||
const selectedVin = getRandomString(17,17);
|
||||
const otherVin = getRandomString(17,17);
|
||||
|
|
@ -301,7 +292,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("Endorsements list empty => false returned", () => {
|
||||
it('Endorsements list empty => false returned', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const testValues = {
|
||||
|
|
@ -321,7 +312,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("Endorsements list non-empty, not containing repair waived => false returned", () => {
|
||||
it('Endorsements list non-empty, not containing repair waived => false returned', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const testValues = {
|
||||
|
|
@ -341,7 +332,7 @@ describe("policy-vehicles.vue", () => {
|
|||
expect(result).toBe(false);
|
||||
});
|
||||
|
||||
it("Endorsements list contains repair waived => true returned", () => {
|
||||
it('Endorsements list contains repair waived => true returned', () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
const testValues = {
|
||||
|
|
@ -364,7 +355,25 @@ describe("policy-vehicles.vue", () => {
|
|||
// Assert
|
||||
expect(result).toBe(true);
|
||||
});
|
||||
})
|
||||
});
|
||||
|
||||
test('first vehicle is auto-selected if only one vehicle on policy', async () => {
|
||||
// Arrange
|
||||
const vin = getRandomString(17,17);
|
||||
useMainStore().applicationUser = {
|
||||
pageData: {
|
||||
[issPageValues.POLICY_VEHICLES]: [ { vin: vin } ],
|
||||
}
|
||||
};
|
||||
|
||||
const { wrapper } = setupMocks();
|
||||
|
||||
// Act
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.selectedVehicleVin).toBe(vin);
|
||||
});
|
||||
});
|
||||
|
||||
const mockMixin = {
|
||||
|
|
@ -373,7 +382,7 @@ const mockMixin = {
|
|||
},
|
||||
computed: {
|
||||
dynamicStrings() {
|
||||
return { ROUTER_LINK: "routerLink:" };
|
||||
return { ROUTER_LINK: 'routerLink:' };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -408,7 +417,7 @@ function setupMocks()
|
|||
fetchCmsContentForPage.mockImplementation(() => Promise.resolve());
|
||||
|
||||
const wrapper = shallowMount(policyVehicles, mountOptions);
|
||||
wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => "");
|
||||
wrapper.vm.getCmsContent = jest.fn().mockImplementation(() => '');
|
||||
wrapper.vm.setCmsContent = jest.fn();
|
||||
wrapper.vm.setCmsContent = baseMixin.methods.setCmsContent;
|
||||
wrapper.vm.$refs.siteFooter.updateButtonText = jest.fn();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded text-center">
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="true" class="mt-2 mb-4" />
|
||||
<vehicleBanner cmsWidgetName="VehicleBannerWidget" :displayGenericVehicleImage="displayGeneric" class="mt-2 mb-4" />
|
||||
<policyVehiclesQuestion
|
||||
class="px-4"
|
||||
cmsWidgetName="PolicyVehiclesQuestion"
|
||||
|
|
@ -53,12 +53,16 @@ export default {
|
|||
const policyVehicles = useMainStore().pageData(issPageValues.POLICY_VEHICLES);
|
||||
return {
|
||||
policyVehicles: policyVehicles,
|
||||
selectedVehicleVin: (policyVehicles?.length ?? 0) == 0
|
||||
? ""
|
||||
: policyVehicles[0].vin,
|
||||
selectedVehicleVin: (policyVehicles?.length ?? 0) == 1
|
||||
? policyVehicles[0].vin
|
||||
: "",
|
||||
displayGeneric: true,
|
||||
bailout: false
|
||||
}
|
||||
},
|
||||
// mounted() {
|
||||
// this.autoSelectIfOneVehicle();
|
||||
// },
|
||||
async beforeRouteEnter(to, from, next)
|
||||
{
|
||||
// Call APIs
|
||||
|
|
@ -133,8 +137,13 @@ export default {
|
|||
error: true,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
// autoSelectIfOneVehicle() {
|
||||
// if (this.policyVehicles.length == 1) {
|
||||
// this.selectedVehicleVin = this.policyVehicles[0].vin;
|
||||
// }
|
||||
// }
|
||||
},
|
||||
computed:{
|
||||
VehiclesForQuestions() {
|
||||
|
|
@ -171,8 +180,58 @@ export default {
|
|||
repairWaivedForSelectedVehicle() {
|
||||
const vehicle = this.policyVehicles.find((vehicle) => { return vehicle.vin == this.selectedVehicleVin; });
|
||||
return vehicle?.endorsements?.includes(endorsementOptions.REPAIR_WAIVED) ?? false;
|
||||
}
|
||||
},
|
||||
VehiclesFromApi() {
|
||||
return useMainStore().pageData(issPageValues.POLICY_VEHICLES);
|
||||
},
|
||||
selectedVehicle() {
|
||||
const vehicle = this.mainStore.lookupVehicleByVin(this.selectedVehicleVin);
|
||||
return vehicle;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
async selectedVehicleVin(value) {
|
||||
if (value === vehicleSelectionOptions.VEHICLE_NOT_LISTED) {
|
||||
// clear previously selected vehicle and image
|
||||
this.mainStore.resetVehicleState();
|
||||
this.displayGeneric = true;
|
||||
}
|
||||
|
||||
else {
|
||||
// get vehicle details from selected VIN
|
||||
const vehicle = await this.lookupVehicleByVin(value);
|
||||
|
||||
// handle error in case vehicle info doesn't come back for selected VIN
|
||||
if (vehicle?.error ?? true) {
|
||||
this.mainStore.resetVehicleState();
|
||||
this.displayGeneric = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// save selected vehicle to the store
|
||||
this.mainStore.updateVehicle(vehicle.data);
|
||||
this.displayGeneric = true;
|
||||
|
||||
// get the style(s) associated with the selected YMM
|
||||
const styleOptions = await this.mainStore.getVehicleStyles(
|
||||
vehicle.data.year,
|
||||
vehicle.data.make,
|
||||
vehicle.data.model
|
||||
)
|
||||
|
||||
// if there is more than 1 style for the selected vehicle, display generic/blurred image
|
||||
this.displayGeneric = styleOptions?.data?.length > 1;
|
||||
|
||||
// if (styleOptions?.data?.length > 1) {
|
||||
// = true;
|
||||
// }
|
||||
// else {
|
||||
// // display clear image of vehicle
|
||||
// this.displayGeneric = false;
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
siteHeader,
|
||||
siteFooter,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
class="mx-5" />
|
||||
<div class="px-5">
|
||||
<siteFooter
|
||||
class="mt-5"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="isForwardActionDisabled"
|
||||
@backClicked="backButtonAction"
|
||||
|
|
@ -26,16 +27,16 @@
|
|||
</div>
|
||||
<recalModal ref="recalModal" cmsWidgetName="RecalModal" />
|
||||
<steeringModal cmsWidgetName="StateSteeringModal" ref="StateSteeringModal" />
|
||||
<shopPreferenceModal
|
||||
cmsWidgetName="ShopPreferenceDrawer"
|
||||
ref="ShopPreferenceDrawer"
|
||||
<shopPreferenceModal
|
||||
cmsWidgetName="ShopPreferenceDrawer"
|
||||
ref="ShopPreferenceDrawer"
|
||||
@openSteering="openStateSteeringModal"
|
||||
:showSteeringLink="showSteeringLink"/>
|
||||
<tpaRecalModal cmsWidgetName="TPARecalModal"
|
||||
<tpaRecalModal cmsWidgetName="TPARecalModal"
|
||||
ref="TPARecalModal"
|
||||
:ackError="ackError"
|
||||
:ackError="ackError"
|
||||
@buttonClick="navigateWithTPAAck"
|
||||
/>
|
||||
/>
|
||||
</Form>
|
||||
|
||||
</template>
|
||||
|
|
@ -159,12 +160,12 @@ export default {
|
|||
this.$router.navigate(scenario, this.$route);
|
||||
},
|
||||
navigateWithTPAAck() {
|
||||
this.mainStore.saveProviderPreferenceData({selectedProvider: this.selectedProvider, tpaAcknowledgement: this.tpaAcknowledgement});
|
||||
this.mainStore.saveProviderPreferenceData({selectedProvider: this.selectedProvider, tpaAcknowledgement: this.tpaAcknowledgement});
|
||||
this.navigateForward(this.navigationScenarios.CLICKED_FORWARD_WITH_TPA_ENABLED);
|
||||
},
|
||||
forwardButtonAction() {
|
||||
if(this.selectedProvider) {
|
||||
let scenario = null;
|
||||
let scenario = null;
|
||||
switch (this.selectedProvider) {
|
||||
case options.SAFELITE:
|
||||
scenario = this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE;
|
||||
|
|
@ -186,7 +187,7 @@ export default {
|
|||
break;
|
||||
};
|
||||
this.navigateForward(scenario);
|
||||
this.mainStore.saveProviderPreferenceData({selectedProvider: this.selectedProvider, tpaAcknowledgement: this.tpaAcknowledgement});
|
||||
this.mainStore.saveProviderPreferenceData({selectedProvider: this.selectedProvider, tpaAcknowledgement: this.tpaAcknowledgement});
|
||||
}
|
||||
},
|
||||
openStateSteeringModal() {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<div class="container-fluid pb-2">
|
||||
<p>Placeholder for schedule page</p>
|
||||
<siteFooter
|
||||
class="mt-5"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
ref="siteFooter"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@
|
|||
validationRules="selection-required"
|
||||
class="service-location-button-question mb-1"/>
|
||||
<div class="select-car">
|
||||
<div class="container-fluid pb-2">
|
||||
<div class="container-fluid pb-2 g-0">
|
||||
<div class="row">
|
||||
<div class="col px-0">
|
||||
<div class="select-car-form rounded">
|
||||
<siteFooter
|
||||
class="mt-4"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@backClicked="backButtonAction"
|
||||
|
|
@ -89,7 +90,7 @@ export default {
|
|||
const zipCodeData = getZipCodeData(serviceZipCode);
|
||||
|
||||
const serviceabilityDetailsPromise = getServiceabilityDetails(serviceZipCode);
|
||||
|
||||
|
||||
// Settle promises and get results
|
||||
const promiseResultMap = [
|
||||
{
|
||||
|
|
@ -107,7 +108,7 @@ export default {
|
|||
];
|
||||
|
||||
const resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
||||
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.setData(
|
||||
|
|
@ -161,7 +162,7 @@ export default {
|
|||
},
|
||||
displayMilitaryZipAlert() {
|
||||
return this.zipContainsMilitaryBase && this.isServiceableMobile;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
arePagePrerequisiteValid() {
|
||||
|
|
@ -258,11 +259,11 @@ export default {
|
|||
.service-location-button-question {
|
||||
.question-text {
|
||||
margin-top: 1.5rem;
|
||||
|
||||
|
||||
span {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@
|
|||
groupName="BackGlassReplaceOptionsQuestion"
|
||||
validationRules="replace-options-required" />
|
||||
<site-footer
|
||||
class="mt-5"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@backClicked="backButtonAction"
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<VehicleBanner class="mt-2 mb-4" cms-widget-name="VehicleBannerWidget" :display-generic-vehicle-image="false" />
|
||||
<SiteSubHeader cms-widget-name="SiteSubHeaderWidget" class="mt-5 mb-2" />
|
||||
<VinLookupMethods v-model="selectedVinLookupMethod" cms-widget-name="VINLookupMethod" group-name="VinLookupMethods" ref="VinLookupMethods" />
|
||||
<SiteFooter cms-widget-name="SiteFooterWidget" :is-forward-action-disabled="isForwardActionDisabled" @back-clicked="backButtonAction" @forward-clicked="forwardButtonAction" />
|
||||
<SiteFooter cms-widget-name="SiteFooterWidget" :is-forward-action-disabled="isForwardActionDisabled" @back-clicked="backButtonAction" @forward-clicked="forwardButtonAction" class="mt-3"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -181,12 +181,12 @@ export default {
|
|||
},
|
||||
|
||||
AutoSelectIfSinglePart() {
|
||||
if (this.partsForSelectedTint?.length > 0)
|
||||
if (this.partsForSelectedTint?.length > 0)
|
||||
{
|
||||
// Check if only a single part is present for the tint and set the v-model if it is.
|
||||
if (this.partsForSelectedTint?.length == 1) {
|
||||
this.selectedPartNumber = { value: this.partsForSelectedTint[0].partNumber };
|
||||
|
||||
|
||||
// //select element with matching partNumber
|
||||
this.$nextTick(() => {
|
||||
const radioInput = document.querySelector('input[value=' + this.selectedPartNumber + ']');
|
||||
|
|
@ -199,7 +199,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Loads the preselected values from the store.
|
||||
LoadPreselectedValues() {
|
||||
this.$nextTick(() => {
|
||||
|
|
@ -208,7 +208,7 @@ export default {
|
|||
{
|
||||
this.selectedTint = this.modelValue.color;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }" >
|
||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }" >
|
||||
<div class="page-container-grouped-styles position-relative">
|
||||
<div class="fade-on-route-transition position-relative">
|
||||
<siteHeader cmsWidgetName="SiteHeaderWidget" />
|
||||
|
|
@ -8,57 +8,59 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="select-car-form rounded">
|
||||
<siteSubHeader
|
||||
cmsWidgetName="SiteSubHeaderWidget"
|
||||
<siteSubHeader
|
||||
cmsWidgetName="SiteSubHeaderWidget"
|
||||
class="siteSubHeader"
|
||||
justification="left"
|
||||
justification="center"
|
||||
darkGraySubText
|
||||
/>
|
||||
|
||||
<vehicleQuestion
|
||||
ref="vehicleYearQuestion"
|
||||
class="mb-2 mt-4"
|
||||
v-model="selectedYear"
|
||||
cmsWidgetName="VehicleYearQuestion"
|
||||
:updateValues="updateYearValues"
|
||||
validationRules="year-required"
|
||||
|
||||
<vehicleQuestion
|
||||
ref="vehicleYearQuestion"
|
||||
class="mb-2 mt-4"
|
||||
v-model="selectedYear"
|
||||
cmsWidgetName="VehicleYearQuestion"
|
||||
:updateValues="updateYearValues"
|
||||
validationRules="year-required"
|
||||
inputId="yearQuestionField"
|
||||
/>
|
||||
<vehicleQuestion
|
||||
ref="vehicleMakeQuestion"
|
||||
class="mb-2 mt-4"
|
||||
<vehicleQuestion
|
||||
ref="vehicleMakeQuestion"
|
||||
class="mb-2 mt-4"
|
||||
v-model="selectedMake"
|
||||
cmsWidgetName="VehicleMakeQuestion"
|
||||
:updateValues="updateMakeValues"
|
||||
validationRules="make-required"
|
||||
cmsWidgetName="VehicleMakeQuestion"
|
||||
:updateValues="updateMakeValues"
|
||||
validationRules="make-required"
|
||||
inputId="makeQuestionField"
|
||||
/>
|
||||
<vehicleQuestion
|
||||
ref="vehicleModelQuestion"
|
||||
class="mb-2 mt-4"
|
||||
<vehicleQuestion
|
||||
ref="vehicleModelQuestion"
|
||||
class="mb-2 mt-4"
|
||||
v-model="selectedModel"
|
||||
cmsWidgetName="VehicleModelQuestion"
|
||||
:updateValues="updateModelValues"
|
||||
validationRules="model-required"
|
||||
cmsWidgetName="VehicleModelQuestion"
|
||||
:updateValues="updateModelValues"
|
||||
validationRules="model-required"
|
||||
inputId="modelQuestionField"
|
||||
/>
|
||||
<vehicleQuestion
|
||||
ref="vehicleStyleQuestion"
|
||||
class="mb-2 mt-4"
|
||||
<vehicleQuestion
|
||||
ref="vehicleStyleQuestion"
|
||||
class="mb-2 mt-4"
|
||||
v-model="selectedStyle"
|
||||
cmsWidgetName="VehicleStyleQuestion"
|
||||
:updateValues="updateStyleValues"
|
||||
validationRules="style-required"
|
||||
cmsWidgetName="VehicleStyleQuestion"
|
||||
:updateValues="updateStyleValues"
|
||||
validationRules="style-required"
|
||||
inputId="styleQuestionField"
|
||||
/>
|
||||
|
||||
<vehicleBanner
|
||||
cmsWidgetName="VehicleBannerWidget"
|
||||
:displayGenericVehicleImage="displayGeneric"
|
||||
class="mt-5 mb-3"
|
||||
|
||||
<vehicleBanner
|
||||
cmsWidgetName="VehicleBannerWidget"
|
||||
:displayGenericVehicleImage="displayGeneric"
|
||||
class="mt-5 mb-3"
|
||||
ref="banner"
|
||||
/>
|
||||
|
||||
|
||||
<siteFooter
|
||||
class="mt-5"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
@ForwardClicked="forwardButtonAction"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
|
|
@ -106,33 +108,33 @@ export default {
|
|||
selectedYear: null,
|
||||
selectedMake: null,
|
||||
selectedModel: null,
|
||||
selectedStyle: null,
|
||||
selectedStyle: null,
|
||||
};
|
||||
},
|
||||
props:{
|
||||
cmsWidgetName:String,
|
||||
validationRules:String,
|
||||
},
|
||||
mounted(){
|
||||
mounted(){
|
||||
this.$refs["vehicleYearQuestion"].getNewValues();
|
||||
},
|
||||
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
// Call APIs
|
||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
|
||||
|
||||
// Settle promises and get results
|
||||
const promiseResultMap = [
|
||||
{
|
||||
resultKey: "cmsContent",
|
||||
promise: cmsContentPromise,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
let resultMap = await settleAllPromises(promiseResultMap);
|
||||
|
||||
// Call the "next" function to complete the transition to this page.
|
||||
next((vm) => {
|
||||
next((vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
});
|
||||
},
|
||||
|
|
@ -140,33 +142,28 @@ export default {
|
|||
watch: {
|
||||
selectedYear(value) {
|
||||
this.mainStore.updateVehicleYear(value);
|
||||
this.$refs["vehicleMakeQuestion"].clearValues();
|
||||
if(value)
|
||||
{
|
||||
{
|
||||
this.$refs["vehicleMakeQuestion"].getNewValues();
|
||||
}
|
||||
else{
|
||||
this.$refs["vehicleMakeQuestion"].clearValues();
|
||||
}
|
||||
},
|
||||
selectedMake(value) {
|
||||
this.mainStore.updateVehicleMake(value);
|
||||
this.$refs["vehicleModelQuestion"].clearValues();
|
||||
if(value)
|
||||
{
|
||||
{
|
||||
this.$refs["vehicleModelQuestion"].getNewValues();
|
||||
}
|
||||
else{
|
||||
this.$refs["vehicleModelQuestion"].clearValues();
|
||||
}
|
||||
},
|
||||
selectedModel(value) {
|
||||
this.mainStore.updateVehicleModel(value);
|
||||
this.$refs["vehicleStyleQuestion"].clearValues();
|
||||
if(value)
|
||||
{
|
||||
{
|
||||
this.$refs["vehicleStyleQuestion"].getNewValues();
|
||||
}
|
||||
else{
|
||||
this.$refs["vehicleStyleQuestion"].clearValues();
|
||||
}
|
||||
|
||||
},
|
||||
selectedStyle(value) {
|
||||
this.mainStore.updateVehicleStyle(value);
|
||||
|
|
@ -191,7 +188,7 @@ export default {
|
|||
this.$route
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
async updateYearValues() {
|
||||
return await useMainStore().getVehicleYears();
|
||||
},
|
||||
|
|
@ -232,6 +229,6 @@ export default {
|
|||
|
||||
.subheader-secondary {
|
||||
margin-top: .5rem;
|
||||
padding: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ const vehicleWithNoAdditionalPartsOrQuestionsMockResponse = {
|
|||
},
|
||||
};
|
||||
|
||||
jest.mock("bootstrap", () => ({
|
||||
getInstance: jest.fn(),
|
||||
getOrCreateInstance: jest.fn(),
|
||||
}));
|
||||
|
||||
const mockRoute = {
|
||||
query: {
|
||||
// Needed inside vehicle-questions-mixin
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<vinLookupAlerts class="mt-5" :activeAlertType="activeVehicleLookupAlertType" />
|
||||
<vinQuestion v-model="vin" :mask="vinMask" :isDisabled="vinPopulatedOnPageLoad" textPosition="left" />
|
||||
<vinLocationInformation />
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" :isForwardActionDisabled="!meta.valid" @backClicked="backButtonAction" @forwardClicked="forwardButtonAction" ref="siteFooter" />
|
||||
<siteFooter cmsWidgetName="SiteFooterWidget" :isForwardActionDisabled="!meta.valid" @backClicked="backButtonAction" @forwardClicked="forwardButtonAction" ref="siteFooter" class="mt-5" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -152,7 +152,7 @@ export default {
|
|||
this.bailout=true
|
||||
}
|
||||
|
||||
if(this.bailout){
|
||||
if(this.bailout){
|
||||
return this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_BAILOUT,
|
||||
this.$route);
|
||||
|
|
@ -188,6 +188,7 @@ export default {
|
|||
// navigate back to vehicle-damage
|
||||
if (this.isCarIdDifferentFromTheStore && !isSelectedGlassAvailableForVehicle) {
|
||||
this.mainStore.updateVehicle(this.vehicleFromLookup);
|
||||
this.mainStore.resetDamageState();
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS,
|
||||
this.$route,
|
||||
|
|
|
|||
|
|
@ -140,7 +140,8 @@
|
|||
</div>
|
||||
<div class="row position-sticky top-100" id="welcomeFooter">
|
||||
<div class="col">
|
||||
<site-footer
|
||||
<siteFooter
|
||||
class="mt-3"
|
||||
cmsWidgetName="SiteFooterWidget"
|
||||
:isForwardActionDisabled="!meta.valid"
|
||||
@back-clicked="backButtonAction"
|
||||
|
|
@ -259,12 +260,12 @@ export default {
|
|||
|
||||
const policyLookupResultMap = await settleAllPromises(promisePolicyLookupResultMap);
|
||||
const policyInfo = policyLookupResultMap.policyLookupResponse;
|
||||
|
||||
|
||||
// if policy lookup fails, navigate directly to policy-holder-details page
|
||||
if (!policyInfo) {
|
||||
this.navigateForward();
|
||||
}
|
||||
|
||||
|
||||
const policy = policyInfo.policies?.[0];
|
||||
if (policy) {
|
||||
//populate policy holder details from policy lookup
|
||||
|
|
@ -274,8 +275,8 @@ export default {
|
|||
this.mainStore.order.customer.address.zipCode = policy.insureds?.[0]?.zipCode;
|
||||
this.mainStore.order.customer.firstName = policy.insureds?.[0]?.firstName;
|
||||
this.mainStore.order.customer.lastName = policy.insureds?.[0]?.lastName;
|
||||
|
||||
//populate vehicles
|
||||
|
||||
//populate vehicles
|
||||
this.vehiclesFound = policy.vehicles;
|
||||
}
|
||||
return this.navigateForward(policy);
|
||||
|
|
@ -289,7 +290,7 @@ export default {
|
|||
// if policy lookup is successful and vehicles are found, navigate to policy-vehicles page
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_WITH_VEHICLES,
|
||||
this.$route,
|
||||
this.$route,
|
||||
{},
|
||||
{},
|
||||
this.vehiclesFound
|
||||
|
|
@ -312,7 +313,7 @@ export default {
|
|||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getWelcomePageModelFromStore() {
|
||||
return {
|
||||
policyNumber: this.mainStore.order.policy.policyNumber,
|
||||
|
|
|
|||
|
|
@ -24,11 +24,7 @@ export const issPageValues = {
|
|||
SCHEDULE_PAGE: 'schedule-page',
|
||||
VEHICLE_DAMAGE: 'vehicle-damage',
|
||||
VEHICLE_LOOKUP: 'vehicle-lookup',
|
||||
VEHICLE_MAKE: 'vehicle-make',
|
||||
VEHICLE_MODEL: 'vehicle-model',
|
||||
VEHICLE_PARTS: 'vehicle-parts',
|
||||
VEHICLE_STYLE: 'vehicle-style',
|
||||
VEHICLE_YEAR: 'vehicle-year',
|
||||
VEHICLE_SELECTION: 'vehicle-selection',
|
||||
VIN_LOOKUP: 'vin-lookup',
|
||||
TPA_SUBMIT: 'tpa-submit',
|
||||
|
|
|
|||
|
|
@ -17,58 +17,6 @@ const routingTable = function(store) {
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.VEHICLE_YEAR,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.POLICY_HOLDER_DETAILS
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.SELECTED_YEAR,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_MAKE
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.VEHICLE_MAKE,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_YEAR
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.SELECTED_MAKE,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_MODEL
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.VEHICLE_MODEL,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_MAKE
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.SELECTED_MODEL,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_STYLE
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.VEHICLE_STYLE,
|
||||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_MODEL
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.SELECTED_STYLE,
|
||||
destinationIssPageValue: issPageValues.VEHICLE_DAMAGE
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
issPageValue: issPageValues.VEHICLE_DAMAGE,
|
||||
maps: [
|
||||
|
|
|
|||
|
|
@ -988,7 +988,8 @@ export const useMainStore = defineStore({
|
|||
);
|
||||
|
||||
if (haveMoldingQuestionAnswersChanged) {
|
||||
this.resetPartsAndDependencies();
|
||||
this.updateGlassParts(null);
|
||||
this.updateSupportingItems(null);
|
||||
this.updateCapabilityQuestionAnswers(null);
|
||||
this.updatePageData({ page: issPageValues.CAPABILITY_QUESTIONS, data: null });
|
||||
}
|
||||
|
|
@ -1013,7 +1014,8 @@ export const useMainStore = defineStore({
|
|||
);
|
||||
|
||||
if (haveCapabilityQuestionAnswersChanged) {
|
||||
this.resetPartsAndDependencies();
|
||||
this.updateGlassParts(null);
|
||||
this.updateSupportingItems(null);
|
||||
}
|
||||
|
||||
// Save new values
|
||||
|
|
@ -1236,9 +1238,7 @@ export const useMainStore = defineStore({
|
|||
registrationInfo?.firstName !== this.order.vehicle.registration?.firstName ||
|
||||
registrationInfo?.lastName !== this.order.vehicle.registration?.lastName
|
||||
)
|
||||
{
|
||||
this.resetRegistrationAndDependencies();
|
||||
|
||||
{
|
||||
if (!isSelectedGlassAvailableForVehicle) {
|
||||
this.resetDamageState();
|
||||
this.resetGlassPartsState();
|
||||
|
|
@ -1248,7 +1248,11 @@ export const useMainStore = defineStore({
|
|||
this.updateRegistration(registrationInfo);
|
||||
};
|
||||
|
||||
this.updateVehicle(vehicleInfo);
|
||||
if(vehicleInfo)
|
||||
{
|
||||
this.updateVehicle(vehicleInfo);
|
||||
}
|
||||
|
||||
},
|
||||
saveVin({ isSelectedGlassAvailableForVehicle, vehicleInfo }) {
|
||||
//Reset dependent state when changing
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@ describe("Store", () => {
|
|||
let store;
|
||||
|
||||
const vueApp = createApp(App);
|
||||
const pinia = createPinia();
|
||||
vueApp.use(pinia);
|
||||
|
||||
beforeEach(() => {
|
||||
setActivePinia(createPinia());
|
||||
const pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
vueApp.use(pinia);
|
||||
store = useMainStore();
|
||||
store.applicationUser.eventBus = [];
|
||||
jest.resetAllMocks();
|
||||
|
|
|
|||
|
|
@ -1,139 +1,144 @@
|
|||
<template>
|
||||
<!-- Checkbox groups MUST be wrapped in a <fieldset> and <legend> tag and must contain tabindex -->
|
||||
<div class="ui-radio form-check" :class="[(errors.length > 0 || hasError) ? 'has-error' : '']">
|
||||
<input
|
||||
type="radio"
|
||||
class="form-check-input"
|
||||
aria-checked="false"
|
||||
:name="groupName"
|
||||
:id="buttonID"
|
||||
:aria-required="isRequired"
|
||||
:value="value"
|
||||
:v-model="checkValue"
|
||||
@change="handleCheckChange"
|
||||
:checked="checkValue"
|
||||
:validationRules="validationRules"
|
||||
/>
|
||||
<label class="d-flex align-items-start form-check-label" :for="buttonID">
|
||||
<p v-if="buttonLabel" class="m-0">{{ buttonLabel }}</p>
|
||||
<span v-if="screenReaderOnlyText" class="sr-only">{{
|
||||
screenReaderOnlyText
|
||||
}}</span>
|
||||
</label>
|
||||
<label class="d-inline-flex align-items-start form-check-label" :for="buttonID">
|
||||
<input
|
||||
type="radio"
|
||||
class="form-check-input"
|
||||
aria-checked="false"
|
||||
:name="groupName"
|
||||
:id="buttonID"
|
||||
:aria-required="isRequired"
|
||||
:value="value"
|
||||
:v-model="checkValue"
|
||||
@change="handleCheckChange"
|
||||
:checked="checkValue"
|
||||
:validationRules="validationRules"
|
||||
/>
|
||||
<p v-if="buttonLabel" class="m-0">{{ buttonLabel }}</p>
|
||||
<span v-if="screenReaderOnlyText" class="sr-only">{{
|
||||
screenReaderOnlyText
|
||||
}}</span>
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useField } from "vee-validate";
|
||||
|
||||
export default {
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { useField } from "vee-validate";
|
||||
|
||||
export default {
|
||||
name: "radio",
|
||||
props: {
|
||||
groupName: String,
|
||||
buttonLabel: String,
|
||||
buttonID: String,
|
||||
isRequired: Boolean,
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: "",
|
||||
},
|
||||
screenReaderOnlyText: String,
|
||||
selectedValues: String,
|
||||
hasError: Boolean,
|
||||
validationRules: String,
|
||||
valueToLogType: String,
|
||||
groupName: String,
|
||||
buttonLabel: String,
|
||||
buttonID: String,
|
||||
isRequired: Boolean,
|
||||
value: {
|
||||
type: [String, Number],
|
||||
default: "",
|
||||
},
|
||||
screenReaderOnlyText: String,
|
||||
selectedValues: String,
|
||||
hasError: Boolean,
|
||||
validationRules: String,
|
||||
valueToLogType: String,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
checkValue: Boolean,
|
||||
};
|
||||
return {
|
||||
checkValue: Boolean,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (this.selectedValues) {
|
||||
this.checkValue = this.selectedValues === this.value;
|
||||
this.handleCheckChange();
|
||||
} else{
|
||||
this.checkValue = false;
|
||||
}
|
||||
if (this.selectedValues) {
|
||||
this.checkValue = this.selectedValues === this.value;
|
||||
this.handleCheckChange();
|
||||
} else{
|
||||
this.checkValue = false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleCheckChange() {
|
||||
this.handleChange(this.value);
|
||||
const emitEvent = {
|
||||
checkValue: this.checkValue,
|
||||
value: this.value.toString(),
|
||||
buttonID: this.buttonID && this.buttonID.toString(),
|
||||
};
|
||||
|
||||
this.$emit("isCheckedChanged", emitEvent);
|
||||
this.$emit("update:modelValue", emitEvent);
|
||||
|
||||
},
|
||||
handleCheckChange() {
|
||||
this.handleChange(this.value);
|
||||
const emitEvent = {
|
||||
checkValue: this.checkValue,
|
||||
value: this.value.toString(),
|
||||
buttonID: this.buttonID && this.buttonID.toString(),
|
||||
};
|
||||
|
||||
this.$emit("isCheckedChanged", emitEvent);
|
||||
this.$emit("update:modelValue", emitEvent);
|
||||
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const inputType = "radio";
|
||||
const {
|
||||
value: inputValue,
|
||||
handleChange,
|
||||
errors,
|
||||
} = useField(props.groupName, props.validationRules,
|
||||
{
|
||||
type: inputType,
|
||||
checkedValue: props.value,
|
||||
});
|
||||
return {
|
||||
handleChange,
|
||||
errors,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-check {
|
||||
position: relative;
|
||||
|
||||
.form-check-input {
|
||||
border: 1px solid $gray-500;
|
||||
border-radius: 50%;
|
||||
margin-right: 0.5rem;
|
||||
|
||||
&:checked {
|
||||
background-color: $white;
|
||||
background-size: 71%;
|
||||
background-position: center;
|
||||
border: 1px solid $blue;
|
||||
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' xml:space='preserve'%3e%3ccircle cx='25' cy='25' r='25' fill='%231574A1'/%3e%3c/svg%3e");
|
||||
+ label {
|
||||
p {
|
||||
font-weight: 500;
|
||||
font-size: .875rem;
|
||||
color: $black;
|
||||
}
|
||||
const inputType = "radio";
|
||||
const {
|
||||
value: inputValue,
|
||||
handleChange,
|
||||
errors,
|
||||
} = useField(props.groupName, props.validationRules,
|
||||
{
|
||||
type: inputType,
|
||||
checkedValue: props.value,
|
||||
});
|
||||
return {
|
||||
handleChange,
|
||||
errors,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.form-check {
|
||||
position: relative;
|
||||
|
||||
label {
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.form-check-input {
|
||||
border: 1px solid $gray-500;
|
||||
border-radius: 50%;
|
||||
margin-right: 0.5rem;
|
||||
|
||||
&:checked {
|
||||
background-color: $white;
|
||||
background-size: 71%;
|
||||
background-position: center;
|
||||
border: 1px solid $blue;
|
||||
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' xml:space='preserve'%3e%3ccircle cx='25' cy='25' r='25' fill='%231574A1'/%3e%3c/svg%3e");
|
||||
+ label {
|
||||
p {
|
||||
font-weight: 500;
|
||||
font-size: .875rem;
|
||||
color: $black;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2.5px $blue;
|
||||
}
|
||||
|
||||
&, & + label {
|
||||
margin-top: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.form-check-input {
|
||||
box-shadow: 0 0 0 4px $blue-300;
|
||||
}
|
||||
}
|
||||
p {
|
||||
font-weight: 400;
|
||||
font-size: .875rem;
|
||||
color: $gray-600;
|
||||
}
|
||||
}
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 2.5px $blue;
|
||||
}
|
||||
|
||||
&, & + label {
|
||||
margin-top: 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.form-check-input {
|
||||
box-shadow: 0 0 0 4px $blue-300;
|
||||
}
|
||||
}
|
||||
p {
|
||||
font-weight: 400;
|
||||
font-size: .875rem;
|
||||
color: $gray-600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in a new issue