CSR-1024 match/merge code from ISS.

This commit is contained in:
Bryan Mauger 2023-01-24 16:06:29 -05:00
parent 0afe945eaf
commit ff65f31036
6 changed files with 24 additions and 26 deletions

View file

@ -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,
};

View file

@ -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'

View file

@ -25,10 +25,10 @@
<span v-if="doesCopyContainRouterLink(copy)" class="text-body">
<router-link
:to="{
query: { fmgPage: `${getLinkTargetFromCopy(copy)}` },
query: { fmgPage: `${getRouterLinkRouteFromCopy(copy)}` },
name: 'root',
}"
>{{ getLinkDisplayTextFromCopy(copy) }}</router-link
>{{ getRouterLinkDisplayTextFromCopy(copy) }}</router-link
>
</span>
<span v-else class="m-0 text-body" v-html="copy"></span>
@ -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 &&

View file

@ -30,10 +30,10 @@
<span v-else>
<textLink
linkType="text"
:text="getLinkDisplayTextFromCopy(copy)"
:text="getRouterLinkDisplayTextFromCopy(copy)"
href="#!"
data-bs-toggle="modal"
:data-bs-target="'#' + getLinkTargetFromCopy(copy)"
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
aria-label="Modal window" />
</span>
</template>
@ -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) {

View file

@ -49,7 +49,7 @@ describe("alert.vue", () => {
expect(wrapper.vm.alertCopy).toBe("testCopy");
});
it("Should container a <router-link> tag if the manualCopy contains a {routerLink: testName, testLink} placeholder", () => {
it.only("Should container a <router-link> tag if the manualCopy contains a {routerLink: testName, testLink} placeholder", () => {
// Arrange & Act
const wrapper = shallowMount(
alert,

View file

@ -19,12 +19,10 @@
<span v-else>
<router-link
:to="{
query: {
[applicationQueryString]: `${getRouterLinkRouteFromCopy(copy)}`,
},
query: { [pageQueryString]: `${getRouterLinkRouteFromCopy(copy)}` },
name: 'root',
}"
>{{ getLinkDisplayTextFromCopy(copy) }}</router-link
>{{ getRouterLinkDisplayTextFromCopy(copy) }}</router-link
>
</span>
</template>
@ -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();