Sfoglia il codice sorgente

:recycle: total reorg of survey questions | redid mock data for better detail

tags/0.0.1
J 4 anni fa
parent
commit
9568f38a92

+ 145
- 14
backend/db/data-generator/mock.js Vedi File

@@ -14,6 +14,30 @@ module.exports = {
14 14
             tag_description: 'verified',
15 15
             is_active: true,
16 16
         },
17
+        {
18
+            tag_id: 3,
19
+            tag_category: 'reveal',
20
+            tag_description: 'pronoun',
21
+            is_active: true,
22
+        },
23
+        {
24
+            tag_id: 4,
25
+            tag_category: 'reveal',
26
+            tag_description: 'image',
27
+            is_active: true,
28
+        },
29
+        {
30
+            tag_id: 5,
31
+            tag_category: 'reveal',
32
+            tag_description: 'blurb',
33
+            is_active: true,
34
+        },
35
+        {
36
+            tag_id: 6,
37
+            tag_category: 'reveal',
38
+            tag_description: 'urgency',
39
+            is_active: true,
40
+        },
17 41
     ],
18 42
     tag_associations: [
19 43
         {
@@ -39,54 +63,75 @@ module.exports = {
39 63
         },
40 64
         {
41 65
             tag_association_id: 4,
42
-            profile_id: 5,
66
+            profile_id: 45,
43 67
             membership_id: null,
44 68
             tag_id: 1,
45 69
             is_deleted: false,
46 70
         },
71
+        {
72
+            tag_association_id: 5,
73
+            profile_id: 45,
74
+            membership_id: 1,
75
+            tag_id: 4,
76
+            is_deleted: false,
77
+        },
78
+        {
79
+            tag_association_id: 6,
80
+            profile_id: 45,
81
+            membership_id: 1,
82
+            tag_id: 5,
83
+            is_deleted: false,
84
+        },
85
+        {
86
+            tag_association_id: 7,
87
+            profile_id: 2,
88
+            membership_id: 1,
89
+            tag_id: 5,
90
+            is_deleted: false,
91
+        },
47 92
     ],
48 93
     response_keys: [
49 94
         {
50 95
             response_key_id: 1,
51 96
             response_key_category: 'grit',
52
-            response_key_prompt: 'what is your name',
97
+            response_key_prompt: 'can you power through adversity',
53 98
             response_key_description: null,
54 99
         },
55 100
         {
56 101
             response_key_id: 2,
57 102
             response_key_category: 'openness',
58
-            response_key_prompt: 'what is your favorite color',
103
+            response_key_prompt: 'are you open with your emotions with everyone',
59 104
             response_key_description: null,
60 105
         },
61 106
         {
62 107
             response_key_id: 3,
63 108
             response_key_category: 'bravery',
64
-            response_key_prompt: 'what is your quest',
109
+            response_key_prompt: 'do you speak-up when you feel something is wrong',
65 110
             response_key_description: null,
66 111
         },
67 112
         {
68 113
             response_key_id: 4,
69 114
             response_key_category: 'empathy',
70 115
             response_key_prompt:
71
-                'what is the average flight speed of an unladen swallow',
116
+                'do you stop to help others when they are struggling',
72 117
             response_key_description: null,
73 118
         },
74 119
         {
75 120
             response_key_id: 5,
76 121
             response_key_category: 'honesty',
77
-            response_key_prompt: 'what is your favorite color',
122
+            response_key_prompt: 'when telling a story do you exaggerate for dramatic effect',
78 123
             response_key_description: null,
79 124
         },
80 125
         {
81 126
             response_key_id: 6,
82 127
             response_key_category: 'respect',
83
-            response_key_prompt: 'what kind of schedule are you looking for',
128
+            response_key_prompt: 'do you treat difficult people as well as you treat your close friends',
84 129
             response_key_description: null,
85 130
         },
86 131
         {
87 132
             response_key_id: 7,
88 133
             response_key_category: 'profile',
89
-            response_key_prompt: 'what is your zip code',
134
+            response_key_prompt: 'zipcode',
90 135
             response_key_description: null,
91 136
         },
92 137
         {
@@ -104,13 +149,13 @@ module.exports = {
104 149
         {
105 150
             response_key_id: 10,
106 151
             response_key_category: 'profile',
107
-            response_key_prompt: 'distance',
152
+            response_key_prompt: 'duration',
108 153
             response_key_description: null,
109 154
         },
110 155
         {
111 156
             response_key_id: 11,
112 157
             response_key_category: 'profile',
113
-            response_key_prompt: 'duration',
158
+            response_key_prompt: 'presence',
114 159
             response_key_description: null,
115 160
         },
116 161
         {
@@ -131,10 +176,66 @@ module.exports = {
131 176
             response_key_prompt: 'role',
132 177
             response_key_description: null,
133 178
         },
179
+        {
180
+            response_key_id: 15,
181
+            response_key_category: 'profile',
182
+            response_key_prompt: 'pronouns',
183
+            response_key_description: null,
184
+        },
185
+        {
186
+            response_key_id: 16,
187
+            response_key_category: 'profile',
188
+            response_key_prompt: 'distance',
189
+            response_key_description: null,
190
+        },
134 191
     ],
135 192
     responses: [],
136
-    memberships: [],
137
-    groupings: [],
193
+    memberships: [
194
+        {
195
+            membership_id: 1,
196
+            profile_id: 45,
197
+            grouping_id: 1,
198
+            membership_type: 'participant',
199
+            can_edit: 0,
200
+            is_active: 1,
201
+        },
202
+        {
203
+            membership_id: 2,
204
+            profile_id: 2,
205
+            grouping_id: 1,
206
+            membership_type: 'participant',
207
+            can_edit: 0,
208
+            is_active: 1,
209
+        },
210
+        {
211
+            membership_id: 3,
212
+            profile_id: 45,
213
+            grouping_id: 2,
214
+            membership_type: 'participant',
215
+            can_edit: 0,
216
+            is_active: 1,
217
+        },
218
+        {
219
+            membership_id: 4,
220
+            profile_id: 3,
221
+            grouping_id: 2,
222
+            membership_type: 'participant',
223
+            can_edit: 0,
224
+            is_active: 0,
225
+        }
226
+    ],
227
+    groupings: [
228
+        {
229
+            grouping_id: 1,
230
+            grouping_name: '1654664154.291_45_2',
231
+            grouping_type: 'match',
232
+        },
233
+        {
234
+            grouping_id: 2,
235
+            grouping_name: '1654664154.291_45_3',
236
+            grouping_type: 'match',
237
+        }
238
+    ],
138 239
     messages: [],
139 240
     match_queues: [
140 241
         {
@@ -146,13 +247,43 @@ module.exports = {
146 247
         {
147 248
             match_queue_id: 2,
148 249
             profile_id: 45,
149
-            target_id: 2,
250
+            target_id: 5,
150 251
             is_deleted: false,
151 252
         },
152 253
         {
153 254
             match_queue_id: 3,
154 255
             profile_id: 45,
155
-            target_id: 3,
256
+            target_id: 6,
257
+            is_deleted: false,
258
+        },
259
+        {
260
+            match_queue_id: 4,
261
+            profile_id: 45,
262
+            target_id: 7,
263
+            is_deleted: false,
264
+        },
265
+        {
266
+            match_queue_id: 5,
267
+            profile_id: 45,
268
+            target_id: 8,
269
+            is_deleted: false,
270
+        },
271
+        {
272
+            match_queue_id: 6,
273
+            profile_id: 45,
274
+            target_id: 9,
275
+            is_deleted: false,
276
+        },
277
+        {
278
+            match_queue_id: 7,
279
+            profile_id: 2,
280
+            target_id: 4,
281
+            is_deleted: false,
282
+        },
283
+        {
284
+            match_queue_id: 8,
285
+            profile_id: 2,
286
+            target_id: 10,
156 287
             is_deleted: false,
157 288
         },
158 289
     ],

+ 4
- 2
backend/lib/routes/notification/index.js Vedi File

@@ -27,10 +27,11 @@ module.exports = {
27 27
         auth: false,
28 28
         cors: true,
29 29
         handler: async (request, h) => {
30
+            const { profile_id } = request.params
30 31
             const input = new PassThrough({ objectMode: true })
31 32
             const eventType = 'stonk'
32 33
 
33
-            const msg = { name: 'BDGRS', price: (500 + Math.floor(Math.random() * 100)).toString(), order: null }
34
+            const msg = { profile_id, name: 'BDGRS', price: (500 + Math.floor(Math.random() * 100)).toString(), order: null }
34 35
 
35 36
             // Write to the input stream
36 37
             setInterval(() => {
@@ -40,7 +41,8 @@ module.exports = {
40 41
 
41 42
             // h.event() Added at plugin registration
42 43
             // h is the toolkit
43
-            return h.event(input, h, { event: eventType })
44
+            const streamOptions = { event: `${profile_id}.${eventType}` }
45
+            return h.event(input, h, streamOptions)
44 46
         },
45 47
 
46 48
         /** Validate based on validators object */

+ 1
- 0
backend/lib/services/notification.js Vedi File

@@ -94,6 +94,7 @@ const onEvent = (event, h, streamOptions) => {
94 94
         //     stream = new Transformer(streamOptions, false)
95 95
         //     event.pipe(stream)
96 96
         // }
97
+        console.log('streamOptions :', streamOptions)
97 98
         return h.response(active)
98 99
             .header('content-type', 'text/event-stream')
99 100
             .header('content-encoding', 'identity')

+ 7
- 4
frontend/src/App.vue Vedi File

@@ -42,8 +42,11 @@ export default {
42 42
         */
43 43
         if(DEV_MODE) { this.setPid(DEV_PID) }
44 44
 
45
-        this.setupChatter()
46
-        this.setupToaster()
45
+        if(currentProfile.isLoggedIn()) {
46
+            console.warn(`setting up Chatter and Toaster for ${this.getPid}...`)
47
+            this.setupChatter()
48
+            this.setupToaster()
49
+        }
47 50
         console.log('---')
48 51
     },
49 52
     methods: {
@@ -59,7 +62,7 @@ export default {
59 62
          * For push notifications and chat
60 63
          */
61 64
         setupToaster() {
62
-            const t = new StonkAlert(this.pid)
65
+            const t = new StonkAlert(this.getPid)
63 66
         },
64 67
         setupChatter() {
65 68
             const c = new Chatter()
@@ -80,7 +83,7 @@ html
80 83
     display: flex
81 84
     flex-direction: row
82 85
     text-align: center
83
-    color: $primary
86
+    color: $light
84 87
     font-family: $sans
85 88
     background-color: $secondary
86 89
     overflow-x: hidden

+ 2
- 8
frontend/src/components/ProfileCardList.vue Vedi File

@@ -31,7 +31,7 @@ section.profile_card_list.w-full
31 31
                     :style="{ 'background-image': `url(${profile.avatar})` }"
32 32
                 )
33 33
                 .card__content
34
-                    h3.p-1.mv-0.b-solid.rounded {{ profile.pid  }} {{ profile.name }}
34
+                    button(@click="view(profile.pid)").p-1.mv-0.b-solid.rounded {{ profile.pid  }} {{ profile.name }}
35 35
 </template>
36 36
 
37 37
 <script setup>
@@ -81,7 +81,6 @@ const randomize = max => {
81 81
 // AHP Button behavior
82 82
 
83 83
 const accept = async () => {
84
-    console.log('accepted aka do NOT reinsert')
85 84
     // need to pass these arguments (profileId, targetId, status)
86 85
     // the url structure is
87 86
     // const charmander = await db.get(`/profile/{profile_id}/queue/{target_id}/delete?include_profile=true&reinsert=false`)
@@ -92,19 +91,14 @@ const accept = async () => {
92 91
     // TODO: next step is grouping/membership
93 92
     const checkMembership = await fetchMembershipsByProfileId(profileId)
94 93
     if (!checkMembership.length) {
95
-        console.log('Make membership')
96 94
         postMembershipByProfileId({ profileId, targetId })
97 95
     }
98 96
     emit('reload')
99 97
 }
100 98
 const view = pid => {
101
-    router.push({
102
-        name: 'ProfileView',
103
-        params: { pid },
104
-    })
99
+    router.push({ path: `/matches/${pid}` })
105 100
 }
106 101
 const pass = () => {
107
-    console.log('passed aka do reinsert')
108 102
     // const charmander = await db.get(`/profile/{profile_id}/queue/{target_id}/delete?include_profile=true&reinsert=true`)
109 103
     const profileId = props.pid
110 104
     const targetId = props.profiles[0].pid

+ 5
- 0
frontend/src/router/index.js Vedi File

@@ -25,6 +25,11 @@ const routes = [
25 25
         name: 'MatchesView',
26 26
         meta: { requiresAuth: true, requiresCompleteProfile: true },
27 27
     },
28
+    {
29
+        path: '/matches/:pid',
30
+        component: ProfileView,
31
+        meta: { requiresAuth: true, requiresCompleteProfile: true },
32
+    },
28 33
     {
29 34
         path: `/survey`,
30 35
         component: SurveyView,

+ 6
- 4
frontend/src/services/login.service.js Vedi File

@@ -14,8 +14,8 @@ class Login {
14 14
         // Make reactive with vue observer
15 15
         this.id = ref(null)
16 16
 
17
-        this.matches = []
18 17
         this.responses = []
18
+        this.tags = []
19 19
     }
20 20
     isLoading() {
21 21
         return this._loading
@@ -26,9 +26,6 @@ class Login {
26 26
     isComplete() {
27 27
         return this.responses.length == surveyFactory.questions.length
28 28
     }
29
-    hasMatches() {
30
-        return this.matches.length && this.matches.length > 0
31
-    } 
32 29
     hasResponses() {
33 30
         return this.responses.length && this.responses.length > 0
34 31
     } 
@@ -42,6 +39,11 @@ class Login {
42 39
         return this.id.value
43 40
     }
44 41
     logout() { this.id.value = null }
42
+    
43
+    async getTags() {
44
+        this.tags = []
45
+        return this.tags
46
+    }
45 47
 
46 48
     async getResponses() {
47 49
         try {

+ 1
- 1
frontend/src/services/notification.service.js Vedi File

@@ -24,7 +24,7 @@ class StonkAlert extends Toaster {
24 24
         super(profileId)
25 25
 
26 26
         this.stonks = {}
27
-        this.listenFor('stonk', message => {
27
+        this.listenFor(`${profileId}.stonk`, message => {
28 28
             const parsed = JSON.parse(message.data)
29 29
             this.stonks[parsed.name] = parsed
30 30
             console.log('updated:', this.stonks)

+ 6
- 1
frontend/src/services/survey.service.js Vedi File

@@ -8,7 +8,12 @@ import { db } from '../utils/db'
8 8
  * @returns {array} instantiated Profile objects (see: /entites/profile)
9 9
  */
10 10
 const fetchQuestions = async () => {
11
-    return await db.get(`/survey/questions`)
11
+    const questions = await db.get(`/survey/questions`)
12
+    // Add responses to match the format from the survery factory
13
+    return questions.map(q => {
14
+        q.responses = !q.responses ? [] : q.responses
15
+        return q
16
+    })
12 17
 }
13 18
 
14 19
 const saveSurveyByProfileId = async (surveyResponses, profileId) => {

+ 5
- 5
frontend/src/sss/partials/_typography.sss Vedi File

@@ -3,19 +3,19 @@
3 3
 
4 4
 h1
5 5
     font-size: $ms-5
6
-    line-height: $ms-4
6
+    line-height: $ms-5
7 7
 h2
8 8
     font-size: $ms-3
9
-    line-height: $ms-2
9
+    line-height: $ms-3
10 10
 h3
11 11
     font-size: $ms-2
12
-    line-height: $ms-1
12
+    line-height: $ms-2
13 13
 h4
14 14
     font-size: $ms-1
15
-    line-height: $ms-0
15
+    line-height: $ms-2
16 16
 p
17 17
     font-size: $ms-1
18
-    line-height: $ms-0
18
+    line-height: $ms-2
19 19
 
20 20
 .t
21 21
     &-center

+ 44
- 13
frontend/src/utils/lang.js Vedi File

@@ -7,20 +7,44 @@ const stepToComponentMap = {
7 7
     experience: 'ButtonChoice',
8 8
     role: 'ButtonChoice',
9 9
     duration: 'ButtonChoice',
10
-    distance: 'ButtonChoice',
10
+    presence: 'ButtonChoice',
11 11
     language: 'ButtonMulti',
12
+    pronouns: 'ButtonMulti',
13
+    image: 'InputString',
14
+    zipcode: 'InputString',
15
+    blurb: 'InputString',
16
+    distance: 'InputRange',
12 17
 }
13
-
18
+// TODO: Combine these two
14 19
 const allSteps = {
15 20
     usa: {
16 21
         name: 'name',
22
+        pronouns: 'pronouns',
17 23
         seeking: 'seeking',
18 24
         urgency: 'urgency',
19 25
         experience: 'experience',
20
-        role: 'role',
26
+        roles: 'role',
21 27
         duration: 'duration',
22
-        distance: 'distance',
28
+        presence: 'presence',
23 29
         language: 'language',
30
+        zipcode: 'zipcode',
31
+        distance: 'distance',
32
+        blurb: 'blurb',
33
+        image: 'image',
34
+    }
35
+}
36
+
37
+const allResponses = {
38
+    usa: {
39
+        questionaire: {
40
+            never: 'never',
41
+            rarely: 'rarely',
42
+            not_really: 'not really',
43
+            occasionally: 'occasionally',
44
+            mostly: 'mostly',
45
+            often: 'often',
46
+            everytime: 'everytime',
47
+        }
24 48
     }
25 49
 }
26 50
 
@@ -43,32 +67,29 @@ possible.usa = {
43 67
     urgency: [
44 68
         'actively_looking',
45 69
         'open_to_the_right_opportunity',
46
-        'just_browsing',
47
-        'networking',
70
+        'casually_browsing',
48 71
     ],
49
-    // key 10
50
-    distance: [
72
+    // key 11
73
+    presence: [
51 74
         'remote',
52 75
         'in_person',
53 76
         'hybrid',
54 77
         'flexible'
55 78
     ],
56
-    // key 11
79
+    // key 10
57 80
     duration: [
58 81
         'full-time',
59 82
         'part-time',
60 83
         'contract',
61 84
         'flexible',
62 85
     ],
63
-    // Everything else concats under role, key: 14
86
+    // Experience and roles concat, key: 14
64 87
     experience: [
65 88
         'associate',
66 89
         'junior',
67 90
         'mid-level',
68 91
         'senior',
69 92
         'staff',
70
-        'chief_of',
71
-        'director_of',
72 93
     ],
73 94
     roles: {
74 95
         type: [
@@ -95,6 +116,16 @@ possible.usa = {
95 116
             'recruiter',
96 117
         ]
97 118
     },
119
+    pronouns: [
120
+        'she/her',
121
+        'she/they',
122
+        'he/him',
123
+        'he/they',
124
+        'they/them',
125
+    ],
126
+    image: [],
127
+    zipcode: [],
128
+    blurb: []
98 129
 }
99 130
 
100
-export { allSteps, stepToComponentMap, possible }
131
+export { allSteps, allResponses, stepToComponentMap, possible }

+ 7
- 7
frontend/src/utils/survey.js Vedi File

@@ -4,31 +4,31 @@ import { fetchQuestions } from '../services'
4 4
 class SurveyFactory {
5 5
     constructor(responses) {
6 6
         this.responsesByCategory = responses
7
-        this.questions = []
7
+        this.questionsFromDb = []
8 8
     }
9 9
     _setSteps(langFile) {
10 10
         const stepsToProcess = [...Object.values(langFile) ]
11 11
         const seenIds = []
12 12
         const stepsInCommon = stepsToProcess.map(step => {
13 13
             // Match question to step
14
-            const match = this.questions.filter(q => q.response_key_prompt == step)[0]
14
+            const match = this.questionsFromDb.filter(q => q.response_key_prompt == step)[0]
15 15
             if(match) { seenIds.push(match.response_key_id) }
16 16
             return {
17
-                response_key_category: match ? match.response_key_category: 'profile',
18
-                response_key_description: match ? match.response_key_description: null,
19 17
                 response_key_id: match ? match.response_key_id: null,
18
+                response_key_category: match ? match.response_key_category: 'profile',
20 19
                 response_key_prompt: match ? match.response_key_prompt: step,
20
+                response_key_description: match ? match.response_key_description: null,
21 21
                 responses: this.responsesByCategory[step] ? this.responsesByCategory[step] : [] 
22 22
             }
23 23
         })
24
-        const unseen = this.questions.filter(q => !seenIds.includes(q.response_key_id))
24
+        const unseen = this.questionsFromDb.filter(q => !seenIds.includes(q.response_key_id))
25 25
         return [...stepsInCommon, ...unseen]
26 26
     }
27 27
     async getQuestions() {
28
-        this.questions = await fetchQuestions()
28
+        this.questionsFromDb = await fetchQuestions()
29 29
     }
30 30
     async createSurvey(langFile, roleTree) {
31
-        if(!this.questions.length) {
31
+        if(!this.questionsFromDb.length) {
32 32
             console.error('Attempted to create a survey before getting questions')
33 33
             await this.getQuestions()
34 34
         }

+ 1
- 1
frontend/src/views/ProfileView.vue Vedi File

@@ -5,7 +5,7 @@ main.view--profile.f-col.start.w-full
5 5
  
6 6
     article(v-if="!loading")
7 7
         h3 {{ profile }}
8
-        RouterLink(:to="{ name: 'HomeView' }") back
8
+        button(@click="$router.go(-1)") back
9 9
 
10 10
     p(v-else) Loading...
11 11
 

+ 69
- 32
frontend/src/views/SurveyView.vue Vedi File

@@ -1,7 +1,7 @@
1 1
 <template lang="pug">
2 2
 main.view--survey.f-col.start.w-full
3 3
     header.w-full.f-col
4
-        p survey for profile: {{ pid }}
4
+        p survey for profile: {{ current }}
5 5
         //- Transition(name="slide-up" :duration="1600")
6 6
         //-     h3(v-if="step == 0") hello, what shall i call you?
7 7
         //-         span(v-for="letter in name" class="fade") {{ letter }}
@@ -53,31 +53,52 @@ main.view--survey.f-col.start.w-full
53 53
     article.match.w-full
54 54
         ul.w-full
55 55
             template(v-for="(q, i) in profileQuestions" :key="q.response_key_prompt")
56
-                p {{q}}
57
-                //- li(v-if="step == i").f-col
58
-                //-     p step: {{ i }}
59
-                //-         component(
60
-                //-             v-if="componentMap[q.response_key_prompt]"
61
-                //-             :is="componentMap[q.response_key_prompt]"
62
-                //-             :opts="q.responses"
63
-                //-             :prompt="q.response_key_prompt"
64
-                //-             @selected="onButtonSelect"
65
-                //-             @hovered="onInputChange"
66
-                //-             @input="onInputChange"
67
-                //-         )
68
-                //-     footer.f-row
69
-                //-         button(@click="back(q.response_key_prompt)").w-full back
56
+                li(v-if="step == i")
57
+                    p {{q.response_key_category}}: 
58
+                        span in db:
59
+                        span(v-if="q.response_key_id") true - id:{{q.response_key_id}} | 
60
+                        span(v-else) false | 
61
+                        span {{q.response_key_prompt}}? 
62
+                        span {{q.response_key_description}} 
63
+
64
+                        div(v-if="q.responses.length")
65
+                            button(
66
+                                v-for="(res, index) in q.responses"
67
+                                :key="index"
68
+                                @click="profile[q.response_key_prompt] = res; step++"
69
+                                :disabled="profile[q.response_key_prompt] == res"
70
+                            ).p-0 {{res}}
71
+                        div(v-else-if="q.response_key_category === 'profile'")
72
+                            input(v-model="profile[q.response_key_prompt]" @keyup.enter="step++") 
73
+                            label >{{ profile[q.response_key_prompt]}}
74
+                        div(v-else).f-col
75
+                            input(type="range" min="-3" max="3" list="ticks" v-model="questionaire[q.response_key_category]").w-full
76
+                            label {{ questionaireResponses[parseInt(questionaire[q.response_key_category]) + 3] }} 
77
+                    nav.f-row
78
+                        button(:disabled="step == 0" @click="step--") back
79
+                        p {{step + 1}} of {{profileQuestions.length}}
80
+                        button(@click="step++") next
81
+            li(v-if="step == profileQuestions.length")
82
+                p Does this look correct?
83
+                h4 {{ profile }}
84
+                h4 {{questionaire}}
85
+                nav.f-row
86
+                    button(@click="step--") back
87
+                    p(@click="step = 0").p-1 start over
88
+                    button(@click="$router.push({ name: 'HomeView' })") save
89
+            
70 90
     MainNav(@show-sidebar="$emit('show-sidebar')")
71 91
 </template>
72 92
 
73 93
 <script>
74
-import { surveyFactory } from '../utils'
75
-import { allSteps, possible, stepToComponentMap } from '../utils/lang'
94
+import { surveyFactory } from '@/utils'
95
+import { allSteps, allResponses, possible, stepToComponentMap } from '@/utils/lang'
96
+import { currentProfile } from '@/services'
76 97
 
77
-import SurveyForm from '../components/form.vue'
78
-import ButtonMulti from '../components/form/button-multi.vue'
79
-import ButtonChoice from '../components/form/button-choice.vue'
80
-import InputString from '../components/form/input-string.vue'
98
+import SurveyForm from '@/components/form.vue'
99
+import ButtonMulti from '@/components/form/button-multi.vue'
100
+import ButtonChoice from '@/components/form/button-choice.vue'
101
+import InputString from '@/components/form/input-string.vue'
81 102
 
82 103
 export default {
83 104
     components: { SurveyForm, ButtonMulti, ButtonChoice, InputString },
@@ -92,20 +113,36 @@ export default {
92 113
             validSurvey: null,
93 114
             componentMap: stepToComponentMap,
94 115
             step: 0,
95
-            name: '',
96
-            seeking: '',
97
-            urgency: '',
98
-            role: '',
99
-            duration: '',
100
-            distance: '',
101
-            experience: '',
102
-            position: '',
103
-            language: '',
104
-            pronouns: '',
105
-            zipcode: '',
116
+            profile: {
117
+                name: '',
118
+                seeking: '',
119
+                urgency: '',
120
+                experience: '',
121
+                role: '',
122
+                duration: '',
123
+                distance: '',
124
+                position: '',
125
+                language: '',
126
+                pronouns: '',
127
+                zipcode: '',
128
+                image: '',
129
+                blurb: ''
130
+            },
131
+            questionaire: {
132
+                grit: 0,
133
+                openness: 0,
134
+                bravery: 0,
135
+                empathy: 0,
136
+                honesty: 0,
137
+                respect: 0,
138
+            },
139
+            questionaireResponses: Object.values(allResponses.usa.questionaire)
106 140
         }
107 141
     },
108 142
     computed: {
143
+        current() {
144
+            return currentProfile
145
+        },
109 146
         profileQuestions() {
110 147
             if (!this.validSurvey) return []
111 148
             return this.validSurvey.steps

BIN
public/favicon.ico Vedi File


Loading…
Annulla
Salva