Merge pull request #1288 from Safelite/defect/CSR-1576

Defect/csr 1576
This commit is contained in:
Leah Schumann 2023-08-02 13:36:41 -04:00 committed by GitHub
commit 1b6d791db8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -14,7 +14,7 @@
<textLink
linkType="text"
:text="getRouterLinkDisplayTextFromCopy(copy)"
href="#!"
:href="getExternalLink(copy)"
@click-event="$emit('textLinkClicked', getRouterLinkRouteFromCopy(copy))"
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)" />
</span>
@ -34,6 +34,7 @@ import {
splitCopyOnCMSPlaceHolder,
getRouterLinkRouteFromCopy,
getRouterLinkDisplayTextFromCopy,
getExternalLink,
} from "@/helpers/cms-content-helper";
import { applicationConfig } from "@/constants/application-config";
@ -53,6 +54,7 @@ export default {
splitCopyOnCMSPlaceHolder,
getRouterLinkRouteFromCopy,
getRouterLinkDisplayTextFromCopy,
getExternalLink,
},
computed: {
pageQueryString() {

View file

@ -310,6 +310,16 @@ export function getRouterLinkRouteFromCopy(copy) {
return copy.split(":")[1].split(",")[0];
}
export function getExternalLink(copy) {
let url = copy.split(":")[1].split(",")[0];
if (url.includes("https-")) {
const prefixAdded = url.replace("https-", "https://");
return prefixAdded;
}
return "#!";
}
/**
* Returns string3 of input following this pattern: {string1:string2,string3}
* @returns string