Merge branch 'release/2026.05.21' into rlsmerge/2026.05.21-to-develop

This commit is contained in:
credelinghuys 2026-05-19 13:11:33 -04:00
commit b68ac0780d
7 changed files with 81 additions and 25 deletions

View file

@ -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);
@ -67,10 +73,11 @@ export default {
}, },
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
return ( return (
store.getters.order.customer.firstName && (store.getters.order.customer.firstName &&
store.getters.order.customer.lastName && store.getters.order.customer.lastName &&
store.getters.order.customer.emailAddress && store.getters.order.customer.emailAddress &&
store.getters.order.customer.phoneNumber store.getters.order.customer.phoneNumber) ||
baseMixin.methods.hasSubmittedOrder()
); );
}, },
}, },

View file

@ -36,9 +36,21 @@ describe("bailout.vue", () => {
expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true); expect(wrapper.findComponent({ name: "navbar" }).exists()).toBe(true);
}); });
test("arePagePrerequisitesValid should be false ", async () => {
//Arrange
const { wrapper } = setupMocks();
//Act
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
//Assert
expect(arePagePrerequisitesValid).toBe(false);
});
test("arePagePrerequisitesValid should be true ", async () => { test("arePagePrerequisitesValid should be true ", async () => {
//Arrange //Arrange
const { wrapper } = setupMocks(); const { wrapper } = setupMocks();
wrapper.vm.getBailoutCodeFromStore = jest.fn().mockReturnValue("BAILOUT_CODE");
//Act //Act
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid(); let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();

View file

@ -43,6 +43,8 @@
validationRules="phone-number-required" /> validationRules="phone-number-required" />
<textboxQuestion <textboxQuestion
isRequired
v-if="!serviceZipCode"
class="mb-4" class="mb-4"
cmsWidgetName="ServiceZipQuestionWidget" cmsWidgetName="ServiceZipQuestionWidget"
v-model="serviceZipCode" v-model="serviceZipCode"
@ -242,7 +244,7 @@ export default {
} }
}, },
arePagePrerequisitesValid() { arePagePrerequisitesValid() {
return true; return this.getBailoutCodeFromStore() !== null;
}, },
}, },

View file

@ -1,5 +1,6 @@
import { routeData } from "@/router/constants/routes"; import { routeData } from "@/router/constants/routes";
import { navigationScenarios } from "@/router/constants/navigation-scenarios"; import { navigationScenarios } from "@/router/constants/navigation-scenarios";
import { FUNNEL_START_PAGE } from "@/router/constants/routes";
import store from "@/store"; import store from "@/store";
import { paymentMethods } from "@/constants/payment-method-constants"; import { paymentMethods } from "@/constants/payment-method-constants";
@ -88,6 +89,10 @@ const routingTable = function () {
scenario: navigationScenarios.CLICKED_VIN_RETRY, scenario: navigationScenarios.CLICKED_VIN_RETRY,
destinationPageData: routeData.ESTIMATE, destinationPageData: routeData.ESTIMATE,
}, },
{
scenario: navigationScenarios.BAILOUT,
destinationPageData: routeData.BAILOUT,
},
], ],
}, },
{ {
@ -128,6 +133,10 @@ const routingTable = function () {
scenario: navigationScenarios.CLICKED_VIN_RETRY, scenario: navigationScenarios.CLICKED_VIN_RETRY,
destinationPageData: routeData.ESTIMATE, destinationPageData: routeData.ESTIMATE,
}, },
{
scenario: navigationScenarios.BAILOUT,
destinationPageData: routeData.BAILOUT,
},
], ],
}, },
{ {
@ -824,7 +833,7 @@ const routingTable = function () {
maps: [ maps: [
{ {
scenario: navigationScenarios.CLICKED_BACK_TO_HOMEPAGE, scenario: navigationScenarios.CLICKED_BACK_TO_HOMEPAGE,
destinationPageData: routeData.RESTART, destinationPageData: FUNNEL_START_PAGE,
}, },
], ],
}, },

View file

@ -76,14 +76,27 @@ 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) { const submittedState = window.sessionStorage.getItem(
const exceptionPages = [FUNNEL_START_PAGE.name, routeData.CONFIRMATION.name]; sessionStorageKeyConstants.SUBMITTED_STATE
);
if (submittedState !== null) {
const isBailout = getIsBailout(submittedState);
const exceptionPages = isBailout
? [FUNNEL_START_PAGE.name, routeData.BAILOUT_SUCCESS.name]
: [FUNNEL_START_PAGE.name, routeData.CONFIRMATION.name];
if (!exceptionPages.some((name) => to.name === name) && !isVirtualRoute(to.name)) { if (!exceptionPages.some((name) => to.name === name) && !isVirtualRoute(to.name)) {
router.push({ if (isBailout) {
name: routeData.CONFIRMATION.name, router.push({
}); name: routeData.BAILOUT_SUCCESS.name,
return false; });
return false;
} else {
router.push({
name: routeData.CONFIRMATION.name,
});
return false;
}
} }
} }
@ -142,3 +155,8 @@ export async function beforeEach(to, from) {
return; return;
} }
} }
function getIsBailout(submittedState) {
const submittedStateObj = JSON.parse(submittedState);
return !!submittedStateObj?.applicationUser?.bailoutCode;
}

View file

@ -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 });
}
} }
} }

View file

@ -1949,21 +1949,21 @@ export const actions = {
pageNameToLog: pageNameToLog, pageNameToLog: pageNameToLog,
}) })
.catch((error) => { .catch((error) => {
if (error.status == 500) { // if (error.status == 500) {
return { PartsNotFound: true }; // return { PartsNotFound: true };
} // }
}); });
// Triggers bailout // Triggers bailout
if (response.PartsNotFound) { // if (response.PartsNotFound) {
return response; // return response;
} // }
// Check if we only have MISC parts to trigger bailout // Check if we only have MISC parts to trigger bailout
const miscPartsResponse = checkIfMiscParts(response.data.partsOrQuestions); // const miscPartsResponse = checkIfMiscParts(response.data.partsOrQuestions);
if (miscPartsResponse.PartsNotFound) { // if (miscPartsResponse.PartsNotFound) {
return miscPartsResponse; // return miscPartsResponse;
} // }
// Flatten location and name properties // Flatten location and name properties
response.data.partsOrQuestions = convertGlassPieceNamingFromApi( response.data.partsOrQuestions = convertGlassPieceNamingFromApi(