Browse Source

:twisted_rightwards_arrows: Merged survey_complete into incorp_login

brian_dev_incorp_login
tomit4 2 years ago
parent
commit
335da1ee34

+ 44
- 8
backend/db/data-generator/mock.js View File

@@ -425,6 +425,17 @@ module.exports = {
425 425
             tag_id: 7,
426 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 440
     response_keys: [
430 441
         {
@@ -671,6 +682,26 @@ module.exports = {
671 682
             can_edit: false,
672 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 706
     groupings: [
676 707
         {
@@ -678,6 +709,11 @@ module.exports = {
678 709
             grouping_name: '1663285820.067_41_46',
679 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 718
     messages: [],
683 719
     match_queues: [
@@ -732,43 +768,43 @@ module.exports = {
732 768
             target_id: 46,
733 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 773
         // i.e. last profile_id number + 1
738 774
         // TODO: remove from mock data once bare bones matching logic can show poorly matched matches...
739 775
         {
740 776
             match_queue_id: 17,
741
-            profile_id: 139,
777
+            profile_id: 147,
742 778
             target_id: 46,
743 779
             is_deleted: false,
744 780
         },
745 781
         {
746 782
             match_queue_id: 18,
747
-            profile_id: 139,
783
+            profile_id: 147,
748 784
             target_id: 46,
749 785
             is_deleted: false,
750 786
         },
751 787
         {
752 788
             match_queue_id: 19,
753
-            profile_id: 139,
789
+            profile_id: 147,
754 790
             target_id: 44,
755 791
             is_deleted: false,
756 792
         },
757 793
         {
758 794
             match_queue_id: 20,
759
-            profile_id: 139,
795
+            profile_id: 147,
760 796
             target_id: 43,
761 797
             is_deleted: false,
762 798
         },
763 799
         {
764 800
             match_queue_id: 21,
765
-            profile_id: 139,
801
+            profile_id: 147,
766 802
             target_id: 42,
767 803
             is_deleted: false,
768 804
         },
769 805
         {
770 806
             match_queue_id: 22,
771
-            profile_id: 139,
807
+            profile_id: 147,
772 808
             target_id: 41,
773 809
             is_deleted: false,
774 810
         },

+ 1
- 2
frontend/src/router/guards.js View File

@@ -47,8 +47,7 @@ const loginIfToken = async () => {
47 47
     ) {
48 48
         await currentProfile.login(
49 49
             sessionData.profileId,
50
-            // NOTE: probably not correct...
51
-            WaveUI.notify,
50
+            WaveUI.instance.notify,
52 51
             sessionData.accessToken,
53 52
         )
54 53
     }

+ 13
- 10
frontend/src/views/OnboardingView.vue View File

@@ -62,16 +62,18 @@ export default {
62 62
         hashedAccessToken = this.grabStoredCookie('siimee_access')
63 63
         try {
64 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 77
         } catch (err) {
76 78
             console.error('ERROR :=>', err)
77 79
             this.goToStep(0)
@@ -139,6 +141,7 @@ export default {
139 141
                     this.responses[this.responses.length - 1],
140 142
                     currentProfile._profile.profile_id,
141 143
                 )
144
+                currentProfile._profile.responses = this.responses
142 145
                 try {
143 146
                     await this.verifySession(hashedAccessToken)
144 147
                 } catch (err) {

+ 14
- 3
frontend/src/views/SurveyCompleteView.vue View File

@@ -14,7 +14,15 @@ main.view--surveycomplete
14 14
             p {{ aspectResponse.response }}
15 15
             br
16 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 26
 </template>
19 27
 
20 28
 <script>
@@ -33,8 +41,6 @@ export default {
33 41
         aspectResponses: [],
34 42
     }),
35 43
     created() {
36
-        // TODO: Troubleshoot bug where not all responses are returned
37
-        console.log('currentProfile :=>', currentProfile)
38 44
         this.parseSurvey(this.surveySteps)
39 45
         this.aspectResponses = this.grabAspectResponses(
40 46
             currentProfile._profile.responses,
@@ -59,6 +65,10 @@ export default {
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 72
         grabResponsesFromProfile(aspectQuestions) {
63 73
             const aspectQuestionsKeys = Object.keys(aspectQuestions).map(Number)
64 74
             const responses = currentProfile._profile.responses
@@ -98,6 +108,7 @@ export default {
98 108
                     return typeof res === 'object'
99 109
                 })
100 110
         },
111
+        // changeAnswers() {},
101 112
     },
102 113
 }
103 114
 </script>

Loading…
Cancel
Save