Merge pull request #952 from Safelite/CSR-1024-match-code-with-iss
Merge code from ISS to FMG.
This commit is contained in:
commit
2100bb7206
6 changed files with 26 additions and 21 deletions
|
|
@ -7,6 +7,7 @@ const applicationConfig = {
|
||||||
CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod"
|
CURRENT_ENVIRONMENT: process.env.VUE_APP_CURRENT_ENVIRONMENT, // "Localhost", "Dev", "QA", and "Prod"
|
||||||
APPLICATION_NAME: "FixMyGlass",
|
APPLICATION_NAME: "FixMyGlass",
|
||||||
APPLICATION_ABBREVIATION: "fmg",
|
APPLICATION_ABBREVIATION: "fmg",
|
||||||
|
PAGE_QUERYSTRING: "fmgPage",
|
||||||
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
|
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
|
||||||
CASH_ACCOUNT_NUMBER: 167132,
|
CASH_ACCOUNT_NUMBER: 167132,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -303,7 +303,7 @@ export function splitCopyOnCMSPlaceHolder(copy) {
|
||||||
* Returns string2 of input following this pattern: {string1:string2,string3}
|
* Returns string2 of input following this pattern: {string1:string2,string3}
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
export function getLinkTargetFromCopy(copy) {
|
export function getRouterLinkRouteFromCopy(copy) {
|
||||||
// sample input: {routerLink:estimate,provide your VIN}
|
// sample input: {routerLink:estimate,provide your VIN}
|
||||||
// first split would return 'estimate,provide your VIN'
|
// first split would return 'estimate,provide your VIN'
|
||||||
// second split would return 'estimate'
|
// second split would return 'estimate'
|
||||||
|
|
@ -314,7 +314,7 @@ export function getLinkTargetFromCopy(copy) {
|
||||||
* Returns string3 of input following this pattern: {string1:string2,string3}
|
* Returns string3 of input following this pattern: {string1:string2,string3}
|
||||||
* @returns string
|
* @returns string
|
||||||
*/
|
*/
|
||||||
export function getLinkDisplayTextFromCopy(copy) {
|
export function getRouterLinkDisplayTextFromCopy(copy) {
|
||||||
// sample input: {routerLink:estimate,provide your VIN}
|
// sample input: {routerLink:estimate,provide your VIN}
|
||||||
// first split would return 'estimate,provide your VIN'
|
// first split would return 'estimate,provide your VIN'
|
||||||
// second split would return 'provide your VIN'
|
// second split would return 'provide your VIN'
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@
|
||||||
<span v-if="doesCopyContainRouterLink(copy)" class="text-body">
|
<span v-if="doesCopyContainRouterLink(copy)" class="text-body">
|
||||||
<router-link
|
<router-link
|
||||||
:to="{
|
:to="{
|
||||||
query: { fmgPage: `${getLinkTargetFromCopy(copy)}` },
|
query: { fmgPage: `${getRouterLinkRouteFromCopy(copy)}` },
|
||||||
name: 'root',
|
name: 'root',
|
||||||
}"
|
}"
|
||||||
>{{ getLinkDisplayTextFromCopy(copy) }}</router-link
|
>{{ getRouterLinkDisplayTextFromCopy(copy) }}</router-link
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<span v-else class="m-0 text-body" v-html="copy"></span>
|
<span v-else class="m-0 text-body" v-html="copy"></span>
|
||||||
|
|
@ -66,8 +66,8 @@ import { isGlassAvailableForCarId } from "@/helpers/damage-helper";
|
||||||
import {
|
import {
|
||||||
doesCopyContainRouterLink,
|
doesCopyContainRouterLink,
|
||||||
splitCopyOnCMSPlaceHolder,
|
splitCopyOnCMSPlaceHolder,
|
||||||
getLinkTargetFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
getLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
} from "@/helpers/cms-content-helper";
|
} from "@/helpers/cms-content-helper";
|
||||||
import { routerParams } from "@/router/router-constants/router-params";
|
import { routerParams } from "@/router/router-constants/router-params";
|
||||||
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
import vinPagesMixin from "@/mixins/vin-pages-mixin";
|
||||||
|
|
@ -151,8 +151,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
doesCopyContainRouterLink,
|
doesCopyContainRouterLink,
|
||||||
splitCopyOnCMSPlaceHolder,
|
splitCopyOnCMSPlaceHolder,
|
||||||
getLinkTargetFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
getLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
if (
|
if (
|
||||||
store.getters.order.vehicle.carId &&
|
store.getters.order.vehicle.carId &&
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,10 @@
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<textLink
|
<textLink
|
||||||
linkType="text"
|
linkType="text"
|
||||||
:text="getLinkDisplayTextFromCopy(copy)"
|
:text="getRouterLinkDisplayTextFromCopy(copy)"
|
||||||
href="#!"
|
href="#!"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
:data-bs-target="'#' + getLinkTargetFromCopy(copy)"
|
:data-bs-target="'#' + getRouterLinkRouteFromCopy(copy)"
|
||||||
aria-label="Modal window" />
|
aria-label="Modal window" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</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 textLink from "@/ux-components/text-link/text-link";
|
||||||
import inputButtonWrapperMixin from "@/mixins/input-button-wrapper-mixin";
|
import inputButtonWrapperMixin from "@/mixins/input-button-wrapper-mixin";
|
||||||
import {
|
import {
|
||||||
getLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
getLinkTargetFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
splitCopyOnCMSPlaceHolder,
|
splitCopyOnCMSPlaceHolder,
|
||||||
doesCopyContainTextLink,
|
doesCopyContainTextLink,
|
||||||
} from "@/helpers/cms-content-helper";
|
} from "@/helpers/cms-content-helper";
|
||||||
|
|
@ -74,8 +74,8 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
getLinkTargetFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
splitCopyOnCMSPlaceHolder,
|
splitCopyOnCMSPlaceHolder,
|
||||||
doesCopyContainTextLink,
|
doesCopyContainTextLink,
|
||||||
stripUlTagFromCopy(copy) {
|
stripUlTagFromCopy(copy) {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ describe("alert.vue", () => {
|
||||||
expect(wrapperDiv.classes()).toContain("warning");
|
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
|
// Arrange
|
||||||
const wrapper = shallowMount(alert, setupMocks({}));
|
const wrapper = shallowMount(alert, setupMocks({}));
|
||||||
// Assert
|
// Assert
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@
|
||||||
<span v-else>
|
<span v-else>
|
||||||
<router-link
|
<router-link
|
||||||
:to="{
|
:to="{
|
||||||
query: { fmgPage: `${getLinkTargetFromCopy(copy)}` },
|
query: { [pageQueryString]: `${getRouterLinkRouteFromCopy(copy)}` },
|
||||||
name: 'root',
|
name: 'root',
|
||||||
}"
|
}"
|
||||||
>{{ getLinkDisplayTextFromCopy(copy) }}</router-link
|
>{{ getRouterLinkDisplayTextFromCopy(copy) }}</router-link
|
||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -41,10 +41,11 @@
|
||||||
import {
|
import {
|
||||||
doesCopyContainRouterLink,
|
doesCopyContainRouterLink,
|
||||||
splitCopyOnCMSPlaceHolder,
|
splitCopyOnCMSPlaceHolder,
|
||||||
getLinkTargetFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
getLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
splitCMSCopyOnParagraphTag,
|
splitCMSCopyOnParagraphTag,
|
||||||
} from "@/helpers/cms-content-helper";
|
} from "@/helpers/cms-content-helper";
|
||||||
|
import { applicationConfig } from "@/constants/application-config";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "alert",
|
name: "alert",
|
||||||
|
|
@ -75,6 +76,9 @@ export default {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
pageQueryString() {
|
||||||
|
return applicationConfig.PAGE_QUERYSTRING;
|
||||||
|
},
|
||||||
alertHeadline() {
|
alertHeadline() {
|
||||||
return this.manualHeadline
|
return this.manualHeadline
|
||||||
? this.manualHeadline
|
? this.manualHeadline
|
||||||
|
|
@ -92,8 +96,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
doesCopyContainRouterLink,
|
doesCopyContainRouterLink,
|
||||||
splitCopyOnCMSPlaceHolder,
|
splitCopyOnCMSPlaceHolder,
|
||||||
getLinkTargetFromCopy,
|
getRouterLinkRouteFromCopy,
|
||||||
getLinkDisplayTextFromCopy,
|
getRouterLinkDisplayTextFromCopy,
|
||||||
ensureAlertIsInViewPort() {
|
ensureAlertIsInViewPort() {
|
||||||
if (this.shouldScrollToOnMount && this.$el.style.display != "none") {
|
if (this.shouldScrollToOnMount && this.$el.style.display != "none") {
|
||||||
var footerHeight = this.getFooterInfoBoxHeight();
|
var footerHeight = this.getFooterInfoBoxHeight();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue