Bläddra i källkod

:construction: WIP dynamic spider chart

tags/0.0.3^2
juancarbajal98 3 år sedan
förälder
incheckning
3211a89b96

+ 3
- 3
frontend/src/components/SummaryBar.vue Visa fil

30
                     p {{ tabContent[item].tab }}
30
                     p {{ tabContent[item].tab }}
31
                     SpiderChart(
31
                     SpiderChart(
32
                         :labels='aspects.map(label => label.name)'
32
                         :labels='aspects.map(label => label.name)'
33
-                        :profile-data='profileScore'
33
+                        :profile-data='aspects.map(data => data.percentage * 10)'
34
                         :target-data='targetScore'
34
                         :target-data='targetScore'
35
                         profile-name='lucy'
35
                         profile-name='lucy'
36
                         v-if='isTab'
36
                         v-if='isTab'
87
     },
87
     },
88
     emits: ['tab-change'],
88
     emits: ['tab-change'],
89
     data: () => ({
89
     data: () => ({
90
-        profileScore: [5.7, 5.2, 4.8, 5.2, 4.9, 4.9],
91
-        targetScore: [5.3, 4.8, 5.7, 4.8, 5.6, 4.8],
90
+        // profileScore: [5.7, 5.2, 4.8, 5.2, 4.9, 4.9], // lucy 
91
+        targetScore: [5.3, 4.8, 5.7, 4.8, 5.6, 4.8], // Role
92
     }),
92
     }),
93
     methods: {
93
     methods: {
94
         onTabChanged(tabs) {
94
         onTabChanged(tabs) {

+ 11
- 0
frontend/src/entities/card/card.js Visa fil

123
     c.ethinicity = profile?.profile_prefs?.ethnicity?.val
123
     c.ethinicity = profile?.profile_prefs?.ethnicity?.val
124
     c.locale = `${profile.city}, ${profile.state}`
124
     c.locale = `${profile.city}, ${profile.state}`
125
     c.email = profile.user_email
125
     c.email = profile.user_email
126
+
127
+
128
+    console.log(`RESP: ${profile?.responses}`)
129
+    let aspectResponses = profile?.responses.filter(r => r.response_id == 'aspect')
130
+    if(aspectResponses.length){ // if user has responses for aspects we overwrite default percentages
131
+        c.aspects.map(a => {
132
+            a.percentage = aspectResponses.find(r => r.response_key_id == a.name).val // depends on DB structure
133
+            return a 
134
+        })
135
+    }
136
+
126
     // TODO: delete me later
137
     // TODO: delete me later
127
     if (profile.profile_description) {
138
     if (profile.profile_description) {
128
         c.summary.updateTab('about', profile.profile_description)
139
         c.summary.updateTab('about', profile.profile_description)

+ 2
- 0
frontend/src/views/HomeView.vue Visa fil

1
 <template lang="pug">
1
 <template lang="pug">
2
 main.view--home
2
 main.view--home
3
+    p {{cP._profile.user_name}}
3
     article.w-flex.column.align-center
4
     article.w-flex.column.align-center
4
         template(v-if='isLoading')
5
         template(v-if='isLoading')
5
             w-spinner(bounce)
6
             w-spinner(bounce)
61
     },
62
     },
62
     mixins: [mixins.profileMixin],
63
     mixins: [mixins.profileMixin],
63
     computed: {
64
     computed: {
65
+        cP() {return currentProfile},
64
         cards() {
66
         cards() {
65
             return currentProfile.queue.map(qProfile => convertToCard(qProfile))
67
             return currentProfile.queue.map(qProfile => convertToCard(qProfile))
66
         },
68
         },

Laddar…
Avbryt
Spara