CASH-2747: New bailout code for part not found
This commit is contained in:
parent
5220ce900f
commit
4de0ce5d62
5 changed files with 18 additions and 18 deletions
|
|
@ -1,5 +1,5 @@
|
|||
const bailoutCodes = {
|
||||
PARTS_NOT_FOUND: 10,
|
||||
PART_NOT_FOUND: 18,
|
||||
};
|
||||
|
||||
export { bailoutCodes };
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ export default {
|
|||
computed: {
|
||||
getSubHeaderWidget() {
|
||||
switch (this.bailoutCode) {
|
||||
case bailoutCodes.PARTS_NOT_FOUND:
|
||||
case bailoutCodes.PART_NOT_FOUND:
|
||||
return "PartsNotFoundSubHeaderWidget";
|
||||
default:
|
||||
return "FunnelSubHeaderWidget";
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ describe("bailout-mixin.js", () => {
|
|||
test("navigateToBailoutPage: dispatches SAVE_BAILOUT_CODE action with bailout code", async () => {
|
||||
// Arrange
|
||||
const mockVm = createMockVm();
|
||||
const bailoutCode = bailoutCodes.PARTS_NOT_FOUND;
|
||||
const bailoutCode = bailoutCodes.PART_NOT_FOUND;
|
||||
|
||||
// Act
|
||||
await bailoutMixin.methods.navigateToBailoutPage(mockVm, bailoutCode);
|
||||
|
|
@ -22,7 +22,7 @@ describe("bailout-mixin.js", () => {
|
|||
test("navigateToBailoutPage: navigates to bailout page after saving bailout code", async () => {
|
||||
// Arrange
|
||||
const mockVm = createMockVm();
|
||||
const bailoutCode = bailoutCodes.PARTS_NOT_FOUND;
|
||||
const bailoutCode = bailoutCodes.PART_NOT_FOUND;
|
||||
|
||||
// Act
|
||||
await bailoutMixin.methods.navigateToBailoutPage(mockVm, bailoutCode);
|
||||
|
|
@ -46,7 +46,7 @@ describe("bailout-mixin.js", () => {
|
|||
pageName: "test-page",
|
||||
};
|
||||
|
||||
const bailoutCode = bailoutCodes.PARTS_NOT_FOUND;
|
||||
const bailoutCode = bailoutCodes.PART_NOT_FOUND;
|
||||
|
||||
// Act
|
||||
await bailoutMixin.methods.navigateToBailoutPage.call(mockThis, undefined, bailoutCode);
|
||||
|
|
@ -78,7 +78,7 @@ describe("bailout-mixin.js", () => {
|
|||
const mockVm = createMockVm();
|
||||
const mockPageName = "vehicle-damage";
|
||||
mockVm.pageName = mockPageName;
|
||||
const bailoutCode = bailoutCodes.PARTS_NOT_FOUND;
|
||||
const bailoutCode = bailoutCodes.PART_NOT_FOUND;
|
||||
|
||||
// Act
|
||||
await bailoutMixin.methods.navigateToBailoutPage(mockVm, bailoutCode);
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ export default {
|
|||
pageNameToLog: pageName,
|
||||
});
|
||||
|
||||
if (result.PartsNotFound) {
|
||||
bailoutMixin.methods.navigateToBailoutPage(this, bailoutCodes.PARTS_NOT_FOUND);
|
||||
if (result.PartNotFound) {
|
||||
bailoutMixin.methods.navigateToBailoutPage(this, bailoutCodes.PART_NOT_FOUND);
|
||||
}
|
||||
|
||||
const partsOrQuestions = result.data.partsOrQuestions;
|
||||
|
|
|
|||
|
|
@ -1949,21 +1949,21 @@ export const actions = {
|
|||
pageNameToLog: pageNameToLog,
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.status == 500) {
|
||||
return { PartsNotFound: true };
|
||||
}
|
||||
// if (error.status == 500) {
|
||||
// return { PartNotFound: true };
|
||||
// }
|
||||
});
|
||||
|
||||
// Triggers bailout
|
||||
if (response.PartsNotFound) {
|
||||
return response;
|
||||
}
|
||||
// if (response.PartNotFound) {
|
||||
// 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.PartNotFound) {
|
||||
// return miscPartsResponse;
|
||||
// }
|
||||
|
||||
// Flatten location and name properties
|
||||
response.data.partsOrQuestions = convertGlassPieceNamingFromApi(
|
||||
|
|
|
|||
Loading…
Reference in a new issue