CSR-803: refactoring for readability

This commit is contained in:
Adam Caouette 2022-12-09 10:03:57 -05:00
parent 8ce4ce15c7
commit 326429657c

View file

@ -472,16 +472,17 @@ export default {
fmgPageValues.PART_QUESTIONS
);
const currentPartsOrQuestions = (
(currentPage !== fmgPageValues.CAPABILITY_QUESTIONS
? pageDataCapabilityQuestions
: null) ??
(currentPage !== fmgPageValues.MOLDING_QUESTIONS
? pageDataMoldingQuestions
: null) ??
(currentPage !== fmgPageValues.VEHICLE_PARTS ? pageDataVehicleParts : null) ??
(currentPage !== fmgPageValues.PARTS_QUESTIONS ? pageDataPartQuestions : null)
)?.partsOrQuestions;
let currentPartsOrQuestions = null;
if (currentPage !== fmgPageValues.CAPABILITY_QUESTIONS && !!pageDataCapabilityQuestions) {
currentPartsOrQuestions = pageDataCapabilityQuestions?.partsOrQuestions;
} else if (currentPage !== fmgPageValues.MOLDING_QUESTIONS && !!pageDataMoldingQuestions) {
currentPartsOrQuestions = pageDataMoldingQuestions?.partsOrQuestions;
} else if (currentPage !== fmgPageValues.VEHICLE_PARTS && !!pageDataVehicleParts) {
currentPartsOrQuestions = pageDataVehicleParts?.partsOrQuestions;
} else if (currentPage !== fmgPageValues.PARTS_QUESTIONS && !!pageDataPartQuestions) {
currentPartsOrQuestions = pageDataPartQuestions?.partsOrQuestions;
}
const hasPartQuestions = this.hasPartQuestions(currentPartsOrQuestions);
const hasGlassLocationWithMultipleParts =