Pārlūkot izejas kodu

:recycle: Refactor of how chat groupings are rendered

tabs-content
tomit4 3 gadus atpakaļ
vecāks
revīzija
12a8c711a2

+ 7
- 6
backend/db/data-generator/config.json Parādīt failu

@@ -31,10 +31,11 @@
31 31
         "97075"
32 32
     ],
33 33
     "resKeys": [1, 2, 3, 4, 5, 6],
34
-    "zipcodeKey": 7,
35
-    "mediaKey": 8,
36
-    "langKey": 9,
37
-    "blurbKey": 12,
38
-    "prefKeys": [7, 10, 11, 13, 14, 15, 16],
39
-    "maxDistanceKey": 16
34
+    "zipcodeKey": 10,
35
+    "mediaKey": 12,
36
+    "langKey": 13,
37
+    "blurbKey": 16,
38
+    "comment": "Make this match profiler.js complete profile constructor",
39
+    "prefKeys": [10, 14, 15, 17, 18, 19],
40
+    "maxDistanceKey": 19
40 41
 }

+ 0
- 1
backend/lib/services/profile/profiler.js Parādīt failu

@@ -37,7 +37,6 @@ class CompleteProfile {
37 37
                 'duration',
38 38
                 'presence',
39 39
                 'urgency',
40
-                'role',
41 40
                 'pronouns',
42 41
                 'distance',
43 42
             ]

+ 1
- 0
frontend/src/services/grouping.service.js Parādīt failu

@@ -15,6 +15,7 @@ const fetchMembershipsByProfileId = async profileId => {
15 15
         memberships = await db.get(`/membership/${profileId}`)
16 16
         for (let membership of memberships) {
17 17
             const grouping = new Grouping(membership)
18
+            // TODO: look here to see about current reveal issue -bh
18 19
             if (grouping.isValid()) {
19 20
                 // Reformat incoming profile data into Profile entity
20 21
                 grouping.profile = new Profile(grouping.profile)

+ 11
- 3
frontend/src/views/ChatView.vue Parādīt failu

@@ -20,8 +20,8 @@ main.view--chat
20 20
                     ul(v-for="reveal in grouping.revealed[profile.id.value]")
21 21
                         li {{ reveal.description }} : {{ profile._profile[reveal.description] }}
22 22
             p they revealed:
23
-                span(v-if="grouping.revealed[grouping.profile.profile_id]")
24
-                    ul(v-for="reveal in grouping.revealed[grouping.profile.profile_id]")
23
+                span(v-if="theyRevealed")
24
+                    ul(v-for="reveal in theyRevealed")
25 25
                         li {{ reveal.description }} : {{ grouping.profile[reveal.description] }}
26 26
 
27 27
     article
@@ -65,8 +65,16 @@ export default {
65 65
         target: null,
66 66
         toSend: '',
67 67
         messages: [],
68
-        grouping: null,
68
+        grouping: {},
69 69
     }),
70
+    // TODO: Make sure grouping.profile.profile_id actually exists
71
+    computed: {
72
+        theyRevealed() {
73
+            return this.grouping && this.grouping.revealed[this.grouping.profile.profile_id] ?
74
+                this.grouping.revealed[this.grouping.profile.profile_id] :
75
+                []
76
+        }
77
+    },
70 78
     watch: {
71 79
         async profile() {
72 80
             this.loadTargetProfile()

Notiek ielāde…
Atcelt
Saglabāt