Quellcode durchsuchen

:twisted_rightwards_arrows: Merged survey_complete into incorp_login

brian_dev_incorp_login
tomit4 vor 2 Jahren
Ursprung
Commit
335da1ee34

+ 44
- 8
backend/db/data-generator/mock.js Datei anzeigen

425
             tag_id: 7,
425
             tag_id: 7,
426
             is_deleted: false,
426
             is_deleted: false,
427
         },
427
         },
428
+        // NOTE: profile_id 147 is chosen based off of GENERATED data,
429
+        // after running 'npm run generate', replace 147 in mock to next profile_id to be genearted
430
+        // i.e. last profile_id number + 1
431
+        // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
432
+        {
433
+            tag_association_id: 50,
434
+            profile_id: 136,
435
+            grouping_id: 2,
436
+            tag_id: 7,
437
+            is_deleted: false,
438
+        },
428
     ],
439
     ],
429
     response_keys: [
440
     response_keys: [
430
         {
441
         {
671
             can_edit: false,
682
             can_edit: false,
672
             is_active: true,
683
             is_active: true,
673
         },
684
         },
685
+        // NOTE: profile_id 147 is chosen based off of GENERATED data,
686
+        // after running 'npm run generate', replace 147 in mock to next profile_id to be genearted
687
+        // i.e. last profile_id number + 1
688
+        // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
689
+        {
690
+            membership_id: 3,
691
+            profile_id: 147,
692
+            grouping_id: 2,
693
+            membership_type: 'participant',
694
+            can_edit: false,
695
+            is_active: true,
696
+        },
697
+        {
698
+            membership_id: 4,
699
+            profile_id: 46,
700
+            grouping_id: 2,
701
+            membership_type: 'participant',
702
+            can_edit: false,
703
+            is_active: true,
704
+        },
674
     ],
705
     ],
675
     groupings: [
706
     groupings: [
676
         {
707
         {
678
             grouping_name: '1663285820.067_41_46',
709
             grouping_name: '1663285820.067_41_46',
679
             grouping_type: 'match',
710
             grouping_type: 'match',
680
         },
711
         },
712
+        {
713
+            grouping_id: 2,
714
+            grouping_name: '1663285820.067_147_46',
715
+            grouping_type: 'match',
716
+        },
681
     ],
717
     ],
682
     messages: [],
718
     messages: [],
683
     match_queues: [
719
     match_queues: [
732
             target_id: 46,
768
             target_id: 46,
733
             is_deleted: false,
769
             is_deleted: false,
734
         },
770
         },
735
-        // NOTE: profile_id 139 is chosen based off of GENERATED data,
736
-        // after running 'npm run generate', replace 139 in mock to next profile_id to be genearted
771
+        // NOTE: profile_id 147 is chosen based off of GENERATED data,
772
+        // after running 'npm run generate', replace 147 in mock to next profile_id to be generated
737
         // i.e. last profile_id number + 1
773
         // i.e. last profile_id number + 1
738
         // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
774
         // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
739
         {
775
         {
740
             match_queue_id: 17,
776
             match_queue_id: 17,
741
-            profile_id: 139,
777
+            profile_id: 147,
742
             target_id: 46,
778
             target_id: 46,
743
             is_deleted: false,
779
             is_deleted: false,
744
         },
780
         },
745
         {
781
         {
746
             match_queue_id: 18,
782
             match_queue_id: 18,
747
-            profile_id: 139,
783
+            profile_id: 147,
748
             target_id: 46,
784
             target_id: 46,
749
             is_deleted: false,
785
             is_deleted: false,
750
         },
786
         },
751
         {
787
         {
752
             match_queue_id: 19,
788
             match_queue_id: 19,
753
-            profile_id: 139,
789
+            profile_id: 147,
754
             target_id: 44,
790
             target_id: 44,
755
             is_deleted: false,
791
             is_deleted: false,
756
         },
792
         },
757
         {
793
         {
758
             match_queue_id: 20,
794
             match_queue_id: 20,
759
-            profile_id: 139,
795
+            profile_id: 147,
760
             target_id: 43,
796
             target_id: 43,
761
             is_deleted: false,
797
             is_deleted: false,
762
         },
798
         },
763
         {
799
         {
764
             match_queue_id: 21,
800
             match_queue_id: 21,
765
-            profile_id: 139,
801
+            profile_id: 147,
766
             target_id: 42,
802
             target_id: 42,
767
             is_deleted: false,
803
             is_deleted: false,
768
         },
804
         },
769
         {
805
         {
770
             match_queue_id: 22,
806
             match_queue_id: 22,
771
-            profile_id: 139,
807
+            profile_id: 147,
772
             target_id: 41,
808
             target_id: 41,
773
             is_deleted: false,
809
             is_deleted: false,
774
         },
810
         },

+ 1
- 2
frontend/src/router/guards.js Datei anzeigen

47
     ) {
47
     ) {
48
         await currentProfile.login(
48
         await currentProfile.login(
49
             sessionData.profileId,
49
             sessionData.profileId,
50
-            // NOTE: probably not correct...
51
-            WaveUI.notify,
50
+            WaveUI.instance.notify,
52
             sessionData.accessToken,
51
             sessionData.accessToken,
53
         )
52
         )
54
     }
53
     }

+ 13
- 10
frontend/src/views/OnboardingView.vue Datei anzeigen

62
         hashedAccessToken = this.grabStoredCookie('siimee_access')
62
         hashedAccessToken = this.grabStoredCookie('siimee_access')
63
         try {
63
         try {
64
             const sessionData = await this.verifySession(hashedAccessToken)
64
             const sessionData = await this.verifySession(hashedAccessToken)
65
-            await currentProfile.login(
66
-                sessionData.profileId,
67
-                this.$waveui.notify,
68
-                sessionData.accessToken,
69
-            )
70
-            this.responses = this.formatResponses(
71
-                currentProfile._profile.responses,
72
-            )
73
-            this.currentStep = this.responses.length + 3
74
-            this.goToStep(this.currentStep)
65
+            if (sessionData) {
66
+                await currentProfile.login(
67
+                    sessionData.profileId,
68
+                    this.$waveui.notify,
69
+                    sessionData.accessToken,
70
+                )
71
+                this.responses = this.formatResponses(
72
+                    currentProfile._profile.responses,
73
+                )
74
+                this.currentStep = this.responses.length + 3
75
+                this.goToStep(this.currentStep)
76
+            }
75
         } catch (err) {
77
         } catch (err) {
76
             console.error('ERROR :=>', err)
78
             console.error('ERROR :=>', err)
77
             this.goToStep(0)
79
             this.goToStep(0)
139
                     this.responses[this.responses.length - 1],
141
                     this.responses[this.responses.length - 1],
140
                     currentProfile._profile.profile_id,
142
                     currentProfile._profile.profile_id,
141
                 )
143
                 )
144
+                currentProfile._profile.responses = this.responses
142
                 try {
145
                 try {
143
                     await this.verifySession(hashedAccessToken)
146
                     await this.verifySession(hashedAccessToken)
144
                 } catch (err) {
147
                 } catch (err) {

+ 14
- 3
frontend/src/views/SurveyCompleteView.vue Datei anzeigen

14
             p {{ aspectResponse.response }}
14
             p {{ aspectResponse.response }}
15
             br
15
             br
16
         br
16
         br
17
-        w-button.ma1(@click="changeAnswers") Change Answers
17
+        // TODO: Bring user to another View.vue page that allows 
18
+        // them to change their answers to the survey
19
+        // OR render radio buttons next to the questions/answers above,
20
+        // allowing them to return to ONLY that specific survey step 
21
+        // using this.$emit('somefunc') back up to OnboardingView.vue
22
+        // Toggling a boolean flag that prevents "SUBMIT" from goToStep(), 
23
+        // and instead brings them back here...
24
+        // 
25
+        // w-button.ma1(@click="changeAnswers") Change Answers
18
 </template>
26
 </template>
19
 
27
 
20
 <script>
28
 <script>
33
         aspectResponses: [],
41
         aspectResponses: [],
34
     }),
42
     }),
35
     created() {
43
     created() {
36
-        // TODO: Troubleshoot bug where not all responses are returned
37
-        console.log('currentProfile :=>', currentProfile)
38
         this.parseSurvey(this.surveySteps)
44
         this.parseSurvey(this.surveySteps)
39
         this.aspectResponses = this.grabAspectResponses(
45
         this.aspectResponses = this.grabAspectResponses(
40
             currentProfile._profile.responses,
46
             currentProfile._profile.responses,
59
                 }
65
                 }
60
             })
66
             })
61
         },
67
         },
68
+<<<<<<< HEAD
69
+=======
70
+        // Grabs all responses to questions that are NOT aspect questions
71
+>>>>>>> brian_dev_survey_complete
62
         grabResponsesFromProfile(aspectQuestions) {
72
         grabResponsesFromProfile(aspectQuestions) {
63
             const aspectQuestionsKeys = Object.keys(aspectQuestions).map(Number)
73
             const aspectQuestionsKeys = Object.keys(aspectQuestions).map(Number)
64
             const responses = currentProfile._profile.responses
74
             const responses = currentProfile._profile.responses
98
                     return typeof res === 'object'
108
                     return typeof res === 'object'
99
                 })
109
                 })
100
         },
110
         },
111
+        // changeAnswers() {},
101
     },
112
     },
102
 }
113
 }
103
 </script>
114
 </script>

Laden…
Abbrechen
Speichern