From a16f4364fab8f21d184c8c4370ed49b6d421397c Mon Sep 17 00:00:00 2001 From: brydon1 Date: Mon, 2 Oct 2023 17:30:39 -0400 Subject: [PATCH 01/35] Partial load session incorporation --- src/constants/endpoints.js | 4 +++ src/store/index.js | 71 +++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index a34d8990..f201efba 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -146,6 +146,10 @@ const endpoints = Object.freeze({ url: '/order/api/v1/order/save-session/iss', method: 'POST' }, + LoadSession: { + url: '/order/api/v1/order/load-session', + method: 'POST' + }, DuplicateSearch: { // eslint-disable-next-line max-len url: (accountNumber, policyNumber, phoneNumber) => `/order/api/v1/order/duplicate-check/${accountNumber}/${policyNumber}/${phoneNumber}`, diff --git a/src/store/index.js b/src/store/index.js index 1568c5b7..4bb69ffa 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -140,7 +140,7 @@ const getDefaultState = () => ({ pageData: {}, savedSessionTimeout: getDateForSavedSessionTimeout(), saveSessionPromise: null, - savedSessionId: null, + savedSessionId: '00000000-0000-0000-0000-000000000000', crmCustomerId: null, lastPageVisited: null, triggeredSiteEntry: false, @@ -937,6 +937,75 @@ export const useMainStore = defineStore({ }); }, + loadSession() { + // TODO how to get savedSessionId for a duplicate referral? + const result = globalMethods.callHttpClient({ + method: endpoints.SaveSession.method, + endpoint: endpoints.SaveSession.url, + payload: { + savedSessionId: this.applicationUser.savedSessionId?.toString(), + referralNumber: this.order.referralNumber?.toString(), + referralDate: this.order.referralDate?.toString(), + parentAccountNumber: this.issConfig.parentAccountNumber, + referralCorrelationId: this.order.referralCorrelationId + } + }); + this.applicationUser.crmCustomerId = result.applicationUser.crmCustomerId; + this.applicationUser.experiments = result.applicationUser.experiments; + this.applicationUser.lastPageVisited = result.applicationUser.lastPage; + this.applicationUser.pageData = result.applicationUser.pageData; + this.applicationUser.savedSessionId = result.applicationUser.savedSessionId; // TODO this might just be what is passed + + this.order.vehicle.registration.licensePlate = result.order.vehicle.registration.licensePlateNumber; + this.order.vehicle.imageUrl = result.order.vehicle.imageUrl; + this.order.vehicle.imageColor = result.order.vehicle.imageVifColor; + this.order.vehicle.imageVifNumber = result.order.vehicle.imageNumber; + this.order.vehicle.year = result.order.vehicle.year; + this.order.vehicle.make = result.order.vehicle.make; + this.order.vehicle.model = result.order.vehicle.model; + this.order.vehicle.style = result.order.vehicle.style; + this.order.vehicle.carId = result.order.vehicle.carId; + this.order.vehicle.category = result.order.vehicle.category; + this.order.vehicle.vin = result.order.vehicle.vin; + + this.order.damage.isRepair = result.order.damage.isRepair; + this.order.damage.numberOfChips = result.order.damage.numberOfChips; + this.order.damage.glassToReplace = result.order.damage.glassToReplace; // TODO this might need transformed + this.order.damage.capabilityQuestionAnswers = result.order.damage.capabilityQuestionAnswers; + this.order.damage.moldingQuestionAnswers = result.order.damage.moldingQuestionAnswers; + this.order.damage.partQuestionAnswers = result.order.damage.partQuestionAnswers; + + this.order.policy.policyNumber = result.order.policy.policyNumber; + this.order.policy.policyZipCode = result.order.policy.policyZipCode; + this.order.policy.noCoverage = result.order.policy.noCoverage; + this.order.policy.policyLookupSuccessful = result.order.policy.policyLookupSuccessful; // TODO probably don't need to load this + this.order.policy.dateOfLoss = result.order.damage.dateOfLoss; + this.order.policy.damageCause = result.order.damage.damageCause; + this.order.policy.damageState = result.order.damage.damageState; + this.order.policy.damageCity = result.order.damage.damageCity; + this.order.policy.isDamageGlassOnly = result.order.damage.isDamageGlassOnly; + + + this.order.originalDeductible = result.order.policy.originalDeductible; + this.order.currentDeductible = result.order.policies.currentDeductible; + + + // customer: { + // address: { + // streetAddress: null, + // streetAddress2: null, + // city: null, + // state: null, + // zipCode: null + // }, + // firstName: null, + // lastName: null, + // emailAddress: null, + // phoneNumber: null + // }, + + }, + setSaveSessionPromise(promise) { this.applicationUser.saveSessionPromise = promise; }, From 2594595f2d4f921749f016561f13aed20677f208 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Wed, 11 Oct 2023 13:35:21 -0400 Subject: [PATCH 02/35] Refactoring welcome page to extract policy lookup and incorporate dupe check navigation --- src/layouts/welcome-page/welcome-page.spec.js | 100 +- src/layouts/welcome-page/welcome-page.vue | 75 +- src/store/index.js | 236 +++-- src/store/store.spec.js | 951 ++++++++++++------ 4 files changed, 867 insertions(+), 495 deletions(-) diff --git a/src/layouts/welcome-page/welcome-page.spec.js b/src/layouts/welcome-page/welcome-page.spec.js index 573b8fce..29520d8c 100644 --- a/src/layouts/welcome-page/welcome-page.spec.js +++ b/src/layouts/welcome-page/welcome-page.spec.js @@ -179,13 +179,8 @@ describe('navigation', () => { test('if duplicates found, navigate to duplicate check page', async () => { // Arrange const { wrapper } = getMountedComponent({}); - - const duplicatesExist = { - policyLookupResponse: {}, - duplicateCheckResponse: [{ test: 'a'}] - }; - - settleAllPromises.mockImplementation(() => Promise.resolve(duplicatesExist)); + useMainStore().getDuplicateReferrals = jest.fn().mockImplementation(() => Promise.resolve({})); + useMainStore().applicationUser.duplicateOrders = [{ test: 'a' }]; // Act await wrapper.vm.forwardButtonAction(); @@ -199,39 +194,18 @@ describe('navigation', () => { { [routerParams.SAVE_SESSION_SYNCHRONOUS]: true } ); }); - test('if policy and vehicles are found, navigate to policy-vehicle page', async () => { + test('if policy and vehicles are found but no duplicates, navigate to policy-vehicle page', async () => { // Arrange - const mockvehicles = [ - { - vin: 'TEST_VIN' - }, - { - vin: 'TEST_VIN2' - } + const { wrapper } = setupMocks({}); + useMainStore().getDuplicateReferrals = jest.fn().mockImplementation(() => Promise.resolve({})); + + useMainStore().applicationUser.duplicateOrders = []; + useMainStore().order.policy.policyLookupSuccessful = true; + useMainStore().order.policy.vehicles = [ + { vin: 'TEST_VIN' }, + { vin: 'TEST_VIN2' } ]; - const { wrapper } = setupMocks({ - policies: [{ - vehicles: [ - { - vin: 'TEST_VIN' - }, - { - vin: 'TEST_VIN2' - } - ] - }] - }); - - await wrapper.setData({ - vehiclesFound: mockvehicles - }); - - useMainStore().issConfig.isCoverageEnabled = true; - useMainStore().order.policy.policyNumber = 'p_0001'; - useMainStore().order.policy.dateOfLoss = '2022-01-28'; - useMainStore().order.accountNumber = '00000'; - // Act await wrapper.vm.forwardButtonAction(); @@ -243,20 +217,14 @@ describe('navigation', () => { { [routerParams.SAVE_SESSION_SYNCHRONOUS]: true } ); }); - test('if policy is found, but no vehicles, navigate to vehicle-selection page', async () => { + test('if policy is found, but no vehicles and no duplicates, navigate to vehicle-selection page', async () => { // Arrange - const { wrapper } = setupMocks({ - policies: [{}] - }); + const { wrapper } = setupMocks({}); + useMainStore().getDuplicateReferrals = jest.fn().mockImplementation(() => Promise.resolve({})); - await wrapper.setData({ - vehiclesFound: null - }); - - useMainStore().issConfig.isCoverageEnabled = true; - useMainStore().order.policy.policyNumber = 'p_0001'; - useMainStore().order.policy.dateOfLoss = '2022-01-28'; - useMainStore().order.accountNumber = '00000'; + useMainStore().applicationUser.duplicateOrders = []; + useMainStore().order.policy.policyLookupSuccessful = true; + useMainStore().order.policy.vehicles = []; // Act @@ -270,16 +238,34 @@ describe('navigation', () => { { [routerParams.SAVE_SESSION_SYNCHRONOUS]: true } ); }); - test('if policy is not found, navigate to policy-holder-details page', async () => { + test('if policy is found, but null vehicles and no duplicates, navigate to vehicle-selection page', async () => { // Arrange - const { wrapper } = setupMocks({ - policies: null - }); + const { wrapper } = setupMocks({}); + useMainStore().getDuplicateReferrals = jest.fn().mockImplementation(() => Promise.resolve({})); - useMainStore().issConfig.isCoverageEnabled = true; - useMainStore().order.policy.policyNumber = 'p_0001'; - useMainStore().order.policy.dateOfLoss = '2022-01-28'; - useMainStore().order.accountNumber = '00000'; + useMainStore().applicationUser.duplicateOrders = []; + useMainStore().order.policy.policyLookupSuccessful = true; + useMainStore().order.policy.vehicles = null; + + // Act + + await wrapper.vm.forwardButtonAction(); + + // Assert + expect(wrapper.vm.$router.navigate).toHaveBeenCalledWith( + navigationScenarios.CLICKED_FORWARD_POLICY_VERIFIED_NO_VEHICLES, + undefined, + {}, + { [routerParams.SAVE_SESSION_SYNCHRONOUS]: true } + ); + }); + test('if policy is not found and no duplicates, navigate to policy-holder-details page', async () => { + // Arrange + const { wrapper } = setupMocks({}); + useMainStore().getDuplicateReferrals = jest.fn().mockImplementation(() => Promise.resolve({})); + + useMainStore().order.policy.policyLookupSuccessful = false; + useMainStore().applicationUser.duplicateOrders = []; // Act await wrapper.vm.navigateForward(); diff --git a/src/layouts/welcome-page/welcome-page.vue b/src/layouts/welcome-page/welcome-page.vue index d2ad05b0..c4d49845 100644 --- a/src/layouts/welcome-page/welcome-page.vue +++ b/src/layouts/welcome-page/welcome-page.vue @@ -167,6 +167,7 @@ + + diff --git a/src/styles/ux-variables.scss b/src/styles/ux-variables.scss index 8ec17642..e9321490 100644 --- a/src/styles/ux-variables.scss +++ b/src/styles/ux-variables.scss @@ -157,22 +157,20 @@ $spacer: 1rem; $spacers: ( 0: 0, 1: $spacer * 0.25, - /* 8px */ 2: $spacer * 0.5, - /* 12px */ 3: $spacer * 0.75, - /* 16px */ 4: $spacer * 1, - /* 24px */ 5: $spacer * 1.5, - /* 32px */ 6: $spacer * 2, - /* 40px */ 7: $spacer * 2.5, - /* 48px */ 8: $spacer * 3, -); - -//Grid breakpoints -$grid-breakpoints: ( - xs: 0, - sm: 576px, - md: 838px, - lg: 1074px, - xl: 1416px, + /* 8px */ + 2: $spacer * 0.5, + /* 12px */ + 3: $spacer * 0.75, + /* 16px */ + 4: $spacer * 1, + /* 24px */ + 5: $spacer * 1.5, + /* 32px */ + 6: $spacer * 2, + /* 40px */ + 7: $spacer * 2.5, + /* 48px */ + 8: $spacer * 3, ); //Shadow @@ -190,3 +188,14 @@ $alert-color-scale: 40%; // This affects all [Bootstrap] modals $modal-fade-transform: translate(0, 100%); $modal-backdrop-opacity: 0; + +//Disable default !important behavior +$enable-important-utilities: false; + +//Bootstrap Grid Breakpoints - Use these breakpoints only +$grid-breakpoints: ( + xs: 0, + md: 768px, + xl: 1200px, + xxl: 1440px, +); \ No newline at end of file diff --git a/src/ux-components/list-card/list-card.vue b/src/ux-components/list-card/list-card.vue index db0b57c5..f222696b 100644 --- a/src/ux-components/list-card/list-card.vue +++ b/src/ux-components/list-card/list-card.vue @@ -93,8 +93,8 @@ export default { img { // svg's should be constructed on the same canvas size/viewbox to ensure // they occupy the same space in the DOM. This will allow easy/proper alignment of elements. See exisitng svg's for examples. - height: auto; - width: 6.5rem; + height: 2rem; + width: auto; margin-bottom: 2.2rem; max-width: 100%; } @@ -105,8 +105,9 @@ export default { + .list-card-content { outline: none; - display: block; + display: flex; position: relative; + justify-content: flex-start; p { color: $gray-600; From f337c54ea88bf5780425af8ef6e89def63bc7609 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 20 Oct 2023 10:13:43 -0400 Subject: [PATCH 34/35] remove console logs --- src/store/index.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index dc485fa3..60699f03 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1261,17 +1261,14 @@ export const useMainStore = defineStore({ this.order.vehicle.registration.lastName = null; }, resetServiceLocationAndDependencies(context) { - console.log('Reset service location and dependencies...'); this.resetServiceLocationAppointmentType(); this.resetServiceLocationProvider(); this.resetSchedule(); }, resetServiceLocationAppointmentType() { - console.log('Reset service location appointment type...'); this.order.serviceLocation.appointmentType = null; }, resetServiceLocationProvider() { - console.log('Reset service location provider...'); this.order.serviceLocation.provider = { providerNumber: null, address: { @@ -1284,7 +1281,6 @@ export const useMainStore = defineStore({ }; }, resetServiceLocationMobileAddress() { - console.log('Reset service location mobile address...'); this.order.serviceLocation.address = null; this.order.serviceLocation.address2 = null; this.order.serviceLocation.city = null; @@ -1359,7 +1355,6 @@ export const useMainStore = defineStore({ this.applicationUser.pageData[issPageValues.CAPABILITY_QUESTIONS] = null; }, resetSchedule() { - console.log('Reset Schedule...'); this.order.schedule.date = null; this.order.schedule.startTime = null; this.order.schedule.endTime = null; From dd22463f540f8d1aef10a63c78e0eb739968855e Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 20 Oct 2023 10:42:43 -0400 Subject: [PATCH 35/35] old grid-breakpoints --- src/styles/ux-variables.scss | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/styles/ux-variables.scss b/src/styles/ux-variables.scss index e9321490..a67e7c76 100644 --- a/src/styles/ux-variables.scss +++ b/src/styles/ux-variables.scss @@ -173,6 +173,15 @@ $spacers: ( 8: $spacer * 3, ); +//Grid breakpoints +$grid-breakpoints: ( + xs: 0, + sm: 576px, + md: 838px, + lg: 1074px, + xl: 1416px, +); + //Shadow $box-shadow: 0 0.5rem 1rem rgba($black, 0.15); $box-shadow-sm: 0 0.125rem 0.25rem rgba($black, 0.075); @@ -190,12 +199,4 @@ $modal-fade-transform: translate(0, 100%); $modal-backdrop-opacity: 0; //Disable default !important behavior -$enable-important-utilities: false; - -//Bootstrap Grid Breakpoints - Use these breakpoints only -$grid-breakpoints: ( - xs: 0, - md: 768px, - xl: 1200px, - xxl: 1440px, -); \ No newline at end of file +$enable-important-utilities: false; \ No newline at end of file