CASH-77: update where saveQuote is called to allow for loading icon and delay until complete
This commit is contained in:
parent
7bd2dd3b27
commit
3823ab8d7f
3 changed files with 26 additions and 20 deletions
|
|
@ -37,6 +37,7 @@ import modal from "@/digital-components/modal/modal";
|
|||
import { storeActions } from "@/constants/store-actions.js";
|
||||
import buttonMain from "@/ux-components/button-main/button-main";
|
||||
import alert from "@/ux-components/alert/alert";
|
||||
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
||||
|
||||
export default {
|
||||
name: "save-progress-modal-question",
|
||||
|
|
@ -88,13 +89,16 @@ export default {
|
|||
// save email address to store
|
||||
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
|
||||
this.isProgressSaved = true;
|
||||
|
||||
|
||||
// communicate to parent the new status
|
||||
this.$emit("save-progress-saved");
|
||||
|
||||
this.modal.closeModal();
|
||||
|
||||
// send store call to send to new API (that triggers an email send)
|
||||
this.$emit("save-progress");
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import modal from "@/digital-components/modal/modal";
|
|||
import { storeActions } from "@/constants/store-actions.js";
|
||||
import buttonMain from "@/ux-components/button-main/button-main";
|
||||
import alert from "@/ux-components/alert/alert";
|
||||
import { saveQuote } from "@/helpers/heritage-integration/order-helper.js";
|
||||
|
||||
export default {
|
||||
name: "save-progress-popup-question",
|
||||
|
|
@ -99,15 +100,14 @@ export default {
|
|||
// save email address to store
|
||||
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
|
||||
this.isProgressSaved = true;
|
||||
|
||||
// send store call to send to new API (that triggers an email send)
|
||||
this.$emit("save-progress");
|
||||
|
||||
// send call to close popup
|
||||
this.closeModal();
|
||||
this.$emit("close-save-progress-popup");
|
||||
// communicate to parent the new status
|
||||
this.$emit("save-progress-saved");
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -82,8 +82,9 @@
|
|||
<saveProgressModalQuestion
|
||||
modalWidgetName="SaveProgressModalWidget"
|
||||
modalName="SaveProgressModal"
|
||||
v-if="!isEmailInStoreOnPageLoad"
|
||||
@save-progress="saveProgress" />
|
||||
v-if="showSaveProgressModal"
|
||||
pageName="quote"
|
||||
@save-progress-saved="updateSaveProgressAsSaved" />
|
||||
|
||||
<textBlock
|
||||
cmsWidgetName="quoteDisclaimer"
|
||||
|
|
@ -98,9 +99,10 @@
|
|||
<saveProgressPopupQuestion
|
||||
modalWidgetName="SaveProgressPopupWidget"
|
||||
modalName="SaveProgressPopup"
|
||||
v-if="!isEmailInStoreOnPageLoad && showSaveProgressPopup"
|
||||
pageName="quote"
|
||||
v-if="showSaveProgressPopup"
|
||||
:showSaveProgressPopup="showSaveProgressPopup"
|
||||
@save-progress="saveProgress"
|
||||
@save-progress-saved="updateSaveProgressAsSaved"
|
||||
@close-save-progress-popup="closeSaveProgressPopup" />
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -209,6 +211,7 @@ export default {
|
|||
const emailFromStore = store.getters.order.customer.emailAddress;
|
||||
const isEmailInStoreOnPageLoad = emailFromStore?.length > 0;
|
||||
const showSaveProgressPopup = isEmailInStoreOnPageLoad ? false : true;
|
||||
const showSaveProgressModal = isEmailInStoreOnPageLoad ? false : true;
|
||||
|
||||
const lineItems = deepClone(store.getters.order.lineItems);
|
||||
lineItems.vaps = lineItems.vaps ?? [];
|
||||
|
|
@ -290,8 +293,8 @@ export default {
|
|||
// Call the "next" function to complete the transition to this page.
|
||||
next(async (vm) => {
|
||||
vm.setCmsContent(resultMap.cmsContent);
|
||||
vm.isEmailInStoreOnPageLoad = isEmailInStoreOnPageLoad;
|
||||
vm.showSaveProgressPopup = showSaveProgressPopup;
|
||||
vm.showSaveProgressModal = showSaveProgressModal;
|
||||
vm.addableVaps = addableVaps;
|
||||
vm.lineItems = lineItems;
|
||||
vm.availableLineItems = pricingResults;
|
||||
|
|
@ -438,8 +441,9 @@ export default {
|
|||
servicePackage: null,
|
||||
holdParentAccountNumber: null,
|
||||
holdBillToAccountNumber: null,
|
||||
isEmailInStoreOnPageLoad: null,
|
||||
showSaveProgressPopup: null,
|
||||
showSaveProgressModal: null,
|
||||
isSaveProgressComplete: null,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -529,10 +533,8 @@ export default {
|
|||
backButtonAction() {
|
||||
vehicleQuestionsMixin.methods.navigateBack(this);
|
||||
},
|
||||
saveProgress() {
|
||||
this.isEmailInStoreOnPageLoad = true;
|
||||
this.showSaveProgressPopup = false;
|
||||
saveQuote({ pageNameToLog: "quote" });
|
||||
updateSaveProgressAsSaved() {
|
||||
this.showSaveProgressModal = false;
|
||||
},
|
||||
closeSaveProgressPopup() {
|
||||
this.showSaveProgressPopup = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue