Initial fix for duplicate check logic issues.
This commit is contained in:
parent
867a4ef4ea
commit
ec973c0041
4 changed files with 23 additions and 8 deletions
|
|
@ -24,7 +24,9 @@ export async function saveSession({ shouldAwaitSaveSessionQueue = false, submitA
|
|||
|
||||
store.setSaveSessionPromise(saveSessionPromise);
|
||||
|
||||
if (!store.applicationUser.savedSessionId || shouldAwaitSaveSessionQueue) {
|
||||
// This should await anytime the referral number is not set, or the shouldAwaitSaveSessionQueue is set to true.
|
||||
if (!store.order.referralNumber || shouldAwaitSaveSessionQueue) {
|
||||
console.error('Awaiting save session promise', { shouldAwaitSaveSessionQueue, submitAfterSave, createWorkOrderNumberForPIA, bailoutOnError });
|
||||
await saveSessionPromise;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import showIssLoadingModal from '@/helpers/loading-modal-helper';
|
|||
import applicationConfig from '@/constants/application-config';
|
||||
import { toPossessive } from '@/helpers/text-helper';
|
||||
import analyticsMixin from '@/mixins/analytics-mixin';
|
||||
import routerParams from '@/router/router-constants/router-params';
|
||||
|
||||
export default {
|
||||
name: 'entry-page',
|
||||
|
|
@ -85,8 +86,8 @@ export default {
|
|||
|| applicationConfig.CURRENT_ENVIRONMENT === 'Dev'
|
||||
|| applicationConfig.CURRENT_ENVIRONMENT === 'SysTest'
|
||||
) {
|
||||
this.navigateForward();
|
||||
} else {
|
||||
this.navigateForward();
|
||||
} else {
|
||||
// Forced full location redirect here. We do not want the entry page as part of the router/flow/path history.
|
||||
window.location = `/?issPage=${issPageValues.WELCOME_PAGE}`;
|
||||
}
|
||||
|
|
@ -94,9 +95,12 @@ export default {
|
|||
methods:
|
||||
{
|
||||
navigateForward() {
|
||||
// Har har har I think we were supposed to skip saving session here.
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.MOVE_FORWARD_ENTRY_PAGE,
|
||||
this.$route
|
||||
this.$route,
|
||||
{},
|
||||
{ [routerParams.SKIP_SAVE_SESSION]: true }
|
||||
);
|
||||
},
|
||||
parseQueryParms() {
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true })
|
||||
//await saveSession({ shouldAwaitSaveSessionQueue: true, bailoutOnError: true })
|
||||
this.navigateForward();
|
||||
},
|
||||
async configureZip() {
|
||||
|
|
@ -387,6 +387,7 @@ export default {
|
|||
navigateForward() {
|
||||
if ((this.mainStore.applicationUser.duplicateOrders?.length > 0 ?? false)
|
||||
&& !this.answeredContinueModal) {
|
||||
console.error("Duplicate orders found, navigating to duplicate check page, skipping save session");
|
||||
this.$router.navigate(
|
||||
this.navigationScenarios.CLICKED_FORWARD_WITH_DUPLICATES,
|
||||
this.$route,
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ const routes = [
|
|||
await GoToStartOn404(next);
|
||||
}
|
||||
|
||||
return next({name: issPageToUse, query: to.query, params: to.params});
|
||||
return next({name: issPageToUse, query: to.query, params: to.params, state: to.state});
|
||||
}
|
||||
|
||||
var routeData = [];
|
||||
|
|
@ -129,7 +129,8 @@ const routes = [
|
|||
next({
|
||||
name: routeData[0].name,
|
||||
query: Object.assign(to.query, {issPage: routeData[0].name}),
|
||||
params: to.params
|
||||
params: to.params,
|
||||
state: to.state
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
|
@ -195,11 +196,18 @@ router.afterEach(async (to, from) => {
|
|||
const shouldRunExperiments = (to.query.issPage !== issPageValues.BAILOUT_PAGE);
|
||||
|
||||
await analyticsMixin.methods.validateSession();
|
||||
|
||||
console.error("Router parameters", { routerParams: routerParams, toState: to.state });
|
||||
|
||||
const skipSaveSession = !!router.options.history.state[routerParams.SKIP_SAVE_SESSION];
|
||||
const skipSaveSession = !!(
|
||||
to.state?.[routerParams.SKIP_SAVE_SESSION]
|
||||
?? router.options.history.state?.[routerParams.SKIP_SAVE_SESSION]
|
||||
);
|
||||
if (from.name !== undefined && !skipSaveSession && !store.hasSubmittedOrder()) {
|
||||
console.error('Saving session on route change', { from: from.name, to: to.name, skipSaveSession: skipSaveSession, hasSubmittedOrder: store.hasSubmittedOrder() });
|
||||
await saveSession({ bailoutOnError: from.name === issPageValues.ENTRY_PAGE});
|
||||
}
|
||||
console.error('Skipping saving session on route change', { from: from.name, to: to.name, skipSaveSession: skipSaveSession, hasSubmittedOrder: store.hasSubmittedOrder() });
|
||||
|
||||
document.title = routerTitles[to.query.issPage] || 'Safelite Solutions®';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue