From 2b5dc365d054291855b9b8f18e5fe6458f24d029 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 20 Apr 2023 09:00:16 -0400 Subject: [PATCH 1/2] CSR-1337 Address look up option restrict to only zips that are able to look up address --- src/layouts/estimate/estimate.vue | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index cfec5923d..b9929813a 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -149,11 +149,17 @@ export default { const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); - const hasZip = urlParams.has(queryStrings.ZIP_CODE); - const zip = urlParams.get(queryStrings.ZIP_CODE); + const lowerCaseParams = new URLSearchParams(); + for (const [name, value] of urlParams) { + lowerCaseParams.append(name.toLowerCase(), value); + } + + const zip = lowerCaseParams.get(queryStrings.ZIP_CODE) + ? lowerCaseParams.get(queryStrings.ZIP_CODE) + : store.getters.order.serviceLocation.zipCode; var vinByAddressPromise; - if (hasZip) { + if (zip) { vinByAddressPromise = baseMixin.methods.dispatchStoreAction( storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE, zip, @@ -193,7 +199,7 @@ export default { } } - if (zip && resultMap.vinByAddress === false) { + if (!zip || resultMap.vinByAddress === false) { var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( (answer) => answer.Name === "HomeAddress" ); @@ -201,6 +207,7 @@ export default { resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1); } } + vm.setCmsContent(resultMap.cmsContent); }); }, From 0a4645c605a0b4d606f254e696fab5e3df8c1b4f Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 20 Apr 2023 10:16:51 -0400 Subject: [PATCH 2/2] CSR-1337 --- src/layouts/estimate/estimate.spec.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/layouts/estimate/estimate.spec.js b/src/layouts/estimate/estimate.spec.js index 4a0a3f434..462287851 100644 --- a/src/layouts/estimate/estimate.spec.js +++ b/src/layouts/estimate/estimate.spec.js @@ -101,6 +101,9 @@ describe("estimate.vue", () => { //Arrange const { wrapper } = setupMocks({}); + delete window.location; + window.location = { search: "?fmgPage=estimate&zipcode=43015" }; + //Act estimate.beforeRouteEnter.call( wrapper.vm,