|
|
@@ -35,8 +35,7 @@ export default {
|
|
35
|
35
|
created() {
|
|
36
|
36
|
// TODO: Troubleshoot bug where not all responses are returned
|
|
37
|
37
|
console.log('currentProfile :=>', currentProfile)
|
|
38
|
|
- this.aspectQuestions = this.parseSurvey(this.surveySteps, false)
|
|
39
|
|
- this.surveyStages = this.parseSurvey(this.surveySteps, true)
|
|
|
38
|
+ this.parseSurvey(this.surveySteps)
|
|
40
|
39
|
this.aspectResponses = this.grabAspectResponses(
|
|
41
|
40
|
currentProfile._profile.responses,
|
|
42
|
41
|
this.aspectQuestions,
|
|
|
@@ -48,19 +47,17 @@ export default {
|
|
48
|
47
|
)
|
|
49
|
48
|
},
|
|
50
|
49
|
methods: {
|
|
51
|
|
- parseSurvey(surveySteps, isStage) {
|
|
52
|
|
- const parsedAspects = {}
|
|
53
|
|
- const parsedStages = {}
|
|
|
50
|
+ parseSurvey(surveySteps) {
|
|
54
|
51
|
surveySteps.forEach(step => {
|
|
55
|
52
|
const isAspect = step.category === 'aspect'
|
|
56
|
53
|
if (isAspect) {
|
|
57
|
|
- parsedAspects[`${step.response_key_id}`] =
|
|
|
54
|
+ this.aspectQuestions[`${step.response_key_id}`] =
|
|
58
|
55
|
step.response_key_prompt
|
|
59
|
56
|
} else {
|
|
60
|
|
- parsedStages[`${step.response_key_id}`] = step.survey_stage
|
|
|
57
|
+ this.surveyStages[`${step.response_key_id}`] =
|
|
|
58
|
+ step.survey_stage
|
|
61
|
59
|
}
|
|
62
|
60
|
})
|
|
63
|
|
- return isStage ? parsedStages : parsedAspects
|
|
64
|
61
|
},
|
|
65
|
62
|
grabResponsesFromProfile(aspectQuestions) {
|
|
66
|
63
|
const aspectQuestionsKeys = Object.keys(aspectQuestions).map(Number)
|