CSR-111 Use pageData instead of glassParts to check if vehicle-parts selections have changed
This commit is contained in:
parent
474df4dea4
commit
e10c585abe
2 changed files with 4 additions and 3 deletions
|
|
@ -122,7 +122,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
backButtonAction() {
|
backButtonAction() {
|
||||||
const partsOrQuestions = this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS)?.partsOrQuestions;
|
const partsOrQuestions = (this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS) ?? this.$store.getters.pageData(fmgPageValues.VEHICLE_PARTS))?.partsOrQuestions;
|
||||||
const hasPartQuestions = this.hasPartQuestions(partsOrQuestions);
|
const hasPartQuestions = this.hasPartQuestions(partsOrQuestions);
|
||||||
const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(partsOrQuestions);
|
const hasGlassLocationWithMultipleParts = this.hasGlassLocationWithMultipleParts(partsOrQuestions);
|
||||||
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
|
const hasChildPartQuestions = this.hasChildPartQuestions(partsOrQuestions);
|
||||||
|
|
|
||||||
|
|
@ -1020,6 +1020,7 @@ export const actions = {
|
||||||
},
|
},
|
||||||
resetMoldingAndCapabilityQuestionAnswersIfNeeded(context, matchedParts) {
|
resetMoldingAndCapabilityQuestionAnswersIfNeeded(context, matchedParts) {
|
||||||
const previousResultsArray = [{ parts: context.getters.lineItems.glassParts }];
|
const previousResultsArray = [{ parts: context.getters.lineItems.glassParts }];
|
||||||
|
const partsOrQuestionsDataToCompareWith = context.getters.pageData(fmgPageValues.MOLDING_QUESTIONS)?.partsOrQuestions ?? context.getters.pageData(fmgPageValues.CAPABILITY_QUESTIONS)?.partsOrQuestions ?? [];
|
||||||
|
|
||||||
function getAllPartNumbers(partsOrQuestions) {
|
function getAllPartNumbers(partsOrQuestions) {
|
||||||
return partsOrQuestions[0].parts
|
return partsOrQuestions[0].parts
|
||||||
|
|
@ -1027,7 +1028,7 @@ export const actions = {
|
||||||
: []
|
: []
|
||||||
}
|
}
|
||||||
|
|
||||||
const previouslySelectedPartNumbers = getAllPartNumbers(previousResultsArray);
|
const previouslySelectedPartNumbers = getAllPartNumbers(partsOrQuestionsDataToCompareWith);
|
||||||
const currentlySelectedPartNumbers = getAllPartNumbers(matchedParts);
|
const currentlySelectedPartNumbers = getAllPartNumbers(matchedParts);
|
||||||
|
|
||||||
const haveSelectedVehiclePartsChanged = previouslySelectedPartNumbers !== currentlySelectedPartNumbers;
|
const haveSelectedVehiclePartsChanged = previouslySelectedPartNumbers !== currentlySelectedPartNumbers;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue