Bläddra i källkod

:wrench: Fixed survey after rebase

tags/0.0.3^2
tomit4 2 år sedan
förälder
incheckning
f530075299
2 ändrade filer med 15 tillägg och 9 borttagningar
  1. 10
    4
      frontend/src/utils/lang.js
  2. 5
    5
      frontend/src/views/OnboardingView.vue

+ 10
- 4
frontend/src/utils/lang.js Visa fil

@@ -29,13 +29,19 @@ const auth = {
29 29
     invalidInputPrompt: null,
30 30
 }
31 31
 
32
+// This has to be in order for survey (DO NOT TOUCH)
33
+const initialSteps = {
34
+    splash: 'splash',
35
+    email: 'email',
36
+    name: 'name',
37
+    seeking: 'seeking',
38
+    password: 'password',
39
+}
40
+
32 41
 // Easily reorder steps of survey here:
33 42
 const allSteps = {
34 43
     usa: {
35
-        splash: 'splash',
36
-        name: 'name',
37
-        seeking: 'seeking',
38
-        password: 'password',
44
+        ...initialSteps,
39 45
         aspect01: 'aspect-1',
40 46
         aspect02: 'aspect-2',
41 47
         aspect03: 'aspect-3',

+ 5
- 5
frontend/src/views/OnboardingView.vue Visa fil

@@ -2,12 +2,12 @@
2 2
 main.view--onboarding
3 3
     article(
4 4
         style='display: flex; flex-direction: column; align-items: center'
5
-        v-if='currentStep !== survey.steps.length'
5
+        v-if='currentStep !== survey?.steps?.length'
6 6
     )
7 7
         .answers(v-for='(value, key) in answered')
8 8
             span(v-if='key == "name" && value && currentStep == 2') Hi {{ value }}!
9 9
         br
10
-        .step(v-for='(step, i) in survey.steps')
10
+        .step(v-for='(step, i) in survey?.steps')
11 11
             component(
12 12
                 :answered='answered'
13 13
                 :currentStep='currentStep'
@@ -15,7 +15,7 @@ main.view--onboarding
15 15
                 :question='step'
16 16
                 :responses='responses'
17 17
                 :survey='survey'
18
-                :surveyStepsCount='survey.steps.length'
18
+                :surveyStepsCount='survey?.steps?.length'
19 19
                 @handle-submit='onSubmit'
20 20
                 @update-answers='updateAnswers'
21 21
                 v-if='step && currentStep == i'
@@ -27,10 +27,10 @@ main.view--onboarding
27 27
             p {{ survey.steps[currentStep].invalidInputPrompt }}
28 28
 
29 29
         footer
30
-            p(v-if='currentStep != 0') You have completed: {{ currentStep }} / {{ survey.steps.length }} survey steps
30
+            p(v-if='currentStep != 0') You have completed: {{ currentStep }} / {{ survey?.steps?.length }} survey steps
31 31
 
32 32
     article(v-else)
33
-        SurveyCompleteView(:answers='answered' :surveySteps='survey.steps')
33
+        SurveyCompleteView(:answers='answered' :surveySteps='survey?.steps')
34 34
 </template>
35 35
 
36 36
 <script>

Laddar…
Avbryt
Spara