From e2d17369bbbba0c8f2859f1306c56d745f68fbde Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 24 Jan 2023 12:07:55 -0500 Subject: [PATCH 1/5] Merge code from ISS to FMG. --- src/constants/application-config.js | 1 + src/ux-components/alert/alert.vue | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 8f12760fc..16b9d85fc 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -7,6 +7,7 @@ const applicationConfig = { CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod" APPLICATION_NAME: "FixMyGlass", APPLICATION_ABBREVIATION: "fmg", + APPLICATION_QUERYSTRING: 'fmgPage', SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", CASH_ACCOUNT_NUMBER: 167132, }; diff --git a/src/ux-components/alert/alert.vue b/src/ux-components/alert/alert.vue index ca5ea7f45..6d06c0334 100644 --- a/src/ux-components/alert/alert.vue +++ b/src/ux-components/alert/alert.vue @@ -19,7 +19,7 @@ {{ getLinkDisplayTextFromCopy(copy) }} Date: Tue, 24 Jan 2023 12:12:56 -0500 Subject: [PATCH 2/5] Code format. --- src/constants/application-config.js | 2 +- src/ux-components/alert/alert.vue | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 16b9d85fc..96b4a9e78 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -7,7 +7,7 @@ const applicationConfig = { CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod" APPLICATION_NAME: "FixMyGlass", APPLICATION_ABBREVIATION: "fmg", - APPLICATION_QUERYSTRING: 'fmgPage', + APPLICATION_QUERYSTRING: "fmgPage", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", CASH_ACCOUNT_NUMBER: 167132, }; diff --git a/src/ux-components/alert/alert.vue b/src/ux-components/alert/alert.vue index 6d06c0334..0c3ac4b99 100644 --- a/src/ux-components/alert/alert.vue +++ b/src/ux-components/alert/alert.vue @@ -19,7 +19,9 @@ {{ getLinkDisplayTextFromCopy(copy) }} Date: Tue, 24 Jan 2023 16:06:29 -0500 Subject: [PATCH 3/5] CSR-1024 match/merge code from ISS. --- src/constants/application-config.js | 2 +- src/helpers/cms-content-helper.js | 4 ++-- .../address-vehicles/address-vehicles.vue | 12 ++++++------ .../service-package-radio.vue | 12 ++++++------ src/ux-components/alert/alert.spec.js | 2 +- src/ux-components/alert/alert.vue | 18 ++++++++---------- 6 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 96b4a9e78..550112bcc 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -7,7 +7,7 @@ const applicationConfig = { CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod" APPLICATION_NAME: "FixMyGlass", APPLICATION_ABBREVIATION: "fmg", - APPLICATION_QUERYSTRING: "fmgPage", + PAGE_QUERYSTRING: "fmgPage", SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass", CASH_ACCOUNT_NUMBER: 167132, }; diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js index 6ff18a53e..b4927894f 100644 --- a/src/helpers/cms-content-helper.js +++ b/src/helpers/cms-content-helper.js @@ -303,7 +303,7 @@ export function splitCopyOnCMSPlaceHolder(copy) { * Returns string2 of input following this pattern: {string1:string2,string3} * @returns string */ -export function getLinkTargetFromCopy(copy) { +export function getRouterLinkRouteFromCopy(copy) { // sample input: {routerLink:estimate,provide your VIN} // first split would return 'estimate,provide your VIN' // second split would return 'estimate' @@ -314,7 +314,7 @@ export function getLinkTargetFromCopy(copy) { * Returns string3 of input following this pattern: {string1:string2,string3} * @returns string */ -export function getLinkDisplayTextFromCopy(copy) { +export function getRouterLinkDisplayTextFromCopy(copy) { // sample input: {routerLink:estimate,provide your VIN} // first split would return 'estimate,provide your VIN' // second split would return 'provide your VIN' diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index 92b775b3b..35f441da7 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -25,10 +25,10 @@ {{ getLinkDisplayTextFromCopy(copy) }}{{ getRouterLinkDisplayTextFromCopy(copy) }} @@ -66,8 +66,8 @@ import { isGlassAvailableForCarId } from "@/helpers/damage-helper"; import { doesCopyContainRouterLink, splitCopyOnCMSPlaceHolder, - getLinkTargetFromCopy, - getLinkDisplayTextFromCopy, + getRouterLinkRouteFromCopy, + getRouterLinkDisplayTextFromCopy, } from "@/helpers/cms-content-helper"; import { routerParams } from "@/router/router-constants/router-params"; import vinPagesMixin from "@/mixins/vin-pages-mixin"; @@ -151,8 +151,8 @@ export default { methods: { doesCopyContainRouterLink, splitCopyOnCMSPlaceHolder, - getLinkTargetFromCopy, - getLinkDisplayTextFromCopy, + getRouterLinkRouteFromCopy, + getRouterLinkDisplayTextFromCopy, arePagePrerequisitesValid() { if ( store.getters.order.vehicle.carId && diff --git a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue index e50f18820..9738d3dde 100644 --- a/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue +++ b/src/layouts/quote/service-package-question/service-package-radio/service-package-radio.vue @@ -30,10 +30,10 @@ @@ -55,8 +55,8 @@ import baseInputButton from "@/digital-components/base-input-button/base-input-b import textLink from "@/ux-components/text-link/text-link"; import inputButtonWrapperMixin from "@/mixins/input-button-wrapper-mixin"; import { - getLinkDisplayTextFromCopy, - getLinkTargetFromCopy, + getRouterLinkDisplayTextFromCopy, + getRouterLinkRouteFromCopy, splitCopyOnCMSPlaceHolder, doesCopyContainTextLink, } from "@/helpers/cms-content-helper"; @@ -74,8 +74,8 @@ export default { }, }, methods: { - getLinkDisplayTextFromCopy, - getLinkTargetFromCopy, + getRouterLinkDisplayTextFromCopy, + getRouterLinkRouteFromCopy, splitCopyOnCMSPlaceHolder, doesCopyContainTextLink, stripUlTagFromCopy(copy) { diff --git a/src/ux-components/alert/alert.spec.js b/src/ux-components/alert/alert.spec.js index 343323b9e..978777116 100644 --- a/src/ux-components/alert/alert.spec.js +++ b/src/ux-components/alert/alert.spec.js @@ -49,7 +49,7 @@ describe("alert.vue", () => { expect(wrapper.vm.alertCopy).toBe("testCopy"); }); - it("Should container a tag if the manualCopy contains a {routerLink: testName, testLink} placeholder", () => { + it.only("Should container a tag if the manualCopy contains a {routerLink: testName, testLink} placeholder", () => { // Arrange & Act const wrapper = shallowMount( alert, diff --git a/src/ux-components/alert/alert.vue b/src/ux-components/alert/alert.vue index 0c3ac4b99..cecbad90c 100644 --- a/src/ux-components/alert/alert.vue +++ b/src/ux-components/alert/alert.vue @@ -19,12 +19,10 @@ {{ getLinkDisplayTextFromCopy(copy) }}{{ getRouterLinkDisplayTextFromCopy(copy) }} @@ -43,8 +41,8 @@ import { doesCopyContainRouterLink, splitCopyOnCMSPlaceHolder, - getLinkTargetFromCopy, - getLinkDisplayTextFromCopy, + getRouterLinkRouteFromCopy, + getRouterLinkDisplayTextFromCopy, splitCMSCopyOnParagraphTag, } from "@/helpers/cms-content-helper"; import { applicationConfig } from "@/constants/application-config"; @@ -78,8 +76,8 @@ export default { }, }, computed: { - applicationQueryString() { - return applicationConfig.APPLICATION_QUERYSTRING; + pageQueryString() { + return applicationConfig.PAGE_QUERYSTRING; }, alertHeadline() { return this.manualHeadline @@ -98,8 +96,8 @@ export default { methods: { doesCopyContainRouterLink, splitCopyOnCMSPlaceHolder, - getLinkTargetFromCopy, - getLinkDisplayTextFromCopy, + getRouterLinkRouteFromCopy, + getRouterLinkDisplayTextFromCopy, ensureAlertIsInViewPort() { if (this.shouldScrollToOnMount && this.$el.style.display != "none") { var footerHeight = this.getFooterInfoBoxHeight(); From a45ad5a11e954a04c3268d189843298f31fde245 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 25 Jan 2023 09:27:31 -0500 Subject: [PATCH 4/5] Remove .only from unit test. --- src/ux-components/alert/alert.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ux-components/alert/alert.spec.js b/src/ux-components/alert/alert.spec.js index 978777116..343323b9e 100644 --- a/src/ux-components/alert/alert.spec.js +++ b/src/ux-components/alert/alert.spec.js @@ -49,7 +49,7 @@ describe("alert.vue", () => { expect(wrapper.vm.alertCopy).toBe("testCopy"); }); - it.only("Should container a tag if the manualCopy contains a {routerLink: testName, testLink} placeholder", () => { + it("Should container a tag if the manualCopy contains a {routerLink: testName, testLink} placeholder", () => { // Arrange & Act const wrapper = shallowMount( alert, From 01ad8942e8159d50e23a34f39aa7a579fb72496a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 25 Jan 2023 09:44:52 -0500 Subject: [PATCH 5/5] Add minor change to force update. --- src/ux-components/alert/alert.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ux-components/alert/alert.spec.js b/src/ux-components/alert/alert.spec.js index 343323b9e..1f5d0fcc8 100644 --- a/src/ux-components/alert/alert.spec.js +++ b/src/ux-components/alert/alert.spec.js @@ -41,7 +41,7 @@ describe("alert.vue", () => { expect(wrapperDiv.classes()).toContain("warning"); }); - it("Should update alert Headline to manualHeadline datam entered and alert copy to manualCopy datam entered when no cmsWidgetName entered", async () => { + it("Should update alert Headline to manualHeadline datam entered and alert copy to manualCopy datam entered when no cmsWidgetName entered.", async () => { // Arrange const wrapper = shallowMount(alert, setupMocks({})); // Assert