Przeglądaj źródła

:pencil2: Fixed merge conflicts

tags/0.0.4
tomit4 2 lat temu
rodzic
commit
01fe3ccba4

+ 1
- 1
frontend/src/router/guards.js Wyświetl plik

51
     } else {
51
     } else {
52
         nextCb()
52
         nextCb()
53
     }
53
     }
54
-        }
54
+}
55
 
55
 
56
 export { checkLoginStatus }
56
 export { checkLoginStatus }

+ 11
- 3
frontend/src/views/OnboardingView.vue Wyświetl plik

29
             p(v-if='currentStep != 0') You have completed: {{ currentStep }} / {{ survey?.steps?.length }} survey steps
29
             p(v-if='currentStep != 0') You have completed: {{ currentStep }} / {{ survey?.steps?.length }} survey steps
30
 
30
 
31
     article(v-else)
31
     article(v-else)
32
-        SurveyCompleteView(:answers='answered' :surveySteps='survey.steps' :responses='responses')
32
+        SurveyCompleteView(
33
+            :answers='answered'
34
+            :responses='responses'
35
+            :surveySteps='survey.steps'
36
+        )
33
 </template>
37
 </template>
34
 
38
 
35
 <script>
39
 <script>
53
         invalidResponse: false,
57
         invalidResponse: false,
54
     }),
58
     }),
55
     async created() {
59
     async created() {
60
+        // TODO: Troubleshoot bug where not all responses are returned at SurveyCompleteView
61
+        console.log('currentProfile :=>', currentProfile)
56
         this.survey = await surveyFactory.createSurvey()
62
         this.survey = await surveyFactory.createSurvey()
57
         try {
63
         try {
58
-            const sessionData =
59
-                await authenticator.verifySessionCookie('siimee_session')
64
+            const sessionData = await authenticator.verifySessionCookie(
65
+                'siimee_session',
66
+            )
60
             if (sessionData) {
67
             if (sessionData) {
61
                 this.responses = this.formatResponses(
68
                 this.responses = this.formatResponses(
62
                     currentProfile._profile.responses,
69
                     currentProfile._profile.responses,
85
             })
92
             })
86
         },
93
         },
87
         async updateAnswers(payload) {
94
         async updateAnswers(payload) {
95
+            console.log('this.survey.steps :=>', this.survey.steps)
88
             if (payload) {
96
             if (payload) {
89
                 const k = payload.question.survey_stage
97
                 const k = payload.question.survey_stage
90
                 this.answered[k] = payload.input
98
                 this.answered[k] = payload.input

+ 14
- 10
frontend/src/views/SurveyCompleteView.vue Wyświetl plik

112
     methods: {
112
     methods: {
113
         changeAnswers(){
113
         changeAnswers(){
114
             console.log('change answers')
114
             console.log('change answers')
115
-            
116
         },
115
         },
117
 
116
 
118
-        async finalSubmit(){
117
+        async finalSubmit() {
119
             // separate user info from responses
118
             // separate user info from responses
120
-            const [user, survey] = this._separateUserInfoFromResponses(this.answers)
119
+            const [user, survey] = this._separateUserInfoFromResponses(
120
+                this.answers,
121
+            )
121
 
122
 
122
             // create user
123
             // create user
123
             const createdUser = await signUpUser(user)
124
             const createdUser = await signUpUser(user)
124
             if (!createdUser) return
125
             if (!createdUser) return
125
 
126
 
126
-            // create profile 
127
-            const userProfile = await createProfileForUserId(createdUser.user_id, survey)
128
-            if(!userProfile) return
127
+            // create profile
128
+            const userProfile = await createProfileForUserId(
129
+                createdUser.user_id,
130
+                survey,
131
+            )
132
+            if (!userProfile) return
129
 
133
 
130
             this._setLoginForProfile(userProfile)
134
             this._setLoginForProfile(userProfile)
131
 
135
 
133
         },
137
         },
134
 
138
 
135
         // TODO write logic to parse answers
139
         // TODO write logic to parse answers
136
-        _separateUserInfoFromResponses(answers){
137
-            return ['','']
140
+        _separateUserInfoFromResponses(answers) {
141
+            return ['', '']
138
         },
142
         },
139
 
143
 
140
-        async _setLoginForProfile(profile){
144
+        async _setLoginForProfile(profile) {
141
             const currentId = currentProfile.login(profile.profile_id)
145
             const currentId = currentProfile.login(profile.profile_id)
142
-            if(currentId && profile.responses.length){
146
+            if (currentId && profile.responses.length) {
143
                 currentProfile.setResponses(profile.responses)
147
                 currentProfile.setResponses(profile.responses)
144
             }
148
             }
145
             if (!currentProfile.isComplete) {
149
             if (!currentProfile.isComplete) {

Ładowanie…
Anuluj
Zapisz