Merge pull request #3177 from Safelite/feature/CASH-2563
Feature/CASH 2563
This commit is contained in:
commit
a9086e910b
3 changed files with 22 additions and 4 deletions
|
|
@ -13,7 +13,8 @@
|
||||||
id="btn-vehicle-not-listed"
|
id="btn-vehicle-not-listed"
|
||||||
:isPrimary="true"
|
:isPrimary="true"
|
||||||
:buttonText="ReturnToHomeButtonText"
|
:buttonText="ReturnToHomeButtonText"
|
||||||
class="mb-3"
|
loaderColor="white"
|
||||||
|
class="w-100 mb-3"
|
||||||
@click-event="forwardButtonAction" />
|
@click-event="forwardButtonAction" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -27,6 +28,8 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header";
|
||||||
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header";
|
||||||
import buttonMain from "@/ux-components/button-main/button-main";
|
import buttonMain from "@/ux-components/button-main/button-main";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
import baseMixin from "@/mixins/base-mixin.js";
|
||||||
|
import { storeActions } from "@/constants/store-actions";
|
||||||
|
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
|
@ -39,6 +42,9 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
|
// Clear order
|
||||||
|
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_STATE);
|
||||||
|
|
||||||
// Call APIs
|
// Call APIs
|
||||||
const cmsContentPromise = fetchCmsContentForPage(to.name);
|
const cmsContentPromise = fetchCmsContentForPage(to.name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,11 @@ export async function beforeEach(to, from) {
|
||||||
|
|
||||||
// Block navigation if an order has been submitted.
|
// Block navigation if an order has been submitted.
|
||||||
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
if (window.sessionStorage.getItem(sessionStorageKeyConstants.SUBMITTED_STATE) !== null) {
|
||||||
const exceptionPages = [FUNNEL_START_PAGE.name, routeData.CONFIRMATION.name];
|
const exceptionPages = [
|
||||||
|
FUNNEL_START_PAGE.name,
|
||||||
|
routeData.CONFIRMATION.name,
|
||||||
|
routeData.BAILOUT_SUCCESS.name,
|
||||||
|
];
|
||||||
|
|
||||||
if (!exceptionPages.some((name) => to.name === name) && !isVirtualRoute(to.name)) {
|
if (!exceptionPages.some((name) => to.name === name) && !isVirtualRoute(to.name)) {
|
||||||
router.push({
|
router.push({
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
import { saveSession } from "@/helpers/heritage-integration/order-helper";
|
import { saveSession, submitBailout } from "@/helpers/heritage-integration/order-helper";
|
||||||
import { buildManualUrl } from "@/router/methods/helpers/build-manual-url";
|
import { buildManualUrl } from "@/router/methods/helpers/build-manual-url";
|
||||||
import { getDestination } from "@/router/methods/helpers/get-destination";
|
import { getDestination } from "@/router/methods/helpers/get-destination";
|
||||||
import { savePageData } from "@/router/methods/helpers/save-page-data";
|
import { savePageData } from "@/router/methods/helpers/save-page-data";
|
||||||
|
import { navigationScenarios } from "@/router/constants/navigation-scenarios";
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
|
|
@ -39,7 +40,14 @@ async function navigate(scenario, currentPageName, withSaving = false, forceTopL
|
||||||
store.getters?.applicationUser?.savedSessionId ||
|
store.getters?.applicationUser?.savedSessionId ||
|
||||||
store.getters?.order?.customer?.emailAddress
|
store.getters?.order?.customer?.emailAddress
|
||||||
) {
|
) {
|
||||||
await saveSession({ pageNameToLog: nextPage.name });
|
if (
|
||||||
|
scenario.toUpperCase() === navigationScenarios.CLICKED_FORWARD &&
|
||||||
|
currentPageName.toUpperCase() === navigationScenarios.BAILOUT
|
||||||
|
) {
|
||||||
|
await submitBailout({ pageNameToLog: nextPage.name });
|
||||||
|
} else {
|
||||||
|
await saveSession({ pageNameToLog: nextPage.name });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue