Просмотр исходного кода

:wrench: working aspects answer collection

tags/0.0.3^2
juancarbajal98 3 лет назад
Родитель
Сommit
5acfe5684c

+ 5
- 3
frontend/src/components/onboarding/Aspects.vue Просмотреть файл

@@ -12,7 +12,7 @@
12 12
 </template>
13 13
 <script>
14 14
 import QuestionResponse from './QuestionResponse.vue'
15
-const answered = {}
15
+const answered = [null, null, null, null, null, null]
16 16
 
17 17
 export default {
18 18
     name: 'Aspects',
@@ -33,10 +33,12 @@ export default {
33 33
     },
34 34
     methods: {
35 35
         updateRadio(onRadioSelect) {
36
-            answered[onRadioSelect.id] = onRadioSelect.answer
36
+            answered[onRadioSelect.id-1] = onRadioSelect.answer
37 37
             this.$emit('update-answers', {
38 38
                 key: 'Aspects',
39
-                question: '?',
39
+                question: {
40
+                    response_key_prompt: 'aspects'
41
+                },
40 42
                 answer: answered,
41 43
             })
42 44
         },

+ 5
- 0
frontend/src/components/onboarding/FormInput.vue Просмотреть файл

@@ -20,6 +20,11 @@ export default {
20 20
     }),
21 21
     methods: {
22 22
         handleSubmit() {
23
+            if(this.question.response_key_prompt === 'password') {
24
+                this.$emit('update-answers') // no password collection
25
+                return
26
+            }
27
+
23 28
             let payload = {
24 29
                 question: this.question,
25 30
                 answer: this.input,

+ 1
- 2
frontend/src/components/onboarding/QuestionResponse.vue Просмотреть файл

@@ -27,8 +27,7 @@ export default {
27 27
     }),
28 28
     methods: {
29 29
         onUpdate(e) {
30
-            console.log('event: ', e)
31
-            // this.$emit('updated', { ...this.question, answer: e + 1 })
30
+            this.$emit('updated', { ...this.question, answer: e + 1 })
32 31
         },
33 32
     },
34 33
 }

+ 1
- 0
frontend/src/views/OnboardingView.vue Просмотреть файл

@@ -50,6 +50,7 @@ export default {
50 50
                 this.answered[k] = payload.answer
51 51
                 console.log(`${k}:`, this.answered[k])
52 52
                 console.log(`Updated answers: ${JSON.stringify(this.answered)}`)
53
+                if(k === 'aspects') return
53 54
             }
54 55
             this.goToStep(this.currentStep + 1)
55 56
         },

Загрузка…
Отмена
Сохранить