Преглед изворни кода

:wrench: rendering Aspects component

tags/0.0.3^2
juancarbajal98 пре 3 година
родитељ
комит
c383dee01d
2 измењених фајлова са 15 додато и 0 уклоњено
  1. 1
    0
      frontend/src/utils/survey.js
  2. 14
    0
      frontend/src/views/OnboardingView.vue

+ 1
- 0
frontend/src/utils/survey.js Прегледај датотеку

@@ -16,6 +16,7 @@ const promptToComponent = {
16 16
     distance: 'FormInput',
17 17
     zipcode: 'FormInput',
18 18
     blurb: 'FormInput',
19
+    aspects: 'Aspects'
19 20
 }
20 21
 /**
21 22
  * Make a step from match or step information

+ 14
- 0
frontend/src/views/OnboardingView.vue Прегледај датотеку

@@ -46,8 +46,22 @@ export default {
46 46
     }),
47 47
     async created() {
48 48
         this.survey = await surveyFactory.createSurvey(allSteps['usa'])
49
+        this.configureAspectStep()
49 50
     },
50 51
     methods: {
52
+        configureAspectStep(){
53
+            // remove all steps regarding aspects
54
+            this.survey.steps = this.survey.steps.slice(0,this.survey.steps.length-6)
55
+            // insert single step to render Aspects component
56
+            this.survey.steps.push({
57
+                response_key_id:1,
58
+                response_key_category:"profile",
59
+                response_key_prompt:"aspects",
60
+                response_key_description:"",
61
+                responses:[],
62
+                component:"Aspects"
63
+            })
64
+        },
51 65
         onSubmit() {
52 66
             console.log(JSON.stringify(this.answered))
53 67
         },

Loading…
Откажи
Сачувај