CSR-2066
Cleanup Before Navigate to External
This commit is contained in:
parent
e63697762b
commit
9065676535
3 changed files with 20 additions and 13 deletions
|
|
@ -109,7 +109,7 @@ export async function getImplicitNavigation(toRoute) {
|
|||
export async function navigateToHeritageFunnel({
|
||||
shouldSaveSession,
|
||||
pageNameToLog,
|
||||
cleanupBeforeNavigateExternalMethod = null,
|
||||
callBackMethod = null,
|
||||
}) {
|
||||
const log = getQuerystringParameter(queryStrings.LOG);
|
||||
if (eval(log)) {
|
||||
|
|
@ -147,10 +147,7 @@ export async function navigateToHeritageFunnel({
|
|||
) {
|
||||
heritageParms["forceEndToEndInsurance"] = true;
|
||||
}
|
||||
//Cleanup Before Navigate to External
|
||||
cleanupBeforeNavigateExternalMethod?.();
|
||||
|
||||
router.navigateToExternalUrl(applicationConfig.HERITAGE_FUNNEL, heritageParms);
|
||||
router.navigateToExternalUrl(applicationConfig.HERITAGE_FUNNEL, heritageParms, callBackMethod);
|
||||
}
|
||||
|
||||
export async function skipVinLookup() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
<template>
|
||||
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
|
||||
<Form
|
||||
@submit="onSubmit"
|
||||
@invalid-submit="onInvalidSubmit"
|
||||
ref="theForm"
|
||||
v-slot="{ meta }"
|
||||
id="insurance-company">
|
||||
<loadingModal ref="loadingModal" />
|
||||
<div class="container-fluid page-container-grouped-styles">
|
||||
<div class="row justify-content-center">
|
||||
|
|
@ -81,6 +86,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
parentAccountNumber: this.parentAccountNumberFromStore(),
|
||||
|
|
@ -138,12 +144,13 @@ export default {
|
|||
navigateToHeritageFunnel({
|
||||
shouldSaveSession: true,
|
||||
pageNameToLog: "insurance-company",
|
||||
cleanupBeforeNavigateExternalMethod: this.reloadPage,
|
||||
callBackMethod: this.unloadPage,
|
||||
});
|
||||
},
|
||||
reloadPage(){
|
||||
window.location.reload();
|
||||
}
|
||||
unloadPage() {
|
||||
const insuranceCompanyPage = document.getElementById("insurance-company");
|
||||
insuranceCompanyPage.parentElement.removeChild(insuranceCompanyPage);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
funnelHeader,
|
||||
|
|
|
|||
|
|
@ -359,8 +359,8 @@ router.navigateWithSaving = (
|
|||
navigate(scenario, currentRoute, true, optionalQuery, optionalParams, optionalPageData);
|
||||
};
|
||||
|
||||
router.navigateToExternalUrl = (url, optionalQuery = {}) => {
|
||||
navigateToUrl(url, optionalQuery);
|
||||
router.navigateToExternalUrl = (url, optionalQuery = {}, callBackMethod = null) => {
|
||||
navigateToUrl(url, optionalQuery, callBackMethod);
|
||||
};
|
||||
|
||||
router.navigateError = () => {
|
||||
|
|
@ -491,13 +491,16 @@ function getNavigationMap(scenario, currentRoute) {
|
|||
//---------------------------------------------------------- Private Functions ----------------------------------------------------------
|
||||
|
||||
// Navigate to an external url.
|
||||
function navigateToUrl(url, optionalQuery = {}) {
|
||||
function navigateToUrl(url, optionalQuery = {}, callBackMethod = null) {
|
||||
// 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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue