From 3394266714f2ded855bce8fcb04d11b62dec06a2 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Tue, 2 May 2023 12:15:41 -0400 Subject: [PATCH 1/3] change serviceType to damageType --- .../service-location-helper.spec.js | 8 ++++---- src/store/index.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js index 061fd6bcd..cb075c38f 100644 --- a/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js +++ b/src/layouts/service-location/helpers/service-location-helper/service-location-helper.spec.js @@ -48,7 +48,7 @@ describe("service-location-helper.js", () => { it("Should return null if no service zip code is passed in", async () => { // Arrange const serviceZipCode = null; - const serviceType = "Replace"; + const damageType = "Replace"; const parentAccountNumber = 167132; const billToAccountNumber = 1234; const expected = null; @@ -56,7 +56,7 @@ describe("service-location-helper.js", () => { // Act const result = await getPricedMobileFeePart( serviceZipCode, - serviceType, + damageType, parentAccountNumber, billToAccountNumber ); @@ -68,7 +68,7 @@ describe("service-location-helper.js", () => { it("Should return the priced mobile fee part", async () => { // Arrange const serviceZipCode = "43235"; - const serviceType = "Replace"; + const damageType = "Replace"; const parentAccountNumber = 167132; const billToAccountNumber = 1234; @@ -84,7 +84,7 @@ describe("service-location-helper.js", () => { // Act const result = await getPricedMobileFeePart( serviceZipCode, - serviceType, + damageType, parentAccountNumber, billToAccountNumber ); diff --git a/src/store/index.js b/src/store/index.js index c57dd5733..420248024 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -954,13 +954,13 @@ export const actions = { }, getMobileFeePart(context) { - const serviceType = context.getters.damage.isRepair ? "Repair" : "Replace"; + const damageType = context.getters.damage.isRepair ? "Repair" : "Replace"; const parentAccountNumber = context.getters.payment.parentAccountNumber; const billToAccountNumber = 87291; // TODO: MAKE THIS REAL return globalMethods.callHttpClient({ method: endpoints.GetMobileFeePart.method, - endpoint: `${endpoints.GetMobileFeePart.url}/${serviceType}/${parentAccountNumber}/${billToAccountNumber}`, + endpoint: `${endpoints.GetMobileFeePart.url}/${damageType}/${parentAccountNumber}/${billToAccountNumber}`, }); }, @@ -999,7 +999,7 @@ export const actions = { endpoint: endpoints.GetSupportingItems.url, payload: { carId: carId, - serviceType: isRepair ? "Repair" : "Replace", + damageType: isRepair ? "Repair" : "Replace", parentAccountNumber: applicationConfig.CASH_PARENT_ACCOUNT_NUMBER, parts: glassPartsArray, numberOfRepairChips: isRepair ? numberOfChips : 0, From b3f4e09a21725960eb265a82ef6bd56a1af04864 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 3 May 2023 09:23:22 -0400 Subject: [PATCH 2/3] Tech review changes --- .../license-plate-lookup.spec.js | 1 - .../service-location/service-location.vue | 7 ------- .../shop-question/shop-question.spec.js | 1 + .../shop-question/shop-question.vue | 17 ++++++----------- src/mixins/base-mixin.js | 8 ++++++++ 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js index b23f5c101..bf5751637 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.spec.js +++ b/src/layouts/license-plate-lookup/license-plate-lookup.spec.js @@ -525,7 +525,6 @@ describe("license-plate-lookup.vue", () => { }); const registrationZip = "12345"; const serviceZip = "12345"; - console.log("this is the test I care about"); wrapper.vm.navigateForward = jest.fn(); const vinLookup = { data: { vehicle: { carId: "TESTID1" } } }; diff --git a/src/layouts/service-location/service-location.vue b/src/layouts/service-location/service-location.vue index 5fdf261f8..db8f0ab30 100644 --- a/src/layouts/service-location/service-location.vue +++ b/src/layouts/service-location/service-location.vue @@ -75,7 +75,6 @@ v-model="providerNumber" :serviceZipCode="zipCode" :selectedAppointmentType="selectedAppointmentType" - :shopQuestionData="shopQuestionInitialData" cmsWidgetName="ShopQuestionWidget" /> @@ -296,12 +295,6 @@ export default { displayNoShopsAlert() { return !this.isServiceableInshop && !this.isServiceableMobile; }, - isDropoff() { - return this.selectedAppointmentType === "Dropoff"; - }, - isMobile() { - return this.selectedAppointmentType === "Mobile"; - }, }, methods: { arePagePrerequisitesValid() { diff --git a/src/layouts/service-location/shop-question/shop-question.spec.js b/src/layouts/service-location/shop-question/shop-question.spec.js index 7f67737fa..32607d749 100644 --- a/src/layouts/service-location/shop-question/shop-question.spec.js +++ b/src/layouts/service-location/shop-question/shop-question.spec.js @@ -12,6 +12,7 @@ jest.mock("@/mixins/base-mixin", () => ({ }); } }, + scrollToPageBottom() {} }, })); diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index 2610fd787..f743df39d 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -59,7 +59,6 @@ export default { return { shops: [], shopListButton: shopListButton, - availability: "high", answers: [], shopIndex: 0, displaySeeMoreLocationsLink: false, @@ -102,10 +101,10 @@ export default { }, async getNextShopsFromList(numberToGet = 3) { const shopIterator = (array, n) => { - let l = array.length; + const l = array.length; return () => { - var end = this.shopIndex + n; - var part = array.slice(this.shopIndex, end); + const end = this.shopIndex + n; + const part = array.slice(this.shopIndex, end); this.shopIndex = end < l ? end : this.shops.length; return part; }; @@ -120,7 +119,6 @@ export default { buttonLabel: shop.city, buttonLabelSubCopy: `${shop.distance} mi`, buttonBodyCopy: `${shop.streetAddress}, ${shop.city}, ${shop.state} ${shop.zipCode}`, - //buttonAuxillaryCopy: `foo`, }; }); @@ -142,7 +140,8 @@ export default { await this.$nextTick(); - this.scrollToBottom(); + this.scrollToPageBottom(); + }, resetShopList() { this.answers = []; @@ -150,10 +149,6 @@ export default { this.selectedValue = ""; this.$refs.buttonQuestion.resetField(); }, - scrollToBottom() { - const container = document.getElementsByClassName("page-container-grouped-styles")[0]; - container.scrollTo({ top: container.scrollHeight, left: 0, behavior: "smooth" }); - }, async reloadShopData(serviceZipCode) { const result = await this.loadInitialData(serviceZipCode); this.initializeComponent(result.data); @@ -176,7 +171,7 @@ export default { await this.$nextTick(); - this.scrollToBottom(); + this.scrollToPageBottom(); }, }, shops: { diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 43ce4c132..e7c64387d 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -99,6 +99,14 @@ export default { getTotalLineItemPrice(lineItem) { return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice; }, + scrollToPageTop() { + const container = document.getElementsByClassName("page-container-grouped-styles")[0]; + container.scrollTo({ top: 0, left: 0, behavior: "smooth" }); + }, + scrollToPageBottom() { + const container = document.getElementsByClassName("page-container-grouped-styles")[0]; + container.scrollTo({ top: container.scrollHeight, left: 0, behavior: "smooth" }); + } }, computed: { storeActions() { From 89e1708288f5c071520bf1b8f2c90637794ad01d Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 3 May 2023 09:25:16 -0400 Subject: [PATCH 3/3] Prettified --- .../service-location/shop-question/shop-question.spec.js | 2 +- .../service-location/shop-question/shop-question.vue | 1 - src/mixins/base-mixin.js | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/layouts/service-location/shop-question/shop-question.spec.js b/src/layouts/service-location/shop-question/shop-question.spec.js index 32607d749..8b26dfee6 100644 --- a/src/layouts/service-location/shop-question/shop-question.spec.js +++ b/src/layouts/service-location/shop-question/shop-question.spec.js @@ -12,7 +12,7 @@ jest.mock("@/mixins/base-mixin", () => ({ }); } }, - scrollToPageBottom() {} + scrollToPageBottom() {}, }, })); diff --git a/src/layouts/service-location/shop-question/shop-question.vue b/src/layouts/service-location/shop-question/shop-question.vue index f743df39d..cbe022d5e 100644 --- a/src/layouts/service-location/shop-question/shop-question.vue +++ b/src/layouts/service-location/shop-question/shop-question.vue @@ -141,7 +141,6 @@ export default { await this.$nextTick(); this.scrollToPageBottom(); - }, resetShopList() { this.answers = []; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index e7c64387d..488500639 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -101,12 +101,12 @@ export default { }, scrollToPageTop() { const container = document.getElementsByClassName("page-container-grouped-styles")[0]; - container.scrollTo({ top: 0, left: 0, behavior: "smooth" }); + container.scrollTo({ top: 0, left: 0, behavior: "smooth" }); }, scrollToPageBottom() { const container = document.getElementsByClassName("page-container-grouped-styles")[0]; - container.scrollTo({ top: container.scrollHeight, left: 0, behavior: "smooth" }); - } + container.scrollTo({ top: container.scrollHeight, left: 0, behavior: "smooth" }); + }, }, computed: { storeActions() {