From b5c5fa2a6cc284c25ab5e0c6e6c6e2a775e87bf3 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 15 Jun 2023 09:23:59 -0400 Subject: [PATCH 01/28] Prepare for nested bulleted lists --- src/layouts/review/review-block/review-block.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layouts/review/review-block/review-block.vue b/src/layouts/review/review-block/review-block.vue index 0b1f913c3..1c5b02486 100644 --- a/src/layouts/review/review-block/review-block.vue +++ b/src/layouts/review/review-block/review-block.vue @@ -7,9 +7,12 @@ margin="mt-0" /> -
- {{ item }} -
+
From 8451523a24d116b988de8ca8d098fd09aa6c57b4 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Thu, 15 Jun 2023 09:36:21 -0400 Subject: [PATCH 02/28] Check for windshield damage before adding section to block --- .../damage-review/damage-review.vue | 31 ++++++++++++++----- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/layouts/review/review-sections/damage-review/damage-review.vue b/src/layouts/review/review-sections/damage-review/damage-review.vue index f7db11554..12be2a823 100644 --- a/src/layouts/review/review-sections/damage-review/damage-review.vue +++ b/src/layouts/review/review-sections/damage-review/damage-review.vue @@ -7,6 +7,7 @@ + + From 7aa9cb6e0c11c4e98b9ce5afee87995348342e28 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 25 Jul 2023 15:12:35 -0400 Subject: [PATCH 08/28] Add getter to support cms. --- src/store/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index c1968888d..fb86b61c3 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -528,6 +528,9 @@ export const getters = { }, eventBus: (state) => state.applicationUser.eventBus, damage: (state) => state.order.damage, + hasExactlyOneChip: (state) => { + return state.order.damage?.numberOfChips === 1; + }, hasAnyNonWindshieldGlassParts: (state) => { const nonWindshieldItems = state.order.damage.glassToReplace?.filter( (glassToReplace) => glassToReplace.glassLocation != "Windshield" From 2f1eae02b1ab80ca90e97cd0ba4b520735060da4 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 25 Jul 2023 15:12:48 -0400 Subject: [PATCH 09/28] Formatting --- src/layouts/review/review-block/review-block.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/layouts/review/review-block/review-block.vue b/src/layouts/review/review-block/review-block.vue index d57936501..88228ed32 100644 --- a/src/layouts/review/review-block/review-block.vue +++ b/src/layouts/review/review-block/review-block.vue @@ -49,9 +49,7 @@ export default { From 6f9519ec1b3609bc83a5add341c27679c94ed08f Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 25 Jul 2023 16:14:18 -0400 Subject: [PATCH 10/28] Update existing unit tests --- .../damage-review/damage-review.spec.js | 242 ++++++++++++++++-- 1 file changed, 216 insertions(+), 26 deletions(-) diff --git a/src/layouts/review/review-sections/damage-review/damage-review.spec.js b/src/layouts/review/review-sections/damage-review/damage-review.spec.js index a6dbe6f2d..2e4ef3e2a 100644 --- a/src/layouts/review/review-sections/damage-review/damage-review.spec.js +++ b/src/layouts/review/review-sections/damage-review/damage-review.spec.js @@ -1,19 +1,210 @@ import { shallowMount } from "@vue/test-utils"; import { getMountOptions } from "@/helpers/unit-test-helper.js"; -import damageReview from "@/layouts/review/review-sections/damage-review/damage-review"; -jest.mock("@/helpers/cms-content-helper", () => ({ - fetchCmsContentForPage: () => Promise.resolve("content"), -})); +import damageReview from "@/layouts/review/review-sections/damage-review/damage-review"; +import { damageLocationsSelected as glassConstants } from "@/constants/damage-locations-selected"; + +const testConstants = { + cmsConstants: { + widgetNames: { + header: "DamageReviewWidget", + locations: "DamageLocationsWidget", + driverDamages: "DriverDamagesWidget", + passengerDamages: "PassengerDamagesWidget", + }, + header: { + text: "Damage", + }, + damageLocations: { + windshield: glassConstants.WINDSHIELD, + driver: glassConstants.DRIVER, + passenger: glassConstants.PASSENGER, + rear: glassConstants.REAR, + }, + damageNames: { + vent: glassConstants.VENT, + front: glassConstants.FRONT, + back: glassConstants.BACK, + quarter: glassConstants.QUARTER, + side: glassConstants.SIDEDOOR, + }, + locationCopy: { + windshield: "Windshield copy", + driver: "Driver copy", + passenger: "Passenger copy", + rear: "Rear copy", + }, + damageCopy: { + vent: "Vent copy", + front: "Front copy", + back: "Back copy", + quarter: "Quarter copy", + side: "Side copy", + }, + imageId: "00000000-0000-0000-0000-000000000000", + }, + makeBulletedList: (items) => { + let list = "
    "; + items.forEach((item) => { + list += `
  • ${item}
  • `; + }); + list += "
"; + + return list; + }, + glassItems: { + windshield: { + glassLocation: glassConstants.WINDSHIELD, + glassName: glassConstants.SINGLE, + }, + }, +}; + +let cmsContent; describe("Damage Review Block", () => { + beforeEach(() => { + cmsContent = { + DamageReviewWidget: { + Text: testConstants.cmsConstants.header.text, + }, + DamageLocationsWidget: { + Answers: [ + { + Name: testConstants.cmsConstants.damageLocations.windshield, + Text: testConstants.cmsConstants.locationCopy.windshield, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageLocations.driver, + Text: testConstants.cmsConstants.locationCopy.driver, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: testConstants.cmsConstants.widgetNames.driverDamages, + }, + { + Name: testConstants.cmsConstants.damageLocations.passenger, + Text: testConstants.cmsConstants.locationCopy.passenger, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: testConstants.cmsConstants.widgetNames.passengerDamages, + }, + { + Name: testConstants.cmsConstants.damageLocations.rear, + Text: testConstants.cmsConstants.locationCopy.rear, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + ], + }, + DriverDamagesWidget: { + Answers: [ + { + Name: testConstants.cmsConstants.damageNames.vent, + Text: testConstants.cmsConstants.damageCopy.vent, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.front, + Text: testConstants.cmsConstants.damageCopy.front, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.back, + Text: testConstants.cmsConstants.damageCopy.back, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.quarter, + Text: testConstants.cmsConstants.damageCopy.quarter, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.side, + Text: testConstants.cmsConstants.damageCopy.side, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + ], + }, + PassengerDamagesWidget: { + Answers: [ + { + Name: testConstants.cmsConstants.damageNames.vent, + Text: testConstants.cmsConstants.damageCopy.vent, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.front, + Text: testConstants.cmsConstants.damageCopy.front, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.back, + Text: testConstants.cmsConstants.damageCopy.back, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.quarter, + Text: testConstants.cmsConstants.damageCopy.quarter, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + { + Name: testConstants.cmsConstants.damageNames.side, + Text: testConstants.cmsConstants.damageCopy.side, + SubText: "", + ImageId: testConstants.cmsConstants.imageId, + Image: "", + SubWidgetName: "", + }, + ], + }, + }; + }); + describe("Correctly assembles damage info into a display string", () => { - test("Basic Replace", async () => { + test("Shows windshield copy when windshield damage is included", async () => { // Arrange const { wrapper } = setupMocks({ propsData: { + cmsWidgetName: testConstants.cmsConstants.widgetNames.header, + damageLocationsWidgetName: testConstants.cmsConstants.widgetNames.locations, damage: { isRepair: false, + glassToReplace: [testConstants.glassItems.windshield], }, }, }); @@ -22,16 +213,21 @@ describe("Damage Review Block", () => { await wrapper.vm.$nextTick(); // Assert - expect(wrapper.vm.displayContent).toStrictEqual(["Windshield crack"]); + expect(wrapper.vm.displayContent).toStrictEqual([ + testConstants.cmsConstants.locationCopy.windshield, + ]); }); - test("Basic Repair", async () => { + test("Windshield copy is shown when order is a repair", async () => { // Arrange const { wrapper } = setupMocks({ propsData: { + cmsWidgetName: testConstants.cmsConstants.widgetNames.header, + damageLocationsWidgetName: testConstants.cmsConstants.widgetNames.locations, damage: { isRepair: true, numberOfChips: 2, + glassToReplace: [], }, }, }); @@ -40,25 +236,9 @@ describe("Damage Review Block", () => { await wrapper.vm.$nextTick(); // Assert - expect(wrapper.vm.displayContent).toStrictEqual(["Windshield repair - 2 chips"]); - }); - - test("Basic Repair - no s with 1 chip", async () => { - // Arrange - const { wrapper } = setupMocks({ - propsData: { - damage: { - isRepair: true, - numberOfChips: 1, - }, - }, - }); - - // Act - await wrapper.vm.$nextTick(); - - // Assert - expect(wrapper.vm.displayContent).toStrictEqual(["Windshield repair - 1 chip"]); + expect(wrapper.vm.displayContent).toStrictEqual([ + testConstants.cmsConstants.locationCopy.windshield, + ]); }); }); }); @@ -66,6 +246,16 @@ describe("Damage Review Block", () => { function setupMocks(customMountOptions) { const mountOptions = getMountOptions(customMountOptions); + const mockMixin = { + methods: { + getCmsContent: jest.fn((widgetName, cmsFieldName) => { + return cmsContent?.[widgetName]?.[cmsFieldName] ?? ""; + }), + }, + }; + + mountOptions.global.mixins = [mockMixin]; + const wrapper = shallowMount(damageReview, mountOptions); wrapper.vm.setCmsContent = jest.fn(); return { wrapper }; From 21914908a3a0db68a129ed758f2503fc828c3c6c Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 25 Jul 2023 16:39:40 -0400 Subject: [PATCH 11/28] Add new tests. --- .../damage-review/damage-review.spec.js | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) diff --git a/src/layouts/review/review-sections/damage-review/damage-review.spec.js b/src/layouts/review/review-sections/damage-review/damage-review.spec.js index 2e4ef3e2a..e7aa69a67 100644 --- a/src/layouts/review/review-sections/damage-review/damage-review.spec.js +++ b/src/layouts/review/review-sections/damage-review/damage-review.spec.js @@ -57,6 +57,54 @@ const testConstants = { glassLocation: glassConstants.WINDSHIELD, glassName: glassConstants.SINGLE, }, + rear: { + glassLocation: glassConstants.REAR, + glassName: glassConstants.STATIONARY, + }, + passengerItems: { + vent: { + glassLocation: glassConstants.PASSENGER, + glassName: glassConstants.VENT, + }, + front: { + glassLocation: glassConstants.PASSENGER, + glassName: glassConstants.FRONT, + }, + back: { + glassLocation: glassConstants.PASSENGER, + glassName: glassConstants.BACK, + }, + quarter: { + glassLocation: glassConstants.PASSENGER, + glassName: glassConstants.QUARTER, + }, + side: { + glassLocation: glassConstants.PASSENGER, + glassName: glassConstants.SIDEDOOR, + }, + }, + driverItems: { + vent: { + glassLocation: glassConstants.DRIVER, + glassName: glassConstants.VENT, + }, + front: { + glassLocation: glassConstants.DRIVER, + glassName: glassConstants.FRONT, + }, + back: { + glassLocation: glassConstants.DRIVER, + glassName: glassConstants.BACK, + }, + quarter: { + glassLocation: glassConstants.DRIVER, + glassName: glassConstants.QUARTER, + }, + side: { + glassLocation: glassConstants.DRIVER, + glassName: glassConstants.SIDEDOOR, + }, + }, }, }; @@ -240,6 +288,136 @@ describe("Damage Review Block", () => { testConstants.cmsConstants.locationCopy.windshield, ]); }); + + test("Rear windshield copy shows when rear damage is present", async () => { + // Arrange + const { wrapper } = setupMocks({ + propsData: { + cmsWidgetName: testConstants.cmsConstants.widgetNames.header, + damageLocationsWidgetName: testConstants.cmsConstants.widgetNames.locations, + damage: { + isRepair: false, + numberOfChips: null, + glassToReplace: [testConstants.glassItems.rear], + }, + }, + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toStrictEqual([ + testConstants.cmsConstants.locationCopy.rear, + ]); + }); + + test("Driver side copy and items are shown when driver side damage is present", async () => { + // Arrange + const { wrapper } = setupMocks({ + propsData: { + cmsWidgetName: testConstants.cmsConstants.widgetNames.header, + damageLocationsWidgetName: testConstants.cmsConstants.widgetNames.locations, + damage: { + isRepair: false, + numberOfChips: null, + glassToReplace: [ + testConstants.glassItems.driverItems.back, + testConstants.glassItems.driverItems.front, + ], + }, + }, + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toStrictEqual([ + testConstants.cmsConstants.locationCopy.driver, + testConstants.makeBulletedList([ + testConstants.cmsConstants.damageCopy.front, + testConstants.cmsConstants.damageCopy.back, + ]), + ]); + }); + + test("Passenger side copy and items are shown when passenger side damage is present", async () => { + // Arrange + const { wrapper } = setupMocks({ + propsData: { + cmsWidgetName: testConstants.cmsConstants.widgetNames.header, + damageLocationsWidgetName: testConstants.cmsConstants.widgetNames.locations, + damage: { + isRepair: false, + numberOfChips: null, + glassToReplace: [ + testConstants.glassItems.passengerItems.quarter, + testConstants.glassItems.passengerItems.vent, + testConstants.glassItems.passengerItems.side, + ], + }, + }, + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toStrictEqual([ + testConstants.cmsConstants.locationCopy.passenger, + testConstants.makeBulletedList([ + testConstants.cmsConstants.damageCopy.vent, + testConstants.cmsConstants.damageCopy.quarter, + testConstants.cmsConstants.damageCopy.side, + ]), + ]); + }); + + test("All relevant sections are shown in order in multiglass scenario", async () => { + // Arrange + const { wrapper } = setupMocks({ + propsData: { + cmsWidgetName: testConstants.cmsConstants.widgetNames.header, + damageLocationsWidgetName: testConstants.cmsConstants.widgetNames.locations, + damage: { + isRepair: false, + numberOfChips: null, + glassToReplace: [ + testConstants.glassItems.windshield, + testConstants.glassItems.rear, + testConstants.glassItems.driverItems.vent, + testConstants.glassItems.driverItems.front, + testConstants.glassItems.driverItems.back, + testConstants.glassItems.passengerItems.quarter, + testConstants.glassItems.passengerItems.back, + testConstants.glassItems.passengerItems.side, + ], + }, + }, + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toStrictEqual([ + testConstants.cmsConstants.locationCopy.windshield, + testConstants.cmsConstants.locationCopy.driver, + testConstants.makeBulletedList([ + testConstants.cmsConstants.damageCopy.vent, + testConstants.cmsConstants.damageCopy.front, + testConstants.cmsConstants.damageCopy.back, + ]), + testConstants.cmsConstants.locationCopy.passenger, + testConstants.makeBulletedList([ + testConstants.cmsConstants.damageCopy.back, + testConstants.cmsConstants.damageCopy.quarter, + testConstants.cmsConstants.damageCopy.side, + ]), + testConstants.cmsConstants.locationCopy.rear, + ]); + }); }); }); From b48e3c5004dde9a1a15ecae6bb2ed7ac0d3de221 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 25 Jul 2023 16:42:12 -0400 Subject: [PATCH 12/28] Fix to un-conflate driver and passenger side items. --- .../review-sections/damage-review/damage-review.vue | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/layouts/review/review-sections/damage-review/damage-review.vue b/src/layouts/review/review-sections/damage-review/damage-review.vue index da83d1a48..e0972aa09 100644 --- a/src/layouts/review/review-sections/damage-review/damage-review.vue +++ b/src/layouts/review/review-sections/damage-review/damage-review.vue @@ -92,10 +92,9 @@ export default { driverSideCopy() { const answerContent = this.getLocationAnswer(damageLocationsSelected.DRIVER); const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName); + const driverSideItems = this.getGlassPieces(damageLocationsSelected.DRIVER); const damageAnswersOnOrder = damageAnswers?.filter((answer) => - this.damage?.glassToReplace?.some( - (glassPiece) => answer.Name === glassPiece.glassName - ) + driverSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName) ); if (this.hasDriverSideDamage) { @@ -110,10 +109,9 @@ export default { passengerSideCopy() { const answerContent = this.getLocationAnswer(damageLocationsSelected.PASSENGER); const damageAnswers = this.getAnswersNullSafe(answerContent?.SubWidgetName); + const passengerSideItems = this.getGlassPieces(damageLocationsSelected.PASSENGER); const damageAnswersOnOrder = damageAnswers?.filter((answer) => - this.damage?.glassToReplace?.some( - (glassPiece) => answer.Name === glassPiece.glassName - ) + passengerSideItems?.some((glassPiece) => answer.Name === glassPiece.glassName) ); if (this.hasPassengerSideDamage) { From f0a5631cda2f03acb9352468062fa96fb6a4fe4c Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Tue, 25 Jul 2023 16:52:26 -0400 Subject: [PATCH 13/28] Correctly force no-top-margin to align section headers. --- src/layouts/review/review-block/review-block.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/review/review-block/review-block.vue b/src/layouts/review/review-block/review-block.vue index 88228ed32..67e639da9 100644 --- a/src/layouts/review/review-block/review-block.vue +++ b/src/layouts/review/review-block/review-block.vue @@ -4,7 +4,7 @@ + marginTopSizeOverride="0" /> Date: Tue, 25 Jul 2023 16:58:40 -0400 Subject: [PATCH 14/28] Re-align windshield logic --- .../review-sections/damage-review/damage-review.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/layouts/review/review-sections/damage-review/damage-review.vue b/src/layouts/review/review-sections/damage-review/damage-review.vue index e0972aa09..ecc7ec98d 100644 --- a/src/layouts/review/review-sections/damage-review/damage-review.vue +++ b/src/layouts/review/review-sections/damage-review/damage-review.vue @@ -58,12 +58,9 @@ export default { ]; }, hasWindshieldDamage() { - return ( - this.damage.isRepair || - this.damage.glassToReplace?.some( - (glass) => glass.glassLocation === damageLocationsSelected.WINDSHIELD - ) - ); + const windshieldPieces = this.getGlassPieces(damageLocationsSelected.WINDSHIELD); + + return this.damage.isRepair || !!windshieldPieces?.length; }, hasDriverSideDamage() { const driverPieces = this.getGlassPieces(damageLocationsSelected.DRIVER); From 94cadf636e16fcee5343d7ca0c7539746480b8d4 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 09:41:04 -0400 Subject: [PATCH 15/28] Move VAPs api responsibility to subcomponent --- .../service-package-review.vue | 32 +++++++++++++++++-- src/layouts/review/review.vue | 23 ++++--------- 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/layouts/review/review-sections/service-package-review/service-package-review.vue b/src/layouts/review/review-sections/service-package-review/service-package-review.vue index c842c18c9..c6bdfa491 100644 --- a/src/layouts/review/review-sections/service-package-review/service-package-review.vue +++ b/src/layouts/review/review-sections/service-package-review/service-package-review.vue @@ -11,6 +11,9 @@ import { getHighestFullySatisfiedTier, containsLineItemWithPartType, } from "@/helpers/service-package-helper"; +import { settleAllPromises } from "@/helpers/layout-helper"; +import baseMixin from "@/mixins/base-mixin.js"; +import { storeActions } from "@/constants/store-actions"; export default { name: "service-package-review", @@ -18,14 +21,39 @@ export default { servicePackageOptionsCmsName: String, defaultPackageItemsCmsName: String, vapsItemsCmsName: String, - availableVaps: Array, lineItems: Object, damage: Object, }, data() { - return {}; + return { + availableVaps: [], + }; }, methods: { + loadInitialData() { + const wipersPromise = baseMixin.methods.dispatchStoreAction(storeActions.GET_WIPERS); + const rainDefensePromise = baseMixin.methods.dispatchStoreAction( + storeActions.GET_RAIN_DEFENSE + ); + + const promiseResultMap = [ + { + resultKey: "wipers", + promise: wipersPromise, + }, + { + resultKey: "rainDefense", + promise: rainDefensePromise, + }, + ]; + + return settleAllPromises(promiseResultMap); + }, + initializeComponent(apiResponses) { + const vapsFromApi = [...apiResponses.wipers, apiResponses.rainDefense]; + + this.availableVaps = vapsFromApi; + }, editClicked() { this.$emit("edit-clicked"); }, diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index ddbc0e709..e28b8a95e 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -55,11 +55,11 @@
@@ -103,6 +103,8 @@ export default { storeActions.GET_RAIN_DEFENSE ); + const servicePackageInitialDataPromise = servicePackageReview.methods.loadInitialData(); + // Settle promises and get results const promiseResultMap = [ { @@ -110,12 +112,8 @@ export default { promise: cmsContentPromise, }, { - resultKey: "wipers", - promise: wipersPromise, - }, - { - resultKey: "rainDefense", - promise: rainDefensePromise, + resultKey: "servicePackageData", + promise: servicePackageInitialDataPromise, }, ]; @@ -124,15 +122,11 @@ export default { next((vm) => { vm.setCmsContent(resultMap.cmsContent); - vm.availableWipers = resultMap.wipers; - vm.availableRainDefense = [resultMap.rainDefense]; + vm.$refs.servicePackageReview.initializeComponent(resultMap.servicePackageData); }); }, data() { - return { - availableWipers: null, - availableRainDefense: null, - }; + return {}; }, methods: { arePagePrerequisitesValid() { @@ -175,9 +169,6 @@ export default { damageInfo() { return this.$store.getters.damage; }, - availableVaps() { - return [...(this.availableWipers ?? []), ...(this.availableRainDefense ?? [])]; - }, lineItems() { return this.$store.getters.lineItems; }, From b82aab687c922d4284a7fd306adb7c1da51b9ee3 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 09:53:26 -0400 Subject: [PATCH 16/28] Update unit tests to new design. --- .../service-package-review.spec.js | 77 +++++++++---------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/src/layouts/review/review-sections/service-package-review/service-package-review.spec.js b/src/layouts/review/review-sections/service-package-review/service-package-review.spec.js index fc8b1ce5c..54de9780b 100644 --- a/src/layouts/review/review-sections/service-package-review/service-package-review.spec.js +++ b/src/layouts/review/review-sections/service-package-review/service-package-review.spec.js @@ -77,11 +77,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_Cash", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [testConstants.damages.frontWindshield], @@ -142,11 +139,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_Standard_Repair", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: true, glassToReplace: [], @@ -206,11 +200,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_Recal", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [testConstants.damages.frontWindshield], @@ -271,11 +262,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_RearGlass+NonWindshield", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [testConstants.damages.rearWindshield], @@ -343,11 +331,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_RearGlass+Windshield", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [ @@ -461,7 +446,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_RearGlassNoFrontFit", params: { - availableVaps: [testConstants.parts.rearWiperPart, testConstants.parts.rainDefensePart], + wiperResponse: [testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [testConstants.damages.rearWindshield], @@ -518,11 +504,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_Windshield+SideGlass", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [ @@ -586,11 +569,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_SideGlass", params: { - availableVaps: [ - testConstants.parts.frontWiperPart, - testConstants.parts.rearWiperPart, - testConstants.parts.rainDefensePart, - ], + wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [testConstants.damages.sideGlass], @@ -678,7 +658,8 @@ const figmaScenarios = [ { name: "05_01_CSR_Quote_NoWiperFit", params: { - availableVaps: [testConstants.parts.rainDefensePart], + wiperResponse: [], + rainDefenseResponse: testConstants.parts.rainDefensePart, damage: { isRepair: false, glassToReplace: [testConstants.damages.frontWindshield], @@ -821,6 +802,8 @@ describe("Service Package Review Block", () => { propsData: props, }); + initializeWithDefault(wrapper); + // Act await wrapper.vm.$nextTick(); @@ -851,6 +834,8 @@ describe("Service Package Review Block", () => { propsData: props, }); + initializeWithDefault(wrapper); + // Act await wrapper.vm.$nextTick(); @@ -874,6 +859,8 @@ describe("Service Package Review Block", () => { // Act await wrapper.vm.$nextTick(); + initializeWithDefault(wrapper); + // Assert const includesFrontWiperCopy = wrapper.vm.displayContent.includes( testConstants.vapsCopy.frontWiperCopy @@ -893,6 +880,8 @@ describe("Service Package Review Block", () => { propsData: generateDefaultProps(), }); + initializeWithDefault(wrapper); + // Act await wrapper.vm.$nextTick(); @@ -908,7 +897,6 @@ describe("Service Package Review Block", () => { it(`Should match figma scenario "${scenario.name}", iteration "${iteration.name}"`, async () => { // Arrange let props = generateDefaultProps(); - props.availableVaps = scenario.params.availableVaps; props.damage = scenario.params.damage; props.glassParts = scenario.params.glassParts; props.lineItems.supportingItems = scenario.params.supportingItems; @@ -918,6 +906,11 @@ describe("Service Package Review Block", () => { propsData: props, }); + wrapper.vm.initializeComponent({ + wipers: scenario.params.wiperResponse, + rainDefense: scenario.params.rainDefenseResponse, + }); + // Act await wrapper.vm.$nextTick(); @@ -932,12 +925,18 @@ describe("Service Package Review Block", () => { }); }); +function initializeWithDefault(wrapper) { + wrapper.vm.initializeComponent({ + wipers: [testConstants.parts.frontWiperPart], + rainDefense: testConstants.parts.rainDefensePart, + }); +} + function generateDefaultProps() { return { servicePackageOptionsCmsName: testConstants.cmsPropValues.servicePackageOptionsCmsName, defaultPackageItemsCmsName: testConstants.cmsPropValues.defaultPackageItemsCmsName, vapsItemsCmsName: testConstants.cmsPropValues.vapsItemsCmsName, - availableVaps: [testConstants.parts.frontWiperPart, testConstants.parts.rainDefensePart], lineItems: { glassParts: [], supportingItems: [], From a1f47c2f07a7f129d2f252484259356d89179e5e Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 10:34:12 -0400 Subject: [PATCH 17/28] Add service-location-review component --- .../service-location-review.spec.js | 0 .../service-location-review.vue | 35 +++++++++++++++++++ src/layouts/review/review.vue | 12 +++++++ 3 files changed, 47 insertions(+) create mode 100644 src/layouts/review/review-sections/service-location-review/service-location-review.spec.js create mode 100644 src/layouts/review/review-sections/service-location-review/service-location-review.vue diff --git a/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js b/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js new file mode 100644 index 000000000..e69de29bb diff --git a/src/layouts/review/review-sections/service-location-review/service-location-review.vue b/src/layouts/review/review-sections/service-location-review/service-location-review.vue new file mode 100644 index 000000000..9f8a1ed6a --- /dev/null +++ b/src/layouts/review/review-sections/service-location-review/service-location-review.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index e28b8a95e..d89f6cfa0 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -62,6 +62,13 @@ :damage="damageInfo" :lineItems="lineItems" @edit-clicked="editServicePackage" /> + +
+ +
@@ -86,6 +93,7 @@ import textBlock from "@/digital-components/text-block/text-block"; import vehicleReview from "@/layouts/review/review-sections/vehicle-review/vehicle-review"; import damageReview from "@/layouts/review/review-sections/damage-review/damage-review"; import servicePackageReview from "@/layouts/review/review-sections/service-package-review/service-package-review"; +import serviceLocationReview from "@/layouts/review/review-sections/service-location-review/service-location-review"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -172,6 +180,9 @@ export default { lineItems() { return this.$store.getters.lineItems; }, + serviceLocationInfo() { + return this.$store.getters.order.serviceLocation; + }, }, components: { funnelHeader, @@ -182,6 +193,7 @@ export default { vehicleReview, damageReview, servicePackageReview, + serviceLocationReview, }, }; From e4997d67ca1cbb2ff56e7803523966ee6f775076 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 10:48:44 -0400 Subject: [PATCH 18/28] Add address rendering --- .../service-location-review.vue | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/layouts/review/review-sections/service-location-review/service-location-review.vue b/src/layouts/review/review-sections/service-location-review/service-location-review.vue index 9f8a1ed6a..16f1de446 100644 --- a/src/layouts/review/review-sections/service-location-review/service-location-review.vue +++ b/src/layouts/review/review-sections/service-location-review/service-location-review.vue @@ -25,7 +25,30 @@ export default { }, computed: { displayContent() { - return [`Address placeholder`]; + return [ + `${this.addressInfo.address}${this.addressInfo.address2 ? ", " : ""}${ + this.addressInfo.address2 + }, ${this.addressInfo.city}, ${this.addressInfo.state} ${this.addressInfo.zipCode}`, + ]; + }, + addressInfo() { + if (this.serviceLocation?.appointmentType === AppointmentTypeStrings.MOBILE) { + return { + address: this.serviceLocation?.address, + address2: this.serviceLocation?.address2, + city: this.serviceLocation?.city, + state: this.serviceLocation?.state, + zipCode: this.serviceLocation?.zipCode, + }; + } else { + return { + address: this.serviceLocation?.provider?.address?.streetAddress, + address2: "", + city: this.serviceLocation?.provider?.address?.city, + state: this.serviceLocation?.provider?.address?.state, + zipCode: this.serviceLocation?.provider?.address?.zipCode, + }; + } }, }, components: { From a289c03dc979a7a5326284638420f0b4763d07ff Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 11:33:46 -0400 Subject: [PATCH 19/28] Add back-navigation --- src/layouts/review/review.vue | 6 ++++++ src/router/router-constants/navigation-scenarios.js | 1 + src/router/router-constants/routing-table.js | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index d89f6cfa0..8780e75a7 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -160,6 +160,12 @@ export default { this.$route ); }, + editServiceLocation() { + this.$router.navigateWithoutSaving( + this.navigationScenarios.CLICKED_SERVICE_LOCATION_EDIT, + this.$route + ); + }, }, computed: { subHeaderTitle() { diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 88ca110dd..ae1c880ae 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -50,6 +50,7 @@ const navigationScenarios = { CLICKED_VEHICLE_EDIT: "CLICKED_VEHICLE_EDIT", CLICKED_DAMAGE_EDIT: "CLICKED_DAMAGE_EDIT", CLICKED_SERVICE_PACKAGE_EDIT: "CLICKED_SERVICE_PACKAGE_EDIT", + CLICKED_SERVICE_LOCATION_EDIT: "CLICKED_SERVICE_LOCATION_EDIT", }; export { navigationScenarios }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 4238b659a..017e1372a 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -480,6 +480,10 @@ const routingTable = function (store) { scenario: navigationScenarios.CLICKED_BACK, destinationFmgPageValue: fmgPageValues.CUSTOMER_DETAILS, }, + { + scenario: navigationScenarios.CLICKED_SERVICE_LOCATION_EDIT, + destinationFmgPageValue: fmgPageValues.SERVICE_LOCATION, + }, ], }, ]; From 23e4096a3cafb112dbe8fb989a5c9cc8222f3d5d Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 11:35:26 -0400 Subject: [PATCH 20/28] Convert null address2s to empty strings for mobile --- .../service-location-review/service-location-review.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layouts/review/review-sections/service-location-review/service-location-review.vue b/src/layouts/review/review-sections/service-location-review/service-location-review.vue index 16f1de446..db4f8188a 100644 --- a/src/layouts/review/review-sections/service-location-review/service-location-review.vue +++ b/src/layouts/review/review-sections/service-location-review/service-location-review.vue @@ -35,7 +35,7 @@ export default { if (this.serviceLocation?.appointmentType === AppointmentTypeStrings.MOBILE) { return { address: this.serviceLocation?.address, - address2: this.serviceLocation?.address2, + address2: this.serviceLocation?.address2 ?? "", city: this.serviceLocation?.city, state: this.serviceLocation?.state, zipCode: this.serviceLocation?.zipCode, From 5be62aefb0032702b8ffa079c137d63974e6e9b7 Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 13:00:28 -0400 Subject: [PATCH 21/28] Add tests --- .../service-location-review.spec.js | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js b/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js index e69de29bb..5ddcffc86 100644 --- a/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js +++ b/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js @@ -0,0 +1,123 @@ +import { shallowMount } from "@vue/test-utils"; +import { getMountOptions } from "@/helpers/unit-test-helper.js"; +import serviceLocationReview from "@/layouts/review/review-sections/service-location-review/service-location-review"; + +import { AppointmentTypeStrings } from "@/constants/schedule-constants"; + +const cmsContent = { + ServiceLocationTitleWidget: { + Text: "Title Text", + }, +}; + +describe("Service Location Review Block", () => { + it("Should render mobile address if mobile appointment", async () => { + // Arrange + const props = generateDefaultProps(); + + const { wrapper } = setupMocks({ + propsData: props + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toEqual(["Mobile Address 1, Mobile Address 2, Mobile City, MO 11111"]); + }); + + it("Should render service location address if inshop appointment.", async () => { + // Arrange + let props = generateDefaultProps(); + + props.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP; + + const { wrapper } = setupMocks({ + propsData: props + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toEqual(["Service Location Address, Service Location City, SL 22222"]); + }); + + it("Should render service location address if drop-off appointment", async () => { + // Arrange + let props = generateDefaultProps(); + + props.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF; + + const { wrapper } = setupMocks({ + propsData: props + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toEqual(["Service Location Address, Service Location City, SL 22222"]); + }); + + it("Should not add comma or any text if address2 is null", async () => { + // Arrange + let props = generateDefaultProps(); + + props.serviceLocation.address2 = null; + + const { wrapper } = setupMocks({ + propsData: props + }); + + // Act + await wrapper.vm.$nextTick(); + + // Assert + expect(wrapper.vm.displayContent).toEqual(["Mobile Address 1, Mobile City, MO 11111"]); + }); +}); + +function generateDefaultProps() { + return { + cmsWidgetName: "ServiceLocationTitleWidget", + serviceLocation: { + address: "Mobile Address 1", + address2: "Mobile Address 2", + city: "Mobile City", + state: "MO", + zipCode: "11111", + zipCodeCtu: "", + appointmentType: AppointmentTypeStrings.MOBILE, + isVehicleProtected: false, + provider: { + providerNumber: "", + address: { + streetAddress: "Service Location Address", + city: "Service Location City", + state: "SL", + zipCode: "22222", + zipCodeCtu: "", + }, + }, + }, + }; +} + +function setupMocks(customMountOptions) { + const mountOptions = getMountOptions(customMountOptions); + + const mockMixin = { + methods: { + getCmsContent: jest.fn((widgetName, cmsFieldName) => { + return cmsContent?.[widgetName]?.[cmsFieldName] ?? ""; + }), + }, + }; + + mountOptions.global.mixins = [mockMixin]; + + const wrapper = shallowMount(serviceLocationReview, mountOptions); + wrapper.vm.setCmsContent = jest.fn(); + return { wrapper }; +} \ No newline at end of file From 05df252bb6a458057bc79d12aee78dd169161cce Mon Sep 17 00:00:00 2001 From: Chloe Herd Date: Wed, 26 Jul 2023 13:01:06 -0400 Subject: [PATCH 22/28] Formatting --- .../service-location-review.spec.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js b/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js index 5ddcffc86..530e34f4a 100644 --- a/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js +++ b/src/layouts/review/review-sections/service-location-review/service-location-review.spec.js @@ -16,14 +16,16 @@ describe("Service Location Review Block", () => { const props = generateDefaultProps(); const { wrapper } = setupMocks({ - propsData: props + propsData: props, }); // Act await wrapper.vm.$nextTick(); // Assert - expect(wrapper.vm.displayContent).toEqual(["Mobile Address 1, Mobile Address 2, Mobile City, MO 11111"]); + expect(wrapper.vm.displayContent).toEqual([ + "Mobile Address 1, Mobile Address 2, Mobile City, MO 11111", + ]); }); it("Should render service location address if inshop appointment.", async () => { @@ -33,14 +35,16 @@ describe("Service Location Review Block", () => { props.serviceLocation.appointmentType = AppointmentTypeStrings.IN_SHOP; const { wrapper } = setupMocks({ - propsData: props + propsData: props, }); // Act await wrapper.vm.$nextTick(); // Assert - expect(wrapper.vm.displayContent).toEqual(["Service Location Address, Service Location City, SL 22222"]); + expect(wrapper.vm.displayContent).toEqual([ + "Service Location Address, Service Location City, SL 22222", + ]); }); it("Should render service location address if drop-off appointment", async () => { @@ -50,14 +54,16 @@ describe("Service Location Review Block", () => { props.serviceLocation.appointmentType = AppointmentTypeStrings.DROP_OFF; const { wrapper } = setupMocks({ - propsData: props + propsData: props, }); // Act await wrapper.vm.$nextTick(); // Assert - expect(wrapper.vm.displayContent).toEqual(["Service Location Address, Service Location City, SL 22222"]); + expect(wrapper.vm.displayContent).toEqual([ + "Service Location Address, Service Location City, SL 22222", + ]); }); it("Should not add comma or any text if address2 is null", async () => { @@ -67,7 +73,7 @@ describe("Service Location Review Block", () => { props.serviceLocation.address2 = null; const { wrapper } = setupMocks({ - propsData: props + propsData: props, }); // Act @@ -120,4 +126,4 @@ function setupMocks(customMountOptions) { const wrapper = shallowMount(serviceLocationReview, mountOptions); wrapper.vm.setCmsContent = jest.fn(); return { wrapper }; -} \ No newline at end of file +} From d24046a0f5e953392896dc050cf09d6e77e9c727 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 26 Jul 2023 13:24:04 -0400 Subject: [PATCH 23/28] CSR-1468 add aria-live="polite to alert messages. --- src/digital-components/dropdown-question/dropdown-question.vue | 2 +- src/digital-components/textbox-question/textbox-question.vue | 1 + .../mobile-location-modal-questions.vue | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/digital-components/dropdown-question/dropdown-question.vue b/src/digital-components/dropdown-question/dropdown-question.vue index 1d8fe22cd..b11336063 100644 --- a/src/digital-components/dropdown-question/dropdown-question.vue +++ b/src/digital-components/dropdown-question/dropdown-question.vue @@ -23,7 +23,7 @@
- {{ errorMessage }} + {{ errorMessage }}
diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index b82153895..b987fc1ba 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -69,6 +69,7 @@ {{ errorMessage }} diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index 07c6535dd..fa883fe01 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -17,7 +17,7 @@ @click-event="openModal" />
- + {{ errorMessage }}
From e2795cad0d8e0ad01c73de61ee1a0967ab4cf86f Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 26 Jul 2023 13:26:22 -0400 Subject: [PATCH 24/28] Format code. --- .../mobile-location-modal-questions.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue index fa883fe01..1274b97d5 100644 --- a/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue +++ b/src/layouts/service-location/mobile-location-modal-questions/mobile-location-modal-questions.vue @@ -17,7 +17,10 @@ @click-event="openModal" />
- + {{ errorMessage }}
From e676f843e09e6f2d76b9a9e2cba4f94f70dd3821 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 26 Jul 2023 14:56:36 -0400 Subject: [PATCH 25/28] CSR-1468 update aria to fix Jaws misread. --- src/digital-components/button-question/button-question.vue | 3 +++ .../dropdown-question/dropdown-question.vue | 2 +- src/digital-components/textbox-question/textbox-question.vue | 2 +- .../mobile-location-modal-questions.vue | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/digital-components/button-question/button-question.vue b/src/digital-components/button-question/button-question.vue index a53958dd5..13c81f815 100644 --- a/src/digital-components/button-question/button-question.vue +++ b/src/digital-components/button-question/button-question.vue @@ -74,6 +74,9 @@ https://safelite.atlassian.net/wiki/spaces/DC/pages/76644418/Button+Question+Com
diff --git a/src/digital-components/dropdown-question/dropdown-question.vue b/src/digital-components/dropdown-question/dropdown-question.vue index b11336063..7c0dd0d3b 100644 --- a/src/digital-components/dropdown-question/dropdown-question.vue +++ b/src/digital-components/dropdown-question/dropdown-question.vue @@ -23,7 +23,7 @@
- {{ errorMessage }} + {{ errorMessage }}
diff --git a/src/digital-components/textbox-question/textbox-question.vue b/src/digital-components/textbox-question/textbox-question.vue index b987fc1ba..f8fad8779 100644 --- a/src/digital-components/textbox-question/textbox-question.vue +++ b/src/digital-components/textbox-question/textbox-question.vue @@ -68,7 +68,7 @@
{{ errorMessage }} + aria-atomic="true" + aria-live="polite"> {{ errorMessage }}
From f5bc3634e2fcf1c99662f09ace020aca06e055ba Mon Sep 17 00:00:00 2001 From: sheena Date: Thu, 27 Jul 2023 19:52:27 +0530 Subject: [PATCH 26/28] CSR-1561 Updated the space between the footer and the link viewmore --- src/digital-components/date-picker/date-picker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 2530327c2..bd1ce8fe2 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -711,7 +711,7 @@ export default { } .date-picker { position: relative; - flex-grow: 1; + flex-grow: 0; display: flex; flex-direction: column; From 5f2bce24155802b158823475c6f8a93f64aa7e90 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Thu, 27 Jul 2023 15:32:14 -0400 Subject: [PATCH 27/28] Fix Address-Lookup error --- src/store/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/store/index.js b/src/store/index.js index c3c9fc8a0..44b1c0864 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2172,6 +2172,9 @@ function convertGlassPieceToBackEndCompatibleFormat(glassPieces) { } function providersEqual(providerA, providerB) { + if (!providerA) { + return false; + } return ( providerA.providerNumber === providerB.providerNumber && providerA.address?.city === providerB.address?.city && From 98fdb82ccb8074d80d62db9fd9022f400e351169 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Thu, 27 Jul 2023 16:36:48 -0400 Subject: [PATCH 28/28] Vin-Lookup pages defect fix Replace/Remove usages of SaveServiceLocation with SaveZipCodeInfo --- src/layouts/address-lookup/address-lookup.vue | 6 +-- src/layouts/vin-lookup/vin-lookup.vue | 37 ++++++------------- src/store/index.js | 3 -- 3 files changed, 13 insertions(+), 33 deletions(-) diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 727828649..3f124f896 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -338,12 +338,10 @@ export default { false ); await this.dispatchStoreAction( - storeActions.SAVE_SERVICE_LOCATION, + storeActions.SAVE_SERVICE_ZIP_CODE_INFO, { - address: this.customerQuestions.addressQuestions.streetAddress, - city: this.customerQuestions.addressQuestions.city, - zipCode: this.serviceZipCode, state: resultMap.serviceZipValidationResponse.state, + zipCode: this.serviceZipCode, zipCodeCtu: resultMap.serviceZipValidationResponse.zipCodeCtu, }, false diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index faf978f92..2e35b64b7 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -350,37 +350,22 @@ export default { // If a VIN has already been found. Validate the Service Zip (in case of changes) const zipCodeData = await this.getZipCodeData(this.serviceZipCode); - // Check if Service Zip entered is serviceable then save the ZIP info and email address + // Check if Service Zip entered is serviceable then save the ZIP info if (zipCodeData.isServiceable) { - //Only save the service location if the zip changed or we lack zipCodeCtu + //Only save the zipCode, state, and zipCodeCtu if the zip changed or we lack zipCodeCtu if ( this.$store.getters.order.serviceLocation.zipCode != this.serviceZipCode || !this.$store.getters.order.serviceLocation.zipCodeCtu ) { - const vehicleRegistrationInfo = this.$store.getters.vehicle.registration; - if (vehicleRegistrationInfo.zipCode == this.serviceZipCode) { - await this.dispatchStoreAction( - storeActions.SAVE_SERVICE_LOCATION, - { - address: vehicleRegistrationInfo.address, - city: vehicleRegistrationInfo.city, - state: vehicleRegistrationInfo.state, - zipCode: vehicleRegistrationInfo.zipCode, - zipCodeCtu: zipCodeData.zipCodeCtu, - }, - false - ); - } else { - await this.dispatchStoreAction( - storeActions.SAVE_SERVICE_ZIP_CODE_INFO, - { - state: zipCodeData.state, - zipCode: this.serviceZipCode, - zipCodeCtu: zipCodeData.zipCodeCtu, - }, - false - ); - } + await this.dispatchStoreAction( + storeActions.SAVE_SERVICE_ZIP_CODE_INFO, + { + state: zipCodeData.state, + zipCode: this.serviceZipCode, + zipCodeCtu: zipCodeData.zipCodeCtu, + }, + false + ); } await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailAddress, false); diff --git a/src/store/index.js b/src/store/index.js index 44b1c0864..c3c9fc8a0 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2172,9 +2172,6 @@ function convertGlassPieceToBackEndCompatibleFormat(glassPieces) { } function providersEqual(providerA, providerB) { - if (!providerA) { - return false; - } return ( providerA.providerNumber === providerB.providerNumber && providerA.address?.city === providerB.address?.city &&