CSR-111 Map answerResult value for question-chain component
This commit is contained in:
parent
2fd175711a
commit
a2e0d73c11
2 changed files with 19 additions and 6 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-for="(q, i) in questions" :key="i">
|
<div v-for="(q, i) in questions" :key="i">
|
||||||
{{ questions }}<br/>
|
|
||||||
{{q}}
|
|
||||||
<transition appear name="fade" mode="out-in">
|
<transition appear name="fade" mode="out-in">
|
||||||
<buttonQuestion
|
<buttonQuestion
|
||||||
v-if="q.answerSelected || (q.questionSequence === currentQuestionNum)"
|
v-if="q.answerSelected || (q.questionSequence === currentQuestionNum)"
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
<funnelSubHeader cmsWidgetName="FunnelSubHeaderWidget" />
|
||||||
<div class="fade-on-route-transition sub-container make-tall">
|
<div class="fade-on-route-transition sub-container make-tall">
|
||||||
<h1>CAPABILITY QUESTIONS TEMPORARY PLACEHOLDER</h1>
|
<h1>CAPABILITY QUESTIONS TEMPORARY PLACEHOLDER</h1>
|
||||||
|
CQD: {{ capabilityQuestionsData }}
|
||||||
<alert
|
<alert
|
||||||
ref="alertFewMoreQuestions"
|
ref="alertFewMoreQuestions"
|
||||||
class="my-5"
|
class="my-5"
|
||||||
|
|
@ -20,15 +21,15 @@
|
||||||
:manualCopy="AlertFewMoreQuestionsCopy"
|
:manualCopy="AlertFewMoreQuestionsCopy"
|
||||||
v-bind:isDismissible="false"
|
v-bind:isDismissible="false"
|
||||||
/>
|
/>
|
||||||
<div v-for="(question, i) in capabilityQuestionsData" :key="i">
|
<!-- <div v-for="(question, i) in capabilityQuestionsData" :key="i"> -->
|
||||||
<questionChain
|
<questionChain
|
||||||
ref="questionChain"
|
ref="questionChain"
|
||||||
v-model="selectedModel"
|
v-model="selectedModel"
|
||||||
:questionData="question"
|
:questionData="capabilityQuestionsData"
|
||||||
:partIndex="i"
|
:partIndex="i"
|
||||||
validationRules="questions-required"
|
validationRules="questions-required"
|
||||||
/>
|
/>
|
||||||
</div>
|
<!-- </div> -->
|
||||||
<funnel-footer
|
<funnel-footer
|
||||||
ref="funnelFooter"
|
ref="funnelFooter"
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
|
|
@ -61,6 +62,7 @@ import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
import { Form, defineRule } from "vee-validate";
|
import { Form, defineRule } from "vee-validate";
|
||||||
import { required } from "@/helpers/validation-rules";
|
import { required } from "@/helpers/validation-rules";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
|
import { result } from "lodash";
|
||||||
|
|
||||||
// DEFINE VALIDATION RULES
|
// DEFINE VALIDATION RULES
|
||||||
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
defineRule("questions-required", required(errorMessages.OPTION_REQUIRED));
|
||||||
|
|
@ -89,7 +91,20 @@ export default {
|
||||||
// Call the "next" function to complete the transition to this page.
|
// Call the "next" function to complete the transition to this page.
|
||||||
next((vm) => {
|
next((vm) => {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.capabilityQuestionsData = resultMap.capabilityQuestions;
|
|
||||||
|
resultMap.capabilityQuestions.forEach(question => {
|
||||||
|
console.log(question.answers)
|
||||||
|
question.answers = question.answers.map(answer => {
|
||||||
|
return {
|
||||||
|
...answer,
|
||||||
|
answerResult: answer.answerResult1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// question.answers = question.answers
|
||||||
|
})
|
||||||
|
vm.capabilityQuestionsData = {
|
||||||
|
partQuestions: resultMap.capabilityQuestions
|
||||||
|
};
|
||||||
console.log("CQ: ", resultMap.capabilityQuestions)
|
console.log("CQ: ", resultMap.capabilityQuestions)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue