CSR-2066
handleBeforeUnload and formatting
This commit is contained in:
parent
7bd2396160
commit
39033e858d
15 changed files with 59 additions and 56 deletions
|
|
@ -106,11 +106,7 @@ export async function getImplicitNavigation(toRoute) {
|
|||
Used to navigate to the heritage funnel with the correct query string and url.
|
||||
*/
|
||||
|
||||
export async function navigateToHeritageFunnel({
|
||||
shouldSaveSession,
|
||||
pageNameToLog,
|
||||
callBackMethod = null,
|
||||
}) {
|
||||
export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLog }) {
|
||||
const log = getQuerystringParameter(queryStrings.LOG);
|
||||
if (eval(log)) {
|
||||
console.log("------------- Navigate to heritage start -----------------");
|
||||
|
|
@ -154,7 +150,7 @@ export async function navigateToHeritageFunnel({
|
|||
window.sessionStorage.removeItem("createNewSessionForHeritage");
|
||||
}
|
||||
|
||||
router.navigateToExternalUrl(applicationConfig.HERITAGE_FUNNEL, heritageParms, callBackMethod);
|
||||
router.navigateToExternalUrl(applicationConfig.HERITAGE_FUNNEL, heritageParms);
|
||||
}
|
||||
|
||||
export async function skipVinLookup() {
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ describe("navigateToHeritageFunnel", () => {
|
|||
externalUrls.HERITAGE_FUNNEL,
|
||||
expect.objectContaining({
|
||||
corid: mockCorrelationId,
|
||||
}),null
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-xl-4 mt-4">
|
||||
|
||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" ref="funnelSubHeader" />
|
||||
|
||||
<customerQuestions
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-xl-4 mt-4">
|
||||
|
||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<alert
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-xl-4 mt-4">
|
||||
|
||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<navbar
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@
|
|||
<span v-html="ScheduleConfirmationText"></span>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<div></div>
|
||||
|
||||
<div class="scheduleText">
|
||||
<p>{{ ScheduleDateFormatted }}</p>
|
||||
|
|
|
|||
|
|
@ -111,6 +111,10 @@ export default {
|
|||
: "";
|
||||
return accountNumber;
|
||||
},
|
||||
handleBeforeUnload() {
|
||||
const insuranceCompanyPage = document.getElementById("insurance-company");
|
||||
insuranceCompanyPage.parentElement.removeChild(insuranceCompanyPage);
|
||||
},
|
||||
arePagePrerequisitesValid() {
|
||||
return store.getters.order.payment.isInsurance === true;
|
||||
},
|
||||
|
|
@ -140,17 +144,17 @@ export default {
|
|||
billToAccountNumber,
|
||||
false
|
||||
);
|
||||
//Manually unmount component in case navigate to external application.
|
||||
window.addEventListener("beforeunload", this.handleBeforeUnload);
|
||||
|
||||
navigateToHeritageFunnel({
|
||||
shouldSaveSession: true,
|
||||
pageNameToLog: "insurance-company",
|
||||
callBackMethod: this.unloadPage,
|
||||
});
|
||||
},
|
||||
unloadPage() {
|
||||
const insuranceCompanyPage = document.getElementById("insurance-company");
|
||||
insuranceCompanyPage.parentElement.removeChild(insuranceCompanyPage);
|
||||
},
|
||||
},
|
||||
unmounted() {
|
||||
window.removeEventListener("beforeunload", this.handleBeforeUnload);
|
||||
},
|
||||
components: {
|
||||
funnelHeader,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-xl-4 mt-4">
|
||||
|
||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<textboxQuestion
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
</div>
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-xl-4 mt-4">
|
||||
|
||||
<funnelSubHeader class="mb-5" cmsWidgetName="FunnelSubHeaderWidget" />
|
||||
|
||||
<hr class="my-0" />
|
||||
|
|
@ -420,7 +419,8 @@ export default {
|
|||
customer.emailAddress
|
||||
);
|
||||
|
||||
const preReqResult = serviceLocationReqs && isInsuranceSet() && scheduleReqs && customerReqs;
|
||||
const preReqResult =
|
||||
serviceLocationReqs && isInsuranceSet() && scheduleReqs && customerReqs;
|
||||
|
||||
// prettier-ignore
|
||||
{
|
||||
|
|
@ -443,7 +443,7 @@ export default {
|
|||
console.log(new Date() + " customerReqs::customer.emailAddress:" + customer.emailAddress);
|
||||
console.log("------------- payment-method.vue pagePrereqs end -----------------");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return preReqResult;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -139,7 +139,10 @@
|
|||
type="hidden"
|
||||
name="sgtermsofusedisplaytext"
|
||||
value="By selecting submit, I agree to Safelite's" />
|
||||
<input type="hidden" name="sgtermsofuseurl" value="http://www.safelite.com/terms-of-service/" />
|
||||
<input
|
||||
type="hidden"
|
||||
name="sgtermsofuseurl"
|
||||
value="http://www.safelite.com/terms-of-service/" />
|
||||
<input type="hidden" name="sgtermsofuselinkdisplaytext" value="Terms of service" />
|
||||
<input type="hidden" name="sgtermsofcancelrefunddisplaytext" value="and" />
|
||||
<input
|
||||
|
|
|
|||
|
|
@ -447,15 +447,14 @@ export default {
|
|||
arePagePrerequisitesValid() {
|
||||
const payment = store.getters.order.payment;
|
||||
|
||||
const preReqResult = (
|
||||
const preReqResult =
|
||||
store.getters.order.serviceLocation.zipCode &&
|
||||
store.getters.order.serviceLocation.zipCodeCtu &&
|
||||
(store.getters.order.damage.isRepair ||
|
||||
(store.getters.order.lineItems?.glassParts != null &&
|
||||
store.getters.order.lineItems.glassParts.length > 0)) &&
|
||||
(payment.insuranceCoverage?.isVerified == null ||
|
||||
payment.insuranceCoverage?.isVerified === false)
|
||||
);
|
||||
payment.insuranceCoverage?.isVerified === false);
|
||||
|
||||
// prettier-ignore
|
||||
{
|
||||
|
|
@ -592,7 +591,10 @@ export default {
|
|||
});
|
||||
}
|
||||
let price = 0;
|
||||
if (tier.additionalButtonData?.servicePackageDiscount && this.isServicePackageDiscountOnOrder) {
|
||||
if (
|
||||
tier.additionalButtonData?.servicePackageDiscount &&
|
||||
this.isServicePackageDiscountOnOrder
|
||||
) {
|
||||
lineItemsToPrice.push(...this.servicePackageDiscountParts);
|
||||
}
|
||||
price += baseMixin.methods.getTierOnePackagePrice(
|
||||
|
|
|
|||
|
|
@ -447,8 +447,10 @@ export default {
|
|||
this.updateSupportingItems();
|
||||
|
||||
if (this.selectedTimeSlotInfo.timeSlot.jobMinMinutes == null) {
|
||||
this.selectedTimeSlotInfo.timeSlot.jobMinMinutes = this.selectableDatesData?.estimatedServiceMinutesMinimum?.toString();
|
||||
this.selectedTimeSlotInfo.timeSlot.jobMaxMinutes = this.selectableDatesData?.estimatedServiceMinutesMaximum?.toString();
|
||||
this.selectedTimeSlotInfo.timeSlot.jobMinMinutes =
|
||||
this.selectableDatesData?.estimatedServiceMinutesMinimum?.toString();
|
||||
this.selectedTimeSlotInfo.timeSlot.jobMaxMinutes =
|
||||
this.selectableDatesData?.estimatedServiceMinutesMaximum?.toString();
|
||||
}
|
||||
|
||||
this.dispatchStoreAction(
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ export default {
|
|||
console.log(new Date() + "Cash: servce-location invalid prereqs");
|
||||
console.log(new Date() + "store.getters.lineItems.supportingItems:" + JSON.stringify(store.getters.lineItems.supportingItems));
|
||||
console.log(new Date() + "store.getters.order.serviceLocation.zipCode:" + store.getters.order.serviceLocation.zipCode);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,8 +361,8 @@ router.navigateWithSaving = (
|
|||
navigate(scenario, currentRoute, true, optionalQuery, optionalParams, optionalPageData);
|
||||
};
|
||||
|
||||
router.navigateToExternalUrl = (url, optionalQuery = {}, callBackMethod = null) => {
|
||||
navigateToUrl(url, optionalQuery, callBackMethod);
|
||||
router.navigateToExternalUrl = (url, optionalQuery = {}) => {
|
||||
navigateToUrl(url, optionalQuery);
|
||||
};
|
||||
|
||||
router.navigateError = () => {
|
||||
|
|
@ -493,16 +493,13 @@ function getNavigationMap(scenario, currentRoute) {
|
|||
//---------------------------------------------------------- Private Functions ----------------------------------------------------------
|
||||
|
||||
// Navigate to an external url.
|
||||
function navigateToUrl(url, optionalQuery = {}, callBackMethod = null) {
|
||||
function navigateToUrl(url, optionalQuery = {}) {
|
||||
// possibly show some loading screen in the future here.
|
||||
var externalUrl = new URL(url);
|
||||
|
||||
for (const queryKey in optionalQuery) {
|
||||
externalUrl.searchParams.append(queryKey, optionalQuery[queryKey]);
|
||||
}
|
||||
//cleanup method before navigate to external
|
||||
callBackMethod?.();
|
||||
showFmgLoadingModal(true);
|
||||
|
||||
window.location.assign(externalUrl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,50 +79,55 @@ caption,
|
|||
// Averta Fonts
|
||||
|
||||
@font-face {
|
||||
font-family: 'AvertaBold';
|
||||
src: url('@/assets/fonts/averta-bold-webfont.woff2') format('woff2'),
|
||||
url('@/assets/fonts/averta-bold-webfont.woff') format('woff');
|
||||
font-family: "AvertaBold";
|
||||
src:
|
||||
url("@/assets/fonts/averta-bold-webfont.woff2") format("woff2"),
|
||||
url("@/assets/fonts/averta-bold-webfont.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'AvertaBold_Italic';
|
||||
src: url('@/assets/fonts/averta-bolditalic-webfont.woff2') format('woff2'),
|
||||
url('@/assets/fonts/averta-bolditalic-webfont.woff') format('woff');
|
||||
font-family: "AvertaBold_Italic";
|
||||
src:
|
||||
url("@/assets/fonts/averta-bolditalic-webfont.woff2") format("woff2"),
|
||||
url("@/assets/fonts/averta-bolditalic-webfont.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'AvertaExtraBold';
|
||||
src: url('@/assets/fonts/averta-extrabold-webfont.woff2') format('woff2'),
|
||||
url('@/assets/fonts/averta-extrabold-webfont.woff') format('woff');
|
||||
font-family: "AvertaExtraBold";
|
||||
src:
|
||||
url("@/assets/fonts/averta-extrabold-webfont.woff2") format("woff2"),
|
||||
url("@/assets/fonts/averta-extrabold-webfont.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'AvertaRegular';
|
||||
src: url('@/assets/fonts/averta-regular-webfont.woff2') format('woff2'),
|
||||
url('@/assets/fonts/averta-regular-webfont.woff') format('woff');
|
||||
font-family: "AvertaRegular";
|
||||
src:
|
||||
url("@/assets/fonts/averta-regular-webfont.woff2") format("woff2"),
|
||||
url("@/assets/fonts/averta-regular-webfont.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'AvertaRegular_Italic';
|
||||
src: url('@/assets/fonts/averta-regularitalic-webfont.woff2') format('woff2'),
|
||||
url('@/assets/fonts/averta-regularitalic-webfont.woff') format('woff');
|
||||
font-family: "AvertaRegular_Italic";
|
||||
src:
|
||||
url("@/assets/fonts/averta-regularitalic-webfont.woff2") format("woff2"),
|
||||
url("@/assets/fonts/averta-regularitalic-webfont.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'AvertaSemibold';
|
||||
src: url('@/assets/fonts/averta-semibold-webfont.woff2') format('woff2'),
|
||||
url('@/assets/fonts/averta-semibold-webfont.woff') format('woff');
|
||||
font-family: "AvertaSemibold";
|
||||
src:
|
||||
url("@/assets/fonts/averta-semibold-webfont.woff2") format("woff2"),
|
||||
url("@/assets/fonts/averta-semibold-webfont.woff") format("woff");
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue