Merge branch 'release/2025.01.23' into feature/CASH-109
This commit is contained in:
commit
66da230cc9
12 changed files with 177 additions and 81 deletions
|
|
@ -216,8 +216,12 @@ export default {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
flex: none;
|
flex: none;
|
||||||
}
|
}
|
||||||
|
.textbox-question {
|
||||||
|
padding: .25rem 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.modal-dialog-centered {
|
&.modal-dialog-centered {
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
|
|
@ -269,8 +273,6 @@ export default {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.textbox-question {
|
.textbox-question {
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
label {
|
label {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
|
|
@ -284,6 +286,10 @@ export default {
|
||||||
.modal-disclaimer {
|
.modal-disclaimer {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
order: 2;
|
order: 2;
|
||||||
|
text-align: left;
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.modal-footer {
|
.modal-footer {
|
||||||
margin: 0 0 1.5rem 0;
|
margin: 0 0 1.5rem 0;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="save-progress-modal-question">
|
<div class="save-progress-modal-question" :class="isProgressSaved ? 'progress-saved' : ''">
|
||||||
<buttonMain
|
<buttonMain
|
||||||
ref="buttonMain"
|
ref="buttonMain"
|
||||||
|
type="button"
|
||||||
v-if="!isProgressSaved"
|
v-if="!isProgressSaved"
|
||||||
:buttonText="buttonText"
|
:buttonText="buttonText"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
|
|
@ -17,6 +18,7 @@
|
||||||
:ref="modalName"
|
:ref="modalName"
|
||||||
:headerText="modalHeaderText"
|
:headerText="modalHeaderText"
|
||||||
suppressPageScroll
|
suppressPageScroll
|
||||||
|
:onModalClosedCallback="onModalClosed"
|
||||||
:footerButtonText="modalButtonText"
|
:footerButtonText="modalButtonText"
|
||||||
@footer-button-event="saveProgress">
|
@footer-button-event="saveProgress">
|
||||||
<p class="modal-body-inner">{{ modalBodyText }}</p>
|
<p class="modal-body-inner">{{ modalBodyText }}</p>
|
||||||
|
|
@ -35,6 +37,7 @@ import modal from "@/digital-components/modal/modal";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import buttonMain from "@/ux-components/button-main/button-main";
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
import alert from "@/ux-components/alert/alert";
|
import alert from "@/ux-components/alert/alert";
|
||||||
|
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "save-progress-modal-question",
|
name: "save-progress-modal-question",
|
||||||
|
|
@ -78,17 +81,24 @@ export default {
|
||||||
this.modal.openModal();
|
this.modal.openModal();
|
||||||
this.modal.resetButtonStyle();
|
this.modal.resetButtonStyle();
|
||||||
},
|
},
|
||||||
|
onModalClosed() {
|
||||||
|
this.userInput = "";
|
||||||
|
this.modal.resetForm();
|
||||||
|
},
|
||||||
async saveProgress() {
|
async saveProgress() {
|
||||||
// save email address to store
|
// save email address to store
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.userInput, false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.userInput, false);
|
||||||
|
|
||||||
|
// send store call to send to new API (that triggers an email send)
|
||||||
|
await saveQuote({ pageNameToLog: this.pageName });
|
||||||
|
|
||||||
// hide save progress button; show success message alert
|
// hide save progress button; show success message alert
|
||||||
this.isProgressSaved = true;
|
this.isProgressSaved = true;
|
||||||
|
|
||||||
|
// communicate to parent the new status
|
||||||
|
this.$emit("save-progress-saved");
|
||||||
|
|
||||||
this.modal.closeModal();
|
this.modal.closeModal();
|
||||||
|
|
||||||
// send store call to send to new API (that triggers an email send)
|
|
||||||
this.$emit("save-progress");
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -113,6 +123,10 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
border-radius: 0.5rem;
|
border-radius: 0.5rem;
|
||||||
|
|
||||||
|
&.progress-saved {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
.save-progress-button {
|
.save-progress-button {
|
||||||
order: 4;
|
order: 4;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -125,7 +139,7 @@ export default {
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-underline-offset: 0.375rem;
|
text-underline-offset: 0.25rem;
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
|
@ -148,6 +162,7 @@ export default {
|
||||||
:deep(.alert) {
|
:deep(.alert) {
|
||||||
border-radius: $border-radius-lg;
|
border-radius: $border-radius-lg;
|
||||||
border: 1px solid $green;
|
border: 1px solid $green;
|
||||||
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
:deep(.alert-heading) {
|
:deep(.alert-heading) {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
class="save-progress-popup-question" />
|
class="save-progress-popup-question" />
|
||||||
<buttonMain
|
<buttonMain
|
||||||
ref="skipButton"
|
ref="skipButton"
|
||||||
|
type="button"
|
||||||
:buttonText="buttonText"
|
:buttonText="buttonText"
|
||||||
loaderColor="white"
|
loaderColor="white"
|
||||||
:suppressLoader="true"
|
:suppressLoader="true"
|
||||||
|
|
@ -37,6 +38,7 @@ import modal from "@/digital-components/modal/modal";
|
||||||
import { storeActions } from "@/constants/store-actions.js";
|
import { storeActions } from "@/constants/store-actions.js";
|
||||||
import buttonMain from "@/ux-components/button-main/button-main";
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
import alert from "@/ux-components/alert/alert";
|
import alert from "@/ux-components/alert/alert";
|
||||||
|
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "save-progress-popup-question",
|
name: "save-progress-popup-question",
|
||||||
|
|
@ -50,6 +52,10 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.showSaveProgressPopup) this.modal.openModal();
|
if (this.showSaveProgressPopup) this.modal.openModal();
|
||||||
},
|
},
|
||||||
|
unmounted() {
|
||||||
|
// remove any modal effects before leaving page (e.g. user hits browser back button)
|
||||||
|
this.modal.closeModal();
|
||||||
|
},
|
||||||
emits: ["close-save-progress-popup", "save-progress"], // <--- should remove oodles of warnings in dev tools
|
emits: ["close-save-progress-popup", "save-progress"], // <--- should remove oodles of warnings in dev tools
|
||||||
props: {
|
props: {
|
||||||
modelValue: Object,
|
modelValue: Object,
|
||||||
|
|
@ -94,15 +100,14 @@ export default {
|
||||||
// save email address to store
|
// save email address to store
|
||||||
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.userInput, false);
|
await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.userInput, false);
|
||||||
|
|
||||||
|
// send store call to send to new API (that triggers an email send)
|
||||||
|
await saveQuote({ pageNameToLog: this.pageName });
|
||||||
|
|
||||||
// hide save progress button; show success message alert
|
// hide save progress button; show success message alert
|
||||||
this.isProgressSaved = true;
|
this.isProgressSaved = true;
|
||||||
|
|
||||||
// send store call to send to new API (that triggers an email send)
|
// communicate to parent the new status
|
||||||
this.$emit("save-progress");
|
this.$emit("save-progress-saved");
|
||||||
|
|
||||||
// send call to close popup
|
|
||||||
this.closeModal();
|
|
||||||
this.$emit("close-save-progress-popup");
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -150,7 +155,7 @@ export default {
|
||||||
width: auto;
|
width: auto;
|
||||||
height: auto;
|
height: auto;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-underline-offset: 0.375rem;
|
text-underline-offset: 0.25rem;
|
||||||
line-height: 1rem;
|
line-height: 1rem;
|
||||||
padding: 0 0 4px 0;
|
padding: 0 0 4px 0;
|
||||||
margin: 0 auto 1.5rem auto;
|
margin: 0 auto 1.5rem auto;
|
||||||
|
|
@ -200,9 +205,6 @@ export default {
|
||||||
}
|
}
|
||||||
.modal-disclaimer {
|
.modal-disclaimer {
|
||||||
order: 4;
|
order: 4;
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.progress-saved {
|
&.progress-saved {
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,13 @@ export default {
|
||||||
|
|
||||||
if (error.response.status && error.response.status != "404") {
|
if (error.response.status && error.response.status != "404") {
|
||||||
// Do not route to error logic when no wipers found or no promo found (404s)
|
// Do not route to error logic when no wipers found or no promo found (404s)
|
||||||
router.navigateError();
|
const errorPayload = {
|
||||||
|
cause: `Response error ${error.response.status}`,
|
||||||
|
currentPage: pageNameToLog,
|
||||||
|
endpoint: endpoint,
|
||||||
|
};
|
||||||
|
|
||||||
|
router.navigateError(errorPayload);
|
||||||
|
|
||||||
// do not log 404 errors from services because we return NotFound
|
// do not log 404 errors from services because we return NotFound
|
||||||
// when a service doesn't return an object
|
// when a service doesn't return an object
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
<!-- save progress goes into <slot> on questions-page-layout -->
|
<!-- save progress goes into <slot> on questions-page-layout -->
|
||||||
<saveProgressModalQuestion
|
<saveProgressModalQuestion
|
||||||
modalWidgetName="SaveProgressModalWidget"
|
modalWidgetName="SaveProgressModalWidget"
|
||||||
v-if="!isEmailInStoreOnPageLoad"
|
pageName="capability-questions"
|
||||||
@save-progress="saveProgress" />
|
v-if="showSaveProgressModal" />
|
||||||
</questions-page-layout>
|
</questions-page-layout>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -38,7 +38,6 @@ import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
@ -65,7 +64,7 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
vm.showSaveProgressModal = !(emailFromStore?.length > 0);
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (store.getters.externalParameterState?.isExternalParameter) {
|
||||||
if (store.getters.externalParameterServiceZip.zipCode) {
|
if (store.getters.externalParameterServiceZip.zipCode) {
|
||||||
await baseMixin.methods.dispatchStoreAction(
|
await baseMixin.methods.dispatchStoreAction(
|
||||||
|
|
@ -87,7 +86,7 @@ export default {
|
||||||
questionsData: null,
|
questionsData: null,
|
||||||
selectedAnswers: {},
|
selectedAnswers: {},
|
||||||
currentGlassIndex: 0,
|
currentGlassIndex: 0,
|
||||||
isEmailInStoreOnPageLoad: null,
|
showSaveProgressModal: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -157,9 +156,6 @@ export default {
|
||||||
this.questionsData
|
this.questionsData
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
saveProgress() {
|
|
||||||
saveQuote({ pageNameToLog: "capability-questions" });
|
|
||||||
},
|
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const questionAnswersArray = this.questionsData.map((glass) => {
|
const questionAnswersArray = this.questionsData.map((glass) => {
|
||||||
// get answerResult2 of returned answer
|
// get answerResult2 of returned answer
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
<!-- save progress goes into <slot> on questions-page-layout -->
|
<!-- save progress goes into <slot> on questions-page-layout -->
|
||||||
<saveProgressModalQuestion
|
<saveProgressModalQuestion
|
||||||
modalWidgetName="SaveProgressModalWidget"
|
modalWidgetName="SaveProgressModalWidget"
|
||||||
v-if="!isEmailInStoreOnPageLoad"
|
pageName="molding-questions"
|
||||||
@save-progress="saveProgress" />
|
v-if="showSaveProgressModal" />
|
||||||
</questions-page-layout>
|
</questions-page-layout>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -38,7 +38,6 @@ import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
@ -65,7 +64,7 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
vm.showSaveProgressModal = !(emailFromStore?.length > 0);
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (store.getters.externalParameterState?.isExternalParameter) {
|
||||||
if (store.getters.externalParameterServiceZip.zipCode) {
|
if (store.getters.externalParameterServiceZip.zipCode) {
|
||||||
await baseMixin.methods.dispatchStoreAction(
|
await baseMixin.methods.dispatchStoreAction(
|
||||||
|
|
@ -88,7 +87,7 @@ export default {
|
||||||
questionsData: null,
|
questionsData: null,
|
||||||
selectedAnswers: {},
|
selectedAnswers: {},
|
||||||
currentGlassIndex: 0,
|
currentGlassIndex: 0,
|
||||||
isEmailInStoreOnPageLoad: null,
|
showSaveProgressModal: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -157,9 +156,6 @@ export default {
|
||||||
this.questionsData
|
this.questionsData
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
saveProgress() {
|
|
||||||
saveQuote({ pageNameToLog: "molding-questions" });
|
|
||||||
},
|
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const questionAnswersArray = this.questionsData.map((glass) => {
|
const questionAnswersArray = this.questionsData.map((glass) => {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
<!-- save progress goes into <slot> on questions-page-layout -->
|
<!-- save progress goes into <slot> on questions-page-layout -->
|
||||||
<saveProgressModalQuestion
|
<saveProgressModalQuestion
|
||||||
modalWidgetName="SaveProgressModalWidget"
|
modalWidgetName="SaveProgressModalWidget"
|
||||||
v-if="!isEmailInStoreOnPageLoad"
|
pageName="part-questions"
|
||||||
@save-progress="saveProgress" />
|
v-if="showSaveProgressModal" />
|
||||||
</questions-page-layout>
|
</questions-page-layout>
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -38,7 +38,6 @@ import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
@ -65,7 +64,7 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
vm.showSaveProgressModal = !(emailFromStore?.length > 0);
|
||||||
if (store.getters.externalParameterState?.isExternalParameter) {
|
if (store.getters.externalParameterState?.isExternalParameter) {
|
||||||
if (store.getters.externalParameterServiceZip.zipCode) {
|
if (store.getters.externalParameterServiceZip.zipCode) {
|
||||||
const serviceState = store.getters.order.serviceLocation.state;
|
const serviceState = store.getters.order.serviceLocation.state;
|
||||||
|
|
@ -89,7 +88,7 @@ export default {
|
||||||
questionsData: null,
|
questionsData: null,
|
||||||
selectedAnswers: {},
|
selectedAnswers: {},
|
||||||
currentGlassIndex: 0,
|
currentGlassIndex: 0,
|
||||||
isEmailInStoreOnPageLoad: null,
|
showSaveProgressModal: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -156,9 +155,6 @@ export default {
|
||||||
this.questionsData
|
this.questionsData
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
saveProgress() {
|
|
||||||
saveQuote({ pageNameToLog: "part-questions" });
|
|
||||||
},
|
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const questionAnswersArray = this.questionsData.map((glass) => {
|
const questionAnswersArray = this.questionsData.map((glass) => {
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-12 col-xl-8">
|
<div class="col-md-12 col-xl-8 mb-5">
|
||||||
<servicePackageQuestion
|
<servicePackageQuestion
|
||||||
ref="servicePackage"
|
ref="servicePackage"
|
||||||
cashCmsWidgetName="CashServicePackageQuestionWidget"
|
cashCmsWidgetName="CashServicePackageQuestionWidget"
|
||||||
|
|
@ -82,8 +82,9 @@
|
||||||
<saveProgressModalQuestion
|
<saveProgressModalQuestion
|
||||||
modalWidgetName="SaveProgressModalWidget"
|
modalWidgetName="SaveProgressModalWidget"
|
||||||
modalName="SaveProgressModal"
|
modalName="SaveProgressModal"
|
||||||
v-if="!isEmailInStoreOnPageLoad"
|
v-if="showSaveProgressModal"
|
||||||
@save-progress="saveProgress" />
|
pageName="quote"
|
||||||
|
@save-progress-saved="updateSaveProgressAsSaved" />
|
||||||
|
|
||||||
<textBlock
|
<textBlock
|
||||||
cmsWidgetName="quoteDisclaimer"
|
cmsWidgetName="quoteDisclaimer"
|
||||||
|
|
@ -98,9 +99,10 @@
|
||||||
<saveProgressPopupQuestion
|
<saveProgressPopupQuestion
|
||||||
modalWidgetName="SaveProgressPopupWidget"
|
modalWidgetName="SaveProgressPopupWidget"
|
||||||
modalName="SaveProgressPopup"
|
modalName="SaveProgressPopup"
|
||||||
v-if="!isEmailInStoreOnPageLoad && showSaveProgressPopup"
|
pageName="quote"
|
||||||
|
v-if="showSaveProgressPopup"
|
||||||
:showSaveProgressPopup="showSaveProgressPopup"
|
:showSaveProgressPopup="showSaveProgressPopup"
|
||||||
@save-progress="saveProgress"
|
@save-progress-saved="updateSaveProgressAsSaved"
|
||||||
@close-save-progress-popup="closeSaveProgressPopup" />
|
@close-save-progress-popup="closeSaveProgressPopup" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -209,6 +211,7 @@ export default {
|
||||||
const emailFromStore = store.getters.order.customer.emailAddress;
|
const emailFromStore = store.getters.order.customer.emailAddress;
|
||||||
const isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
const isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
||||||
const showSaveProgressPopup = isEmailInStoreOnPageLoad ? false : true;
|
const showSaveProgressPopup = isEmailInStoreOnPageLoad ? false : true;
|
||||||
|
const showSaveProgressModal = isEmailInStoreOnPageLoad ? false : true;
|
||||||
|
|
||||||
const lineItems = deepClone(store.getters.order.lineItems);
|
const lineItems = deepClone(store.getters.order.lineItems);
|
||||||
lineItems.vaps = lineItems.vaps ?? [];
|
lineItems.vaps = lineItems.vaps ?? [];
|
||||||
|
|
@ -290,8 +293,8 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next(async (vm) => {
|
next(async (vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.isEmailInStoreOnPageLoad = isEmailInStoreOnPageLoad;
|
|
||||||
vm.showSaveProgressPopup = showSaveProgressPopup;
|
vm.showSaveProgressPopup = showSaveProgressPopup;
|
||||||
|
vm.showSaveProgressModal = showSaveProgressModal;
|
||||||
vm.addableVaps = addableVaps;
|
vm.addableVaps = addableVaps;
|
||||||
vm.lineItems = lineItems;
|
vm.lineItems = lineItems;
|
||||||
vm.availableLineItems = pricingResults;
|
vm.availableLineItems = pricingResults;
|
||||||
|
|
@ -438,10 +441,14 @@ export default {
|
||||||
servicePackage: null,
|
servicePackage: null,
|
||||||
holdParentAccountNumber: null,
|
holdParentAccountNumber: null,
|
||||||
holdBillToAccountNumber: null,
|
holdBillToAccountNumber: null,
|
||||||
isEmailInStoreOnPageLoad: null,
|
|
||||||
showSaveProgressPopup: null,
|
showSaveProgressPopup: null,
|
||||||
|
showSaveProgressModal: null,
|
||||||
|
isSaveProgressComplete: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.attachCustomEvents();
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
lineItemsCloneForWatcher() {
|
lineItemsCloneForWatcher() {
|
||||||
return Object.assign({}, this.lineItems);
|
return Object.assign({}, this.lineItems);
|
||||||
|
|
@ -526,10 +533,8 @@ export default {
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
vehicleQuestionsMixin.methods.navigateBack(this);
|
vehicleQuestionsMixin.methods.navigateBack(this);
|
||||||
},
|
},
|
||||||
saveProgress() {
|
updateSaveProgressAsSaved() {
|
||||||
this.isEmailInStoreOnPageLoad = true;
|
this.showSaveProgressModal = false;
|
||||||
this.showSaveProgressPopup = false;
|
|
||||||
saveQuote({ pageNameToLog: "quote" });
|
|
||||||
},
|
},
|
||||||
closeSaveProgressPopup() {
|
closeSaveProgressPopup() {
|
||||||
this.showSaveProgressPopup = false;
|
this.showSaveProgressPopup = false;
|
||||||
|
|
@ -677,9 +682,6 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.attachCustomEvents();
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
lineItemsCloneForWatcher: {
|
lineItemsCloneForWatcher: {
|
||||||
handler(newValue, oldValue) {
|
handler(newValue, oldValue) {
|
||||||
|
|
|
||||||
|
|
@ -141,8 +141,11 @@ export default {
|
||||||
.package-main {
|
.package-main {
|
||||||
.package-wrapper {
|
.package-wrapper {
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
|
&:last-child {
|
||||||
|
margin: 1rem 0 0 0;
|
||||||
|
}
|
||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(md) {
|
||||||
margin: 1rem 0.5rem;
|
margin: 1rem 0.5rem 0 0.5rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
@ -322,6 +325,7 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
align-self: flex-start;
|
||||||
div.strikethrough-discount-price {
|
div.strikethrough-discount-price {
|
||||||
text-decoration: line-through;
|
text-decoration: line-through;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
|
|
|
||||||
|
|
@ -48,8 +48,8 @@
|
||||||
|
|
||||||
<saveProgressModalQuestion
|
<saveProgressModalQuestion
|
||||||
modalWidgetName="SaveProgressModalWidget"
|
modalWidgetName="SaveProgressModalWidget"
|
||||||
v-if="!isEmailInStoreOnPageLoad"
|
pageName="vehicle-parts"
|
||||||
@save-progress="saveProgress" />
|
v-if="showSaveProgressModal" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -75,7 +75,6 @@ import store from "@/store";
|
||||||
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
import vehicleQuestionsMixin from "@/mixins/vehicle-questions-mixin";
|
||||||
import baseMixin from "@/mixins/base-mixin.js";
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
import { partTypeStrings } from "@/constants/part-type-strings";
|
||||||
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "vehicle-parts",
|
name: "vehicle-parts",
|
||||||
|
|
@ -95,7 +94,7 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
vm.showSaveProgressModal = !(emailFromStore?.length > 0);
|
||||||
// Glass Part Question dynamic component
|
// Glass Part Question dynamic component
|
||||||
Object.keys(vm.$refs)
|
Object.keys(vm.$refs)
|
||||||
.filter((r) => r.includes(vm.RefPrefix) && vm.$refs[r][0] !== undefined)
|
.filter((r) => r.includes(vm.RefPrefix) && vm.$refs[r][0] !== undefined)
|
||||||
|
|
@ -115,7 +114,7 @@ export default {
|
||||||
selectedGlassParts: {},
|
selectedGlassParts: {},
|
||||||
alertWidgetData: Object,
|
alertWidgetData: Object,
|
||||||
alreadyPopulatedPartsData: [],
|
alreadyPopulatedPartsData: [],
|
||||||
isEmailInStoreOnPageLoad: null,
|
showSaveProgressModal: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|
@ -234,9 +233,6 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
saveProgress() {
|
|
||||||
saveQuote({ pageNameToLog: "vehicle-parts" });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.LoadInitialPartsData();
|
this.LoadInitialPartsData();
|
||||||
|
|
|
||||||
|
|
@ -650,6 +650,14 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
pushPageErrorToDataLayer(error) {
|
||||||
|
|
||||||
|
pushToDataLayerIfDefined({
|
||||||
|
event: "page-error",
|
||||||
|
error: error,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
prependActionToMethod(object, method, actionToPrepend) {
|
prependActionToMethod(object, method, actionToPrepend) {
|
||||||
const baseMethodName = method.name.startsWith("bound ")
|
const baseMethodName = method.name.startsWith("bound ")
|
||||||
? method.name.substring(6)
|
? method.name.substring(6)
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,17 @@ const routes = [
|
||||||
// If the saved session has timed out, clear the session, execute 404 logic.
|
// If the saved session has timed out, clear the session, execute 404 logic.
|
||||||
if (getFunnelCookie() !== null && !isSavedSessionStillActive()) {
|
if (getFunnelCookie() !== null && !isSavedSessionStillActive()) {
|
||||||
log(" --save session timeout go to start");
|
log(" --save session timeout go to start");
|
||||||
|
|
||||||
|
const errorPayload = {
|
||||||
|
cause: "expired session",
|
||||||
|
currentPage: from?.query?.fmgPage,
|
||||||
|
nextPage: to?.query?.fmgPage,
|
||||||
|
};
|
||||||
|
|
||||||
await baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE);
|
await baseMixin.methods.dispatchStoreAction(storeActions.RESET_STATE);
|
||||||
deleteFunnelCookie();
|
deleteFunnelCookie();
|
||||||
GoToFunnelStartOn404(next);
|
GoToFunnelStartOn404(next, errorPayload);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Intercept all navigation if a submitted order exists in storage
|
// Intercept all navigation if a submitted order exists in storage
|
||||||
|
|
@ -206,7 +214,14 @@ const routes = [
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GoToFunnelStartOn404(next);
|
const errorPayload = {
|
||||||
|
cause: "invalid page prerequisites for page",
|
||||||
|
currentPage: from?.query?.fmgPage,
|
||||||
|
nextPage: to?.query?.fmgPage,
|
||||||
|
};
|
||||||
|
|
||||||
|
GoToFunnelStartOn404(next, errorPayload);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log(" --has route:", to.query.fmgPage);
|
log(" --has route:", to.query.fmgPage);
|
||||||
|
|
@ -214,9 +229,15 @@ const routes = [
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isExistingFmgPageName(to.query.fmgPage)) {
|
if (!isExistingFmgPageName(to.query.fmgPage)) {
|
||||||
console.log("Not an existing fmg page name:" + to.query.fmgPage);
|
const errorPayload = {
|
||||||
GoToFunnelStartOn404(next);
|
cause: "invalid page name",
|
||||||
|
currentPage: from?.query?.fmgPage,
|
||||||
|
nextPage: to?.query?.fmgPage,
|
||||||
|
};
|
||||||
|
|
||||||
|
GoToFunnelStartOn404(next, errorPayload);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get route info for the given url. Names will have a 1:1 relationship with names in the Cms.
|
// Get route info for the given url. Names will have a 1:1 relationship with names in the Cms.
|
||||||
|
|
@ -237,9 +258,18 @@ const routes = [
|
||||||
.components.default();
|
.components.default();
|
||||||
|
|
||||||
if (!arePagePrerequisitesValid(nextComponent)) {
|
if (!arePagePrerequisitesValid(nextComponent)) {
|
||||||
|
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
console.log("Page Prereqs not valid for next component: " + nextComponent.default.name);
|
console.log("Page Prereqs not valid for next component: " + nextComponent.default.name);
|
||||||
GoToFunnelStartOn404(next);
|
|
||||||
|
const errorPayload = {
|
||||||
|
cause: "invalid page prerequisites for page",
|
||||||
|
currentPage: from?.query?.fmgPage,
|
||||||
|
nextPage: to?.query?.fmgPage,
|
||||||
|
};
|
||||||
|
|
||||||
|
GoToFunnelStartOn404(next, errorPayload);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log("------------- router index.js beforeEnter end -----------------");
|
log("------------- router index.js beforeEnter end -----------------");
|
||||||
|
|
@ -261,7 +291,16 @@ const routes = [
|
||||||
console.log(new Date() + " Exception in beforeEnter:" + JSON.stringify(error));
|
console.log(new Date() + " Exception in beforeEnter:" + JSON.stringify(error));
|
||||||
|
|
||||||
// If we don't have a route, go to our 404 page.
|
// If we don't have a route, go to our 404 page.
|
||||||
GoToFunnelStartOn404(next);
|
const errorPayload = {
|
||||||
|
cause: "uncaught error in beforeEnter",
|
||||||
|
currentPage: from?.query?.fmgPage,
|
||||||
|
nextPage: to?.query?.fmgPage,
|
||||||
|
fullError: error,
|
||||||
|
errorStack: error?.stack,
|
||||||
|
};
|
||||||
|
|
||||||
|
GoToFunnelStartOn404(next, errorPayload);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -397,8 +436,8 @@ router.navigateToExternalUrl = (url, optionalQuery = {}) => {
|
||||||
navigateToUrl(url, optionalQuery);
|
navigateToUrl(url, optionalQuery);
|
||||||
};
|
};
|
||||||
|
|
||||||
router.navigateError = () => {
|
router.navigateError = (errorPayload = null) => {
|
||||||
DisplayPageError();
|
DisplayPageError(errorPayload);
|
||||||
};
|
};
|
||||||
|
|
||||||
//Use this navigation when you need to call next() explicitly. beforeRouteEnter is a good example.
|
//Use this navigation when you need to call next() explicitly. beforeRouteEnter is a good example.
|
||||||
|
|
@ -588,7 +627,19 @@ function GetRouteInfoFromPageName(pageName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go to our start page on a 404.
|
// Go to our start page on a 404.
|
||||||
function GoToFunnelStartOn404(next) {
|
function GoToFunnelStartOn404(next, errorPayload = null) {
|
||||||
|
if (errorPayload !== null) {
|
||||||
|
errorPayload.type = "GoToFunnelStartOn404";
|
||||||
|
analyticsMixin.methods.pushPageErrorToDataLayer(errorPayload);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
"%cGoToFunnelStartOn404()... errorPayload",
|
||||||
|
"color: white; background-color: blue; padding: 5px;",
|
||||||
|
errorPayload
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Put item on the bus
|
// Put item on the bus
|
||||||
eventBus.addEventToBus(
|
eventBus.addEventToBus(
|
||||||
globalEvents.Categories.GLOBAL_ALERT,
|
globalEvents.Categories.GLOBAL_ALERT,
|
||||||
|
|
@ -607,7 +658,28 @@ function GoToFunnelStartOn404(next) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function DisplayPageError() {
|
async function DisplayPageError(errorPayload = null) {
|
||||||
|
console.log("%c running DisplayPageError()... ", "font-size: 20px; color: purple;");
|
||||||
|
|
||||||
|
if(errorPayload !== null) {
|
||||||
|
errorPayload.type = "DisplayPageError";
|
||||||
|
analyticsMixin.methods.pushPageErrorToDataLayer(errorPayload);
|
||||||
|
} else {
|
||||||
|
// very cautiously to avoid additional errors:
|
||||||
|
var currentPage = "";
|
||||||
|
try {
|
||||||
|
currentPage = getQuerystringParameter(queryStrings.FMG_PAGE);
|
||||||
|
} catch (e) {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
errorPayload = {
|
||||||
|
type: "DisplayPageError",
|
||||||
|
cause: "Unknown page error",
|
||||||
|
currentPage: currentPage,
|
||||||
|
};
|
||||||
|
analyticsMixin.methods.pushPageErrorToDataLayer(errorPayload);
|
||||||
|
}
|
||||||
|
|
||||||
// Put item on the bus
|
// Put item on the bus
|
||||||
eventBus.addEventToBus(
|
eventBus.addEventToBus(
|
||||||
globalEvents.Categories.GLOBAL_ALERT,
|
globalEvents.Categories.GLOBAL_ALERT,
|
||||||
|
|
@ -620,12 +692,9 @@ async function DisplayPageError() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (
|
if (
|
||||||
store.getters.externalParameterState?.isExternalParameter ==
|
store.getters.externalParameterState?.isExternalParameter == externalParameterStatus.ACTIVE
|
||||||
externalParameterStatus.ACTIVE ||
|
|
||||||
store.getters.externalParameterState?.isExternalParameter ==
|
|
||||||
externalParameterStatus.INACTIVE
|
|
||||||
) {
|
) {
|
||||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.NOT_SET);
|
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.INACTIVE);
|
||||||
}
|
}
|
||||||
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||||
const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR);
|
const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue