diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 7e4542a13..6c0c56dad 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -90,104 +90,8 @@ export default { } else if (hasCapabilityQuestions && this.currentPageComesBeforePage(currentPage, fmgPageValues.CAPABILITY_QUESTIONS)) { // if has capability questions // go to capability-questions page and pass the partsData - partsOrQuestions = [ - { - "glassName": "Single", - "glassLocation": "Windshield", - "parts": [ - { - "partNumber": "A", - "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor", - "color": "Green Tint, Blue Shade", - "requiresRecalibration": true, - "requiresCapabilityQuestions": true, - "recalibrationType": null, - "childParts": null, - "childPartQuestions": [] - } - ], - "partQuestions": null, - "capabilityQuestions": [ - { - "questionSequence": 1, - "questionText": "Is this the first question?", - "answers": [ - { - "answerResult1": "DYNAMIC", - "answerResult2": "1", - "answerText": "Yes", - "nextQuestionSequence": null, - "answerResult": "DYNAMIC" - }, - { - "answerResult1": "Unknown", - "answerResult2": "0", - "answerText": "No", - "nextQuestionSequence": null, - "answerResult": "Unknown" - } - ] - } - ] - }, - { - "glassName": "Front", - "glassLocation": "Driver", - "parts": [ - { - "partNumber": "B", - "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor", - "color": "Green Tint, Blue Shade", - "requiresRecalibration": true, - "requiresCapabilityQuestions": true, - "recalibrationType": null, - "childParts": null, - "childPartQuestions": [] - } - ], - "partQuestions": null, - "capabilityQuestions": [ - { - "questionSequence": 1, - "questionText": "Is this the second question?", - "answers": [ - { - "answerResult1": "Oh yeah", - "answerResult2": "1", - "answerText": "Yes", - "nextQuestionSequence": null, - "answerResult": "Oh yeah" - }, - { - "answerResult1": "Maybe", - "answerResult2": "0", - "answerText": "No", - "nextQuestionSequence": null, - "answerResult": "Maybe" - } - ] - } - ] - }, - { - "glassName": "Rear", - "glassLocation": "Driver", - "parts": [ - { - "partNumber": "C", - "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor", - "color": "Green Tint, Blue Shade", - "requiresRecalibration": true, - "requiresCapabilityQuestions": false, - "recalibrationType": null, - "childParts": null, - "childPartQuestions": [] - } - ], - "partQuestions": null - } - ] + // mimic part-questions page data for consistency for (let partOrQuestion of partsOrQuestions) { if (this.hasCapabilityQuestions([partOrQuestion])) { let capabilityQuestionsForGlassLocation = (await baseMixin.methods.dispatchStoreAction(storeActions.GET_CAPABILITY_QUESTIONS, { @@ -208,111 +112,6 @@ export default { } } - partsOrQuestions = [ - { - "glassName": "Single", - "glassLocation": "Windshield", - "parts": [ - { - "partNumber": "A", - "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor", - "color": "Green Tint, Blue Shade", - "requiresRecalibration": true, - "requiresCapabilityQuestions": true, - "recalibrationType": null, - "childParts": null, - "childPartQuestions": [] - } - ], - "partQuestions": null, - "capabilityQuestions": [ - { - "questionSequence": 1, - "questionText": "Is this the first question?", - "answers": [ - { - "answerResult1": "DYNAMIC", - "answerResult2": "1", - "answerText": "Yes", - "nextQuestionSequence": null, - "answerResult": "DYNAMIC" - }, - { - "answerResult1": "Unknown", - "answerResult2": "0", - "answerText": "No", - "nextQuestionSequence": null, - "answerResult": "Unknown" - } - ] - } - ] - }, - { - "glassName": "Front", - "glassLocation": "Driver", - "parts": [ - { - "partNumber": "B", - "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor", - "color": "Green Tint, Blue Shade", - "requiresRecalibration": true, - "requiresCapabilityQuestions": true, - "recalibrationType": null, - "childParts": null, - "childPartQuestions": [] - } - ], - "partQuestions": null, - "capabilityQuestions": [ - { - "questionSequence": 1, - "questionText": "Is this the second question?", - "answers": [ - { - "answerResult1": "Oh yeah", - "answerResult2": "1", - "answerText": "Yes", - "nextQuestionSequence": null, - "answerResult": "Oh yeah" - }, - { - "answerResult1": "Maybe", - "answerResult2": "0", - "answerText": "No", - "nextQuestionSequence": null, - "answerResult": "Maybe" - } - ] - } - ] - }, - { - "glassName": "Rear", - "glassLocation": "Driver", - "parts": [ - { - "partNumber": "C", - "description": "rain sensor, solar, 3rd visor band, soundproofing, high beam sensor", - "color": "Green Tint, Blue Shade", - "requiresRecalibration": true, - "requiresCapabilityQuestions": false, - "recalibrationType": null, - "childParts": null, - "childPartQuestions": [] - } - ], - "partQuestions": null - } - ] - - store.commit(storeMutations.UPDATE_PAGE_DATA, { - page: "capability-questions", - data: [{ - partsOrQuestions: partsOrQuestions - }], - }) - self.$router.navigateWithSaving(self.navigationScenarios.HAS_CAPABILITY_QUESTIONS, self.$route, {}, {}, { partsOrQuestions }); } else { // if single parts only diff --git a/src/router/index.js b/src/router/index.js index 5c4b6ca75..b45e0b403 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -224,7 +224,7 @@ function navigateToUrl(url, optionalQuery = {}) { for (const queryKey in optionalQuery) { externalUrl.searchParams.append(queryKey, optionalQuery[queryKey]); } - + window.location.assign(externalUrl); }