CASH-2563: Create submittedState and UI updates
This commit is contained in:
parent
7a76a0a269
commit
c63fc7eff5
3 changed files with 22 additions and 4 deletions
|
|
@ -13,7 +13,8 @@
|
|||
id="btn-vehicle-not-listed"
|
||||
:isPrimary="true"
|
||||
:buttonText="ReturnToHomeButtonText"
|
||||
class="mb-3"
|
||||
loaderColor="white"
|
||||
class="w-100 mb-3"
|
||||
@click-event="forwardButtonAction" />
|
||||
</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 buttonMain from "@/ux-components/button-main/button-main";
|
||||
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 { settleAllPromises } from "@/helpers/layout-helper";
|
||||
|
|
@ -39,6 +42,9 @@ export default {
|
|||
},
|
||||
|
||||
async beforeRouteEnter(to, from, next) {
|
||||
// Clear order
|
||||
await baseMixin.methods.dispatchStoreAction(storeActions.CREATE_SUBMITTED_STATE);
|
||||
|
||||
// Call APIs
|
||||
const cmsContentPromise = fetchCmsContentForPage(to.name);
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,11 @@ export async function beforeEach(to, from) {
|
|||
|
||||
// Block navigation if an order has been submitted.
|
||||
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)) {
|
||||
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 { getDestination } from "@/router/methods/helpers/get-destination";
|
||||
import { savePageData } from "@/router/methods/helpers/save-page-data";
|
||||
import { navigationScenarios } from "@/router/constants/navigation-scenarios";
|
||||
import router from "@/router";
|
||||
import store from "@/store";
|
||||
|
||||
|
|
@ -39,7 +40,14 @@ async function navigate(scenario, currentPageName, withSaving = false, forceTopL
|
|||
store.getters?.applicationUser?.savedSessionId ||
|
||||
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