Merge pull request #3183 from Safelite/rlsmerge/2026.05.21-to-develop
Rlsmerge/2026.05.21 to develop
This commit is contained in:
commit
44811f883a
7 changed files with 81 additions and 25 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);
|
||||
|
||||
|
|
@ -67,10 +73,11 @@ export default {
|
|||
},
|
||||
arePagePrerequisitesValid() {
|
||||
return (
|
||||
store.getters.order.customer.firstName &&
|
||||
store.getters.order.customer.lastName &&
|
||||
store.getters.order.customer.emailAddress &&
|
||||
store.getters.order.customer.phoneNumber
|
||||
(store.getters.order.customer.firstName &&
|
||||
store.getters.order.customer.lastName &&
|
||||
store.getters.order.customer.emailAddress &&
|
||||
store.getters.order.customer.phoneNumber) ||
|
||||
baseMixin.methods.hasSubmittedOrder()
|
||||
);
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -36,9 +36,21 @@ describe("bailout.vue", () => {
|
|||
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 () => {
|
||||
//Arrange
|
||||
const { wrapper } = setupMocks();
|
||||
wrapper.vm.getBailoutCodeFromStore = jest.fn().mockReturnValue("BAILOUT_CODE");
|
||||
|
||||
//Act
|
||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
validationRules="phone-number-required" />
|
||||
|
||||
<textboxQuestion
|
||||
isRequired
|
||||
v-if="!serviceZipCode"
|
||||
class="mb-4"
|
||||
cmsWidgetName="ServiceZipQuestionWidget"
|
||||
v-model="serviceZipCode"
|
||||
|
|
@ -242,7 +244,7 @@ export default {
|
|||
}
|
||||
},
|
||||
arePagePrerequisitesValid() {
|
||||
return true;
|
||||
return this.getBailoutCodeFromStore() !== null;
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { routeData } from "@/router/constants/routes";
|
||||
import { navigationScenarios } from "@/router/constants/navigation-scenarios";
|
||||
import { FUNNEL_START_PAGE } from "@/router/constants/routes";
|
||||
import store from "@/store";
|
||||
import { paymentMethods } from "@/constants/payment-method-constants";
|
||||
|
||||
|
|
@ -88,6 +89,10 @@ const routingTable = function () {
|
|||
scenario: navigationScenarios.CLICKED_VIN_RETRY,
|
||||
destinationPageData: routeData.ESTIMATE,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.BAILOUT,
|
||||
destinationPageData: routeData.BAILOUT,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -128,6 +133,10 @@ const routingTable = function () {
|
|||
scenario: navigationScenarios.CLICKED_VIN_RETRY,
|
||||
destinationPageData: routeData.ESTIMATE,
|
||||
},
|
||||
{
|
||||
scenario: navigationScenarios.BAILOUT,
|
||||
destinationPageData: routeData.BAILOUT,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
@ -824,7 +833,7 @@ const routingTable = function () {
|
|||
maps: [
|
||||
{
|
||||
scenario: navigationScenarios.CLICKED_BACK_TO_HOMEPAGE,
|
||||
destinationPageData: routeData.RESTART,
|
||||
destinationPageData: FUNNEL_START_PAGE,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
|||
|
|
@ -76,14 +76,27 @@ 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 submittedState = window.sessionStorage.getItem(
|
||||
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)) {
|
||||
router.push({
|
||||
name: routeData.CONFIRMATION.name,
|
||||
});
|
||||
return false;
|
||||
if (isBailout) {
|
||||
router.push({
|
||||
name: routeData.BAILOUT_SUCCESS.name,
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
router.push({
|
||||
name: routeData.CONFIRMATION.name,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -142,3 +155,8 @@ export async function beforeEach(to, from) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function getIsBailout(submittedState) {
|
||||
const submittedStateObj = JSON.parse(submittedState);
|
||||
return !!submittedStateObj?.applicationUser?.bailoutCode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1949,21 +1949,21 @@ export const actions = {
|
|||
pageNameToLog: pageNameToLog,
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.status == 500) {
|
||||
return { PartsNotFound: true };
|
||||
}
|
||||
// if (error.status == 500) {
|
||||
// return { PartsNotFound: true };
|
||||
// }
|
||||
});
|
||||
|
||||
// Triggers bailout
|
||||
if (response.PartsNotFound) {
|
||||
return response;
|
||||
}
|
||||
// if (response.PartsNotFound) {
|
||||
// return response;
|
||||
// }
|
||||
|
||||
// Check if we only have MISC parts to trigger bailout
|
||||
const miscPartsResponse = checkIfMiscParts(response.data.partsOrQuestions);
|
||||
if (miscPartsResponse.PartsNotFound) {
|
||||
return miscPartsResponse;
|
||||
}
|
||||
// const miscPartsResponse = checkIfMiscParts(response.data.partsOrQuestions);
|
||||
// if (miscPartsResponse.PartsNotFound) {
|
||||
// return miscPartsResponse;
|
||||
// }
|
||||
|
||||
// Flatten location and name properties
|
||||
response.data.partsOrQuestions = convertGlassPieceNamingFromApi(
|
||||
|
|
|
|||
Loading…
Reference in a new issue