From fcc6ce7be7b5ed2f700a1c685c57e7ba078bea2c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:25:40 +0000 Subject: [PATCH 1/9] Bump minimatch from 3.0.4 to 3.1.2 Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2. - [Release notes](https://github.com/isaacs/minimatch/releases) - [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md) - [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2) --- updated-dependencies: - dependency-name: minimatch dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index c308b7429..611e0f226 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16958,9 +16958,9 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -38027,9 +38027,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" From 10e49b041f392f05477a5aea4b889c0bd23c8161 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Tue, 7 Feb 2023 13:56:31 -0500 Subject: [PATCH 2/9] CSR-1166 | Update navigation rules with Quote page --- src/helpers/heritage-integration/navigation-helper.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/helpers/heritage-integration/navigation-helper.js b/src/helpers/heritage-integration/navigation-helper.js index 6fa248c63..0e756a8a4 100644 --- a/src/helpers/heritage-integration/navigation-helper.js +++ b/src/helpers/heritage-integration/navigation-helper.js @@ -28,7 +28,11 @@ export async function getPageToRouteExistingOrderTo(toRoute = {}, existingHerita // If navigating to a specific page, and that page is not part of the vin pages. // Return that page, so that it can navigate like normal. - if (toRoute.query[queryStrings.FMG_PAGE] !== undefined && !isVinRelatedPage(toRoute)) { + if ( + toRoute.query[queryStrings.FMG_PAGE] !== undefined && + toRoute.query[queryStrings.FMG_PAGE] !== fmgPageValues.QUOTE && + !isVinRelatedPage(toRoute) + ) { return overrideYmmsDirectionIfNeeded(toRoute); } @@ -107,6 +111,7 @@ async function getLatestPageForRedirection() { const capabilityQuestionsComponent = await getLazyLoadedComponent( fmgPageValues.CAPABILITY_QUESTIONS ); + const quoteComponent = await getLazyLoadedComponent(fmgPageValues.QUOTE); const skipVin = await skipVinLookup(); @@ -121,7 +126,9 @@ async function getLatestPageForRedirection() { } else if (!estimateComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.VEHICLE_DAMAGE; } else { - if (capabilityQuestionsComponent.methods.arePagePrerequisitesValid()) { + if (quoteComponent.methods.arePagePrerequisitesValid()) { + return fmgPageValues.QUOTE; + } else if (capabilityQuestionsComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.CAPABILITY_QUESTIONS; } else if (moldingQuestionsComponent.methods.arePagePrerequisitesValid()) { return fmgPageValues.MOLDING_QUESTIONS; From cbd5cb44b0f5d39ae738aef52431e4e1221e8fda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:59:47 +0000 Subject: [PATCH 3/9] Bump eventsource from 1.1.0 to 1.1.2 Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2. - [Release notes](https://github.com/EventSource/eventsource/releases) - [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md) - [Commits](https://github.com/EventSource/eventsource/compare/v1.1.0...v1.1.2) --- updated-dependencies: - dependency-name: eventsource dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 38 +++++++------------------------------- 1 file changed, 7 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index e106ab85a..1f93b7ac1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10043,13 +10043,10 @@ } }, "node_modules/eventsource": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", - "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz", + "integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA==", "dev": true, - "dependencies": { - "original": "^1.0.0" - }, "engines": { "node": ">=0.12.0" } @@ -17848,15 +17845,6 @@ "node": ">=6" } }, - "node_modules/original": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", - "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", - "dev": true, - "dependencies": { - "url-parse": "^1.4.3" - } - }, "node_modules/os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", @@ -32462,13 +32450,10 @@ "dev": true }, "eventsource": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.0.tgz", - "integrity": "sha512-VSJjT5oCNrFvCS6igjzPAt5hBzQ2qPBFIbJ03zLI9SE0mxwZpMw6BfJrbFHm1a141AavMEB8JHmBhWAd66PfCg==", - "dev": true, - "requires": { - "original": "^1.0.0" - } + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-1.1.2.tgz", + "integrity": "sha512-xAH3zWhgO2/3KIniEKYPr8plNSzlGINOUqYj0m0u7AB81iRw8b/3E73W6AuU+6klLbaSFmZnaETQ2lXPfAydrA==", + "dev": true }, "evp_bytestokey": { "version": "1.0.3", @@ -38749,15 +38734,6 @@ } } }, - "original": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/original/-/original-1.0.2.tgz", - "integrity": "sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg==", - "dev": true, - "requires": { - "url-parse": "^1.4.3" - } - }, "os-browserify": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", From ca0ced5324d7726af9455de2f9e6b28193f7e6b2 Mon Sep 17 00:00:00 2001 From: Matt Sykes Date: Mon, 27 Feb 2023 13:58:38 -0500 Subject: [PATCH 4/9] cleaned up CF cache invalidation issue --- azure-pipelines.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 777122777..a3ff58ac5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -101,11 +101,16 @@ 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__) - cfDistributionId: $(vueCfDistributionId) - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps parameters: awsCliContainer: awscli distributionId: $(apiCfDistributionId) + paths: /* + awsProfile: $(devDeploymentProfile) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(cfDistributionId) paths: /fmg/* awsProfile: $(devDeploymentProfile) @@ -153,11 +158,16 @@ 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__) - cfDistributionId: $(vueCfDistributionId) - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps parameters: awsCliContainer: awscli distributionId: $(apiCfDistributionId) + paths: /* + awsProfile: $(sysDeploymentProfile) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(cfDistributionId) paths: /fmg/* awsProfile: $(sysDeploymentProfile) @@ -205,11 +215,16 @@ 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__) - cfDistributionId: $(vueCfDistributionId) - 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: /fmg/* awsProfile: $(qaDeploymentProfile) @@ -257,11 +272,16 @@ 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__) - cfDistributionId: $(apiCfDistributionId) - 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: /fmg/* awsProfile: $(prodDeploymentProfile) - template: templates/digital/auto-tag.yml@AzureDevOps From 896555b4778b97919edb7c26cf88fb86cbcd169e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 21:34:31 +0000 Subject: [PATCH 5/9] Bump terser from 4.8.0 to 4.8.1 Bumps [terser](https://github.com/terser/terser) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v4.8.0...v4.8.1) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f93b7ac1..b0db5724c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21517,9 +21517,9 @@ } }, "node_modules/terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", "dev": true, "dependencies": { "commander": "^2.20.0", @@ -41789,9 +41789,9 @@ "dev": true }, "terser": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz", - "integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==", + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz", + "integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==", "dev": true, "requires": { "commander": "^2.20.0", From 7304729717eea21de083d3614078205e631004c7 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 1 Mar 2023 10:09:45 -0500 Subject: [PATCH 6/9] CSR-969 Hide the home address lookup if a provided zip is in a state that prohibits it --- src/constants/endpoints.js | 4 ++++ src/constants/store-actions.js | 1 + src/layouts/estimate/estimate.vue | 21 +++++++++++++++++++++ src/store/index.js | 7 +++++++ 4 files changed, 33 insertions(+) diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 9f4c60d61..1fc6c2b8f 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -54,6 +54,10 @@ const endpoints = { url: "/vehicle/api/v1/vehicle/lookup-vin-by-address", method: "POST", }, + IsVinByAddressPermissible: { + url: "/vehicle/api/v1/vehicle/is-vin-by-address-permissible", + method: "GET", + }, GetPartsOrQuestions: { url: "/parts/api/v1/parts/parts-or-questions", method: "POST", diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 428280d40..c11356d69 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -13,6 +13,7 @@ const storeActions = { GET_DAMAGE_OPTIONS: "getDamageOptions", GET_EVOX_IMAGE: "getEvoxImage", IS_VIN_OPTIONAL_VEHICLE: "isVinOptionalVehicle", + IS_VIN_BY_ADDRESS_PERMISSIBLE: "isVinByAddressPermissible", // Lookup Actions LOOKUP_VEHICLE_BY_YMMS: "lookupVehicleByYmms", diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 4eafab25e..893f76cb8 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -112,6 +112,8 @@ import { experimentSettings } from "@/constants/experiments"; import vinPagesMixin from "@/mixins/vin-pages-mixin"; import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import { saveSession } from "@/helpers/heritage-integration/order-helper.js"; +import baseMixin from "@/mixins/base-mixin.js"; +import { queryStrings } from "@/constants/query-strings"; // Define Validation Rules defineRule("zip-required", required(errorMessages.SERVICE_ZIP_REQUIRED)); @@ -145,12 +147,25 @@ export default { //Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); + const zip = Object.hasOwn(to.query, queryStrings.ZIP_CODE) ? to.query.zipCode : null; + var vinByAddressPromise; + if (zip) { + vinByAddressPromise = baseMixin.methods.dispatchStoreAction( + storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE, + zip, false + ); + } + //Settle promises and get results const promiseResultMap = [ { resultKey: "cmsContent", promise: cmsContentPromise, }, + (zip != null && zip != undefined) && { + resultKey: "vinByAddress", + promise: vinByAddressPromise, + }, ]; const resultMap = await settleAllPromises(promiseResultMap); @@ -172,6 +187,12 @@ export default { } } + if (zip){ + var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(answer => answer.Name === 'HomeAddress') + if (indexToRemove){ + resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1); + } + } vm.setCmsContent(resultMap.cmsContent); }); }, diff --git a/src/store/index.js b/src/store/index.js index 93a3e5a25..f42a950ea 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -530,6 +530,13 @@ export const actions = { }, }); }, + isVinByAddressPermissible(context, zip) { + return globalMethods.callHttpClient({ + method: endpoints.IsVinByAddressPermissible.method, + endpoint: `${endpoints.IsVinByAddressPermissible.url}?zipcode=${zip}`, + payload: {}, + }); + }, getVehicleMakes(context, { year }) { return globalMethods.callHttpClient({ method: endpoints.GetVehicleMakes.method, From afcd713fdba5ef835c86245d8979d2dfb9ae2a56 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Wed, 1 Mar 2023 11:35:40 -0500 Subject: [PATCH 7/9] CSR-969 prettier --- src/layouts/estimate/estimate.vue | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 893f76cb8..722357e62 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -152,7 +152,8 @@ export default { if (zip) { vinByAddressPromise = baseMixin.methods.dispatchStoreAction( storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE, - zip, false + zip, + false ); } @@ -162,10 +163,11 @@ export default { resultKey: "cmsContent", promise: cmsContentPromise, }, - (zip != null && zip != undefined) && { - resultKey: "vinByAddress", - promise: vinByAddressPromise, - }, + zip != null && + zip != undefined && { + resultKey: "vinByAddress", + promise: vinByAddressPromise, + }, ]; const resultMap = await settleAllPromises(promiseResultMap); @@ -187,9 +189,11 @@ export default { } } - if (zip){ - var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex(answer => answer.Name === 'HomeAddress') - if (indexToRemove){ + if (zip) { + var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( + (answer) => answer.Name === "HomeAddress" + ); + if (indexToRemove) { resultMap.cmsContent.VinLookupMethod.Answers.splice(indexToRemove, 1); } } From 9ec12c81bdc9e70005edb0d638f0a9003d5c5c80 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 2 Mar 2023 09:43:00 -0500 Subject: [PATCH 8/9] CSR-945 CSR-969 use lower case for querystring parms --- src/constants/query-strings.js | 2 +- src/layouts/estimate/estimate.vue | 12 ++++++++---- .../license-plate-lookup/license-plate-lookup.vue | 2 +- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/router/index.js | 14 +++++++++++--- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/constants/query-strings.js b/src/constants/query-strings.js index d2dbcf976..5ff1f636c 100644 --- a/src/constants/query-strings.js +++ b/src/constants/query-strings.js @@ -1,7 +1,7 @@ const queryStrings = { FMG_PAGE: "fmgPage", START_TYPE: "start_type", - ZIP_CODE: "zipCode", + ZIP_CODE: "zipcode", }; export { queryStrings }; diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 722357e62..cfec5923d 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -134,7 +134,7 @@ export default { data() { return { selectedVinLookupMethod: null, - serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode, + serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, emailAddress: this.getEmailFromStore(), displayInvalidZipAlert: false, displayNonServiceableZipAlert: false, @@ -147,9 +147,13 @@ export default { //Call APIs const cmsContentPromise = fetchCmsContentForPage(to.query.fmgPage); - const zip = Object.hasOwn(to.query, queryStrings.ZIP_CODE) ? to.query.zipCode : null; + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + const hasZip = urlParams.has(queryStrings.ZIP_CODE); + const zip = urlParams.get(queryStrings.ZIP_CODE); + var vinByAddressPromise; - if (zip) { + if (hasZip) { vinByAddressPromise = baseMixin.methods.dispatchStoreAction( storeActions.IS_VIN_BY_ADDRESS_PERMISSIBLE, zip, @@ -189,7 +193,7 @@ export default { } } - if (zip) { + if (zip && resultMap.vinByAddress === false) { var indexToRemove = resultMap.cmsContent.VinLookupMethod.Answers.findIndex( (answer) => answer.Name === "HomeAddress" ); diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index ec54fd4f7..c97791937 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -152,7 +152,7 @@ export default { data() { return { licensePlate: this.getLicensePlateFromStore(), - registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipCode, + registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipcode, email: this.getEmailFromStore(), serviceZipCode: this.getServiceZipFromStore(), displayNonServiceableZipAlert: false, diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 17e981bc8..e42187b12 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -176,7 +176,7 @@ export default { data() { return { vin: this.getVinFromStore(), - serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode, + serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipcode, emailAddress: this.getEmailFromStore(), isCarIdDifferent: false, customAlertData: {}, diff --git a/src/router/index.js b/src/router/index.js index 409ce0419..c94ef65e3 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -265,14 +265,22 @@ async function navigate( fmgPage: destinationFmgPageValue, }; - if ( - Object.hasOwn(currentRoute.query, queryStrings.ZIP_CODE) && + const queryString = window.location.search; + const urlParams = new URLSearchParams(queryString); + const lowerCaseParams = new URLSearchParams(); + for (const [name, value] of urlParams) { + lowerCaseParams.append(name.toLowerCase(), value); + } + const hasZip = lowerCaseParams.has(queryStrings.ZIP_CODE); + const zip = lowerCaseParams.get(queryStrings.ZIP_CODE); + + if (hasZip && (store.getters.order.serviceLocation.zipCode === undefined || store.getters.order.serviceLocation.zipCode == null) && (store.getters.order.vehicle.registration.zipCode === undefined || store.getters.order.vehicle.registration.zipCode == null) ) { - queryStringsObject[queryStrings.ZIP_CODE] = currentRoute.query.zipCode; + queryStringsObject[queryStrings.ZIP_CODE] = zip; } router.push({ From a29fb2b2a4b9ee3d05eea087d90784178d589d63 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Thu, 2 Mar 2023 09:46:53 -0500 Subject: [PATCH 9/9] CSR-945 CSR-946 prettier --- src/router/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index c94ef65e3..eb8e3947c 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -274,7 +274,8 @@ async function navigate( const hasZip = lowerCaseParams.has(queryStrings.ZIP_CODE); const zip = lowerCaseParams.get(queryStrings.ZIP_CODE); - if (hasZip && + if ( + hasZip && (store.getters.order.serviceLocation.zipCode === undefined || store.getters.order.serviceLocation.zipCode == null) && (store.getters.order.vehicle.registration.zipCode === undefined ||