Merge pull request #1677 from Safelite/feature/CSR-1610-bugfix-ajc
CSR-1610: another attempt to fix load issue for saved sessions
This commit is contained in:
commit
d39e705d9f
2 changed files with 12 additions and 3 deletions
|
|
@ -265,8 +265,8 @@ describe("Question Chain component", () => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
index: 0,
|
|
||||||
});
|
});
|
||||||
|
await wrapper.setProps({ index: 0 });
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
const result = wrapper.vm.getQuestionChainAnswerIfComplete(testReturnedAnswer);
|
const result = wrapper.vm.getQuestionChainAnswerIfComplete(testReturnedAnswer);
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,13 @@
|
||||||
:isMetaValid="meta.valid"
|
:isMetaValid="meta.valid"
|
||||||
:alertFewMoreQuestionsHeader="AlertFewMoreQuestionsHeader"
|
:alertFewMoreQuestionsHeader="AlertFewMoreQuestionsHeader"
|
||||||
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
:alertFewMoreQuestionsCopy="AlertFewMoreQuestionsCopy"
|
||||||
|
v-if="questionsData"
|
||||||
:questionsData="questionsData"
|
:questionsData="questionsData"
|
||||||
validationRules="questions-required"
|
validationRules="questions-required"
|
||||||
v-model="selectedAnswers"
|
v-model="selectedAnswers"
|
||||||
@forwardButtonAction="forwardButtonAction"
|
@forwardButtonAction="forwardButtonAction"
|
||||||
@back-click="navigateBack"
|
@back-click="navigateBack"
|
||||||
|
:key="currentGlassIndex"
|
||||||
:index="currentGlassIndex" />
|
:index="currentGlassIndex" />
|
||||||
</Form>
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -55,7 +57,7 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
questionsData: [],
|
questionsData: null,
|
||||||
selectedAnswers: {},
|
selectedAnswers: {},
|
||||||
currentGlassIndex: 0,
|
currentGlassIndex: 0,
|
||||||
};
|
};
|
||||||
|
|
@ -71,7 +73,7 @@ export default {
|
||||||
return this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS).partsOrQuestions;
|
return this.$store.getters.pageData(fmgPageValues.PART_QUESTIONS).partsOrQuestions;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
mounted() {
|
||||||
this.getInitialQuestionData();
|
this.getInitialQuestionData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -117,6 +119,13 @@ export default {
|
||||||
|
|
||||||
return updatedGlass;
|
return updatedGlass;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// if no preanswered questions then make sure index starts with the correct value
|
||||||
|
if (this.currentGlassIndex === 0) {
|
||||||
|
this.currentGlassIndex = this.questionsData?.findIndex(
|
||||||
|
(glass) => glass.questions?.length > 0
|
||||||
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
const questionAnswersArray = this.questionsData.map((glass) => {
|
const questionAnswersArray = this.questionsData.map((glass) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue