Przeglądaj źródła

Merge branch 'dev' into questionnaire-endpoint

tags/0.0.1^2
juancarbajal98 3 lat temu
rodzic
commit
322349689d

+ 3
- 3
backend/package-lock.json Wyświetl plik

1623
             "dev": true
1623
             "dev": true
1624
         },
1624
         },
1625
         "caniuse-lite": {
1625
         "caniuse-lite": {
1626
-            "version": "1.0.30001312",
1627
-            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz",
1628
-            "integrity": "sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==",
1626
+            "version": "1.0.30001418",
1627
+            "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001418.tgz",
1628
+            "integrity": "sha512-oIs7+JL3K9JRQ3jPZjlH6qyYDp+nBTCais7hjh0s+fuBwufc7uZ7hPYMXrDOJhV360KGMTcczMRObk0/iMqZRg==",
1629
             "dev": true
1629
             "dev": true
1630
         },
1630
         },
1631
         "chalk": {
1631
         "chalk": {

+ 6588
- 149
frontend/package-lock.json
Plik diff jest za duży
Wyświetl plik


+ 3
- 1
frontend/package.json Wyświetl plik

1
 {
1
 {
2
     "name": "vite-project",
2
     "name": "vite-project",
3
     "version": "0.0.0",
3
     "version": "0.0.0",
4
+    "type": "module",
4
     "scripts": {
5
     "scripts": {
5
         "nodev": "cross-env VITE_DEV=false vite",
6
         "nodev": "cross-env VITE_DEV=false vite",
6
         "dev": "cross-env VITE_DEV=true vite",
7
         "dev": "cross-env VITE_DEV=true vite",
8
         "serve": "vite preview",
9
         "serve": "vite preview",
9
         "lint": "eslint --ext .js,.vue --fix src",
10
         "lint": "eslint --ext .js,.vue --fix src",
10
         "format": "prettier .  --write",
11
         "format": "prettier .  --write",
11
-        "test": "echo 'no tests at this time...'"
12
+        "test": "ava"
12
     },
13
     },
13
     "dependencies": {
14
     "dependencies": {
14
         "joi": "^17.6.0",
15
         "joi": "^17.6.0",
19
         "wave-ui": "^2.40.2"
20
         "wave-ui": "^2.40.2"
20
     },
21
     },
21
     "devDependencies": {
22
     "devDependencies": {
23
+        "@mdi/font": "^7.0.96",
22
         "@prettier/plugin-pug": "^1.19.2",
24
         "@prettier/plugin-pug": "^1.19.2",
23
         "@vitejs/plugin-vue": "^2.2.4",
25
         "@vitejs/plugin-vue": "^2.2.4",
24
         "@vue/compiler-sfc": "^3.2.31",
26
         "@vue/compiler-sfc": "^3.2.31",

+ 23
- 4
frontend/src/components/MainNav.vue Wyświetl plik

1
 <template lang="pug">
1
 <template lang="pug">
2
-nav#main-header
3
-    router-link(:to="`/matches`") matches
4
-    router-link(to='/') home
5
-    router-link(:to="`/survey`") survey
2
+w-toolbar.mt6.py1.no-grow(bottom)
3
+    router-link.w-flex.column(:to='`/chats`')
4
+        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary' disabled)
5
+            w-icon.mr1(xl) mdi mdi-forum
6
+            p.text-upper active chats
7
+    router-link.w-flex.column(:to='`/matches`')
8
+        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary')
9
+            w-icon.mr1(xl) mdi mdi-tooltip-account
10
+            p.text-upper pending matches
11
+    router-link.w-flex.column(:to='`/`')
12
+        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary')
13
+            w-icon.mr1(xl) mdi mdi-home
14
+            p.text-upper home queue
15
+    router-link.w-flex.column(:to='`/survey`')
16
+        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary')
17
+            w-icon.mr1(xl) mdi mdi-account-check
18
+            p.text-upper survey
19
+    router-link.w-flex.column(:to='`/settings`')
20
+        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary' disabled)
21
+            w-icon.mr1(xl) mdi mdi-cog
22
+            p.text-upper settings
6
 </template>
23
 </template>
7
 
24
 
8
 <script>
25
 <script>
26
+import '@mdi/font/css/materialdesignicons.min.css'
27
+
9
 export default {
28
 export default {
10
     name: 'MainNav',
29
     name: 'MainNav',
11
 }
30
 }

+ 1
- 1
frontend/src/entities/card/index.js Wyświetl plik

1
-export * from './card'
1
+export * from './card.js'

+ 2
- 2
frontend/src/entities/grouping/grouping.js Wyświetl plik

1
 /** @module entities/grouping */
1
 /** @module entities/grouping */
2
 
2
 
3
-import { _baseRecord } from '..'
4
-import { groupingSchema } from './grouping.schema'
3
+import { _baseRecord } from '../index.js'
4
+import { groupingSchema } from './grouping.schema.js'
5
 
5
 
6
 /** Class representing a grouping */
6
 /** Class representing a grouping */
7
 class Grouping extends _baseRecord {
7
 class Grouping extends _baseRecord {

+ 2
- 2
frontend/src/entities/grouping/index.js Wyświetl plik

1
-export * from './grouping'
2
-export * from './grouping.schema'
1
+export * from './grouping.js'
2
+export * from './grouping.schema.js'

+ 6
- 6
frontend/src/entities/index.js Wyświetl plik

1
-export * from './_modules'
1
+export * from './_modules.js'
2
 
2
 
3
 /** Your different entities */
3
 /** Your different entities */
4
-export * from './response'
5
-export * from './profile'
6
-export * from './survey'
7
-export * from './grouping'
8
-export * from './card'
4
+export * from './response/index.js'
5
+export * from './profile/index.js'
6
+export * from './survey/index.js'
7
+export * from './grouping/index.js'
8
+export * from './card/index.js'

+ 2
- 2
frontend/src/entities/profile/index.js Wyświetl plik

1
-export * from './profile'
2
-export * from './profile.schema'
1
+export * from './profile.js'
2
+export * from './profile.schema.js'

+ 3
- 3
frontend/src/entities/profile/profile.js Wyświetl plik

1
 /** @module entities/profile */
1
 /** @module entities/profile */
2
-import { _baseRecord } from '..'
3
-import { profileSchema } from './profile.schema'
2
+import { _baseRecord } from '../index.js'
3
+import { profileSchema } from './profile.schema.js'
4
 
4
 
5
 /** Class representing a profile */
5
 /** Class representing a profile */
6
 class Profile extends _baseRecord {
6
 class Profile extends _baseRecord {
14
     constructor({ email, ...profileData }) {
14
     constructor({ email, ...profileData }) {
15
         super()
15
         super()
16
 
16
 
17
-        this.type = this.constructor.name.toLowerCase() 
17
+        this.type = this.constructor.name.toLowerCase()
18
 
18
 
19
         /**  Fields */
19
         /**  Fields */
20
         this.email = email // ! required
20
         this.email = email // ! required

+ 1
- 1
frontend/src/entities/profile/profile.schema.js Wyświetl plik

1
 /** @module entities/profileSchema */
1
 /** @module entities/profileSchema */
2
 import Joi from 'joi'
2
 import Joi from 'joi'
3
-import { allModules, responseSchema } from '..'
3
+import { allModules, responseSchema } from '../index.js'
4
 
4
 
5
 /**
5
 /**
6
  * profile schema object
6
  * profile schema object

+ 8
- 1
frontend/src/entities/profile/profile.spec.js Wyświetl plik

1
-// Write your profile test here
1
+import test from 'ava'
2
+import { Profile } from './profile.js'
3
+
4
+test('instantiate a Profile', async t => {
5
+    const profToTest = { email: 'fake@email.com', user_name: 'bob' }
6
+    const p = new Profile(profToTest)
7
+    t.is(p.user_name, profToTest.user_name)
8
+})

+ 1
- 1
frontend/src/entities/response/index.js Wyświetl plik

1
-export * from './response.schema'
1
+export * from './response.schema.js'

+ 2
- 2
frontend/src/entities/survey/index.js Wyświetl plik

1
-export * from './survey'
2
-export * from './survey.schema'
1
+export * from './survey.js'
2
+export * from './survey.schema.js'

+ 6
- 7
frontend/src/entities/survey/survey.js Wyświetl plik

1
 /** @module survey/survey */
1
 /** @module survey/survey */
2
-import { _baseRecord } from '..'
3
-import { surveySchema } from './survey.schema'
2
+import { _baseRecord } from '../index.js'
3
+import { surveySchema } from './survey.schema.js'
4
 
4
 
5
 class Survey extends _baseRecord {
5
 class Survey extends _baseRecord {
6
     constructor(questionSteps, roles) {
6
     constructor(questionSteps, roles) {
9
         this.type = this.constructor.name.toLowerCase()
9
         this.type = this.constructor.name.toLowerCase()
10
 
10
 
11
         /**  Fields */
11
         /**  Fields */
12
-        this.steps = [
13
-            ...questionSteps
14
-        ] // ! required
12
+        this.steps = [...questionSteps] // ! required
15
         this.roleTree = roles
13
         this.roleTree = roles
16
 
14
 
17
         return this
15
         return this
18
     }
16
     }
19
     setRoleResponses(position) {
17
     setRoleResponses(position) {
20
-        const roleStep = this.steps.filter(step => step.response_key_prompt == 'role')[0]
18
+        const roleStep = this.steps.filter(
19
+            step => step.response_key_prompt == 'role',
20
+        )[0]
21
         roleStep.responses = this.roleTree[position]
21
         roleStep.responses = this.roleTree[position]
22
     }
22
     }
23
     isValid() {
23
     isValid() {
33
         /** validate(this) always returns something so force it to a bool */
33
         /** validate(this) always returns something so force it to a bool */
34
         return !validate.error ? true : false
34
         return !validate.error ? true : false
35
     }
35
     }
36
-
37
 }
36
 }
38
 
37
 
39
 export { Survey }
38
 export { Survey }

+ 12
- 10
frontend/src/entities/survey/survey.schema.js Wyświetl plik

1
 import Joi from 'joi'
1
 import Joi from 'joi'
2
-import { allModules } from '..'
2
+import { allModules } from '../index.js'
3
 
3
 
4
 /**
4
 /**
5
  * membership schema object
5
  * membership schema object
17
         type: Joi.string(),
17
         type: Joi.string(),
18
 
18
 
19
         /** Survey fields */
19
         /** Survey fields */
20
-        steps: Joi.array().items(
21
-            Joi.object({
22
-                id: Joi.number(),
23
-                type: Joi.string(),
24
-                question: Joi.string(),
25
-                // TODO: specify responses to be array or null later
26
-                responses: Joi.any(),
27
-            })
28
-        ).required(),
20
+        steps: Joi.array()
21
+            .items(
22
+                Joi.object({
23
+                    id: Joi.number(),
24
+                    type: Joi.string(),
25
+                    question: Joi.string(),
26
+                    // TODO: specify responses to be array or null later
27
+                    responses: Joi.any(),
28
+                }),
29
+            )
30
+            .required(),
29
     }),
31
     }),
30
     /** fields required before saving */
32
     /** fields required before saving */
31
     required: ['steps'],
33
     required: ['steps'],

+ 6
- 7
frontend/src/services/chat.service.js Wyświetl plik

14
     listen: () => console.error('no provider listen method set'),
14
     listen: () => console.error('no provider listen method set'),
15
 }
15
 }
16
 /**
16
 /**
17
- * 
18
- * 
17
+ *
18
+ *
19
  * Breaking out as much pubnub specific flavor
19
  * Breaking out as much pubnub specific flavor
20
  */
20
  */
21
 const setupPubnub = async uuid => {
21
 const setupPubnub = async uuid => {
22
-    const publishKey = 'pub-c-73f35484-396f-47ff-b4b6-45bed079fd3b'
23
-    const subscribeKey = 'sub-c-6cb7f5d0-94e2-11ec-b249-a68c05a281ab'
22
+    const publishKey = import.meta.env.VITE_PUBNUB_PUBLISH_KEY
23
+    const subscribeKey = import.meta.env.VITE_PUBNUB_SUBSCRIBE_KEY
24
     if (!uuid) return console.error('no pubnub uuid set')
24
     if (!uuid) return console.error('no pubnub uuid set')
25
 
25
 
26
     const pubnubClient = await new PubNub({
26
     const pubnubClient = await new PubNub({
97
      */
97
      */
98
     async publish(channel, message) {
98
     async publish(channel, message) {
99
         // console.log('publishing message to channel:', channel)
99
         // console.log('publishing message to channel:', channel)
100
-        return providerMethods.publish({ 
100
+        return providerMethods.publish({
101
             channel,
101
             channel,
102
-            message: new ChatMessage(message)
102
+            message: new ChatMessage(message),
103
         })
103
         })
104
     }
104
     }
105
     /**
105
     /**
128
         this.subscriptions = [MAIN_CHANNEL]
128
         this.subscriptions = [MAIN_CHANNEL]
129
         console.warn('chatter stop no implemented')
129
         console.warn('chatter stop no implemented')
130
     }
130
     }
131
-
132
 }
131
 }
133
 
132
 
134
 export { Chatter }
133
 export { Chatter }

+ 1
- 1
frontend/src/views/ChatView.vue Wyświetl plik

25
     p(v-else-if="profile.isLoggedIn && !target") No match found between profile {{ $route.params.tid }} and {{profile.id}}... 
25
     p(v-else-if="profile.isLoggedIn && !target") No match found between profile {{ $route.params.tid }} and {{profile.id}}... 
26
     p(v-else) Loading...
26
     p(v-else) Loading...
27
 
27
 
28
-    MainNav(@show-sidebar="$emit('show-sidebar')")
28
+    MainNav
29
 </template>
29
 </template>
30
 
30
 
31
 <script>
31
 <script>

+ 34
- 30
frontend/src/views/HomeView.vue Wyświetl plik

1
 <template lang="pug">
1
 <template lang="pug">
2
-main.view--home(style="display:flex; flex-direction:column; gap: 40px; margin-top: 1em;")
3
-    h2 Match Queue
4
-    article(v-if="cards.length && !loading")
5
-        ProfileCardList(:profiles="cards" :pid="pid" @reload="getCards")
2
+main.view--home(
3
+    style='display: flex; flex-direction: column; gap: 40px; margin-top: 1em'
4
+)
5
+    header
6
+        h2 Match Queue
6
 
7
 
7
-    p(v-else) Loading...
8
+    article(v-if='cards.length && !loading')
9
+        ProfileCardList(:pid='pid' :profiles='cards' @reload='getCards')
8
 
10
 
9
-    h2 Matches
10
-    article(v-if="matches.length && !loading")
11
-        ProfileCardList(:profiles="matches" :pid="pid" @reload="getCards")
12
-    
13
-    p(v-else-if="matches.length===0") No matches.
11
+    p(v-else-if='cards.length === 0') No profiles in match_queue.
14
     p(v-else) Loading...
12
     p(v-else) Loading...
13
+
14
+    MainNav
15
 </template>
15
 </template>
16
 
16
 
17
 <script>
17
 <script>
18
-    import 'wave-ui/dist/wave-ui.css'
18
+import 'wave-ui/dist/wave-ui.css'
19
 import ProfileCardList from '../components/ProfileCardList.vue'
19
 import ProfileCardList from '../components/ProfileCardList.vue'
20
 
20
 
21
 import { Card } from '../entities'
21
 import { Card } from '../entities'
22
-import { fetchQueueByProfileId, fetchMembershipsByProfileId, currentProfile } from '../services'
22
+import {
23
+    fetchQueueByProfileId,
24
+    fetchMembershipsByProfileId,
25
+    currentProfile,
26
+} from '../services'
23
 import { mixins } from '../utils'
27
 import { mixins } from '../utils'
24
 
28
 
25
 /** Callback used to format incoming into card */
29
 /** Callback used to format incoming into card */
72
         // this can be placed in utils/notification.js
76
         // this can be placed in utils/notification.js
73
         notify(payload) {
77
         notify(payload) {
74
             this.$waveui.notify({
78
             this.$waveui.notify({
75
-            message: payload.timetoken,
76
-            timeout: 6000,
77
-            bgColor: 'white',
78
-            color: 'success',
79
-            dismiss: false,
80
-            shadow: true,
81
-            round: true,
82
-            sm: true,
83
-            icon: 'wi-star'
84
-        })
79
+                message: payload.timetoken,
80
+                timeout: 6000,
81
+                bgColor: 'white',
82
+                color: 'success',
83
+                dismiss: false,
84
+                shadow: true,
85
+                round: true,
86
+                sm: true,
87
+                icon: 'wi-star',
88
+            })
85
         },
89
         },
86
         //  a way to send a message to a user for development purposes and testing
90
         //  a way to send a message to a user for development purposes and testing
87
-        async chat()  {
88
-           const chatter = currentProfile.chatter
89
-           const res = await chatter.publish(chatter.subscriptions[0],{
90
-            title: 'New Message',
91
-            description: 'This is a new message',
92
-           })
93
-           this.notify(res)
94
-        }
91
+        async chat() {
92
+            const chatter = currentProfile.chatter
93
+            const res = await chatter.publish(chatter.subscriptions[0], {
94
+                title: 'New Message',
95
+                description: 'This is a new message',
96
+            })
97
+            this.notify(res)
98
+        },
95
     },
99
     },
96
 }
100
 }
97
 </script>
101
 </script>

+ 7
- 6
frontend/src/views/MatchesView.vue Wyświetl plik

1
 <template lang="pug">
1
 <template lang="pug">
2
 main.view--matches.f-col.start.w-full
2
 main.view--matches.f-col.start.w-full
3
     header
3
     header
4
-        h2 Match Page
4
+        h2 Matches
5
 
5
 
6
-    article(v-if="!loading")
7
-        ProfileCardList(:profiles="cards" :pid="pid" :is-grid="true")
8
-    
6
+    article(v-if='matches.length && !loading')
7
+        ProfileCardList(:pid='pid' :profiles='matches' @reload='getCards')
8
+
9
+    p(v-else-if='matches.length === 0') No matches.
9
     p(v-else) Loading...
10
     p(v-else) Loading...
10
-    
11
-    MainNav(@show-sidebar="$emit('show-sidebar')")
11
+
12
+    MainNav
12
 </template>
13
 </template>
13
 
14
 
14
 <script>
15
 <script>

+ 17
- 12
frontend/src/views/ProfileView.vue Wyświetl plik

2
 main.view--profile.f-col.start.w-full
2
 main.view--profile.f-col.start.w-full
3
     header 
3
     header 
4
         h2 Profile Page
4
         h2 Profile Page
5
- 
6
-    article(v-if="!loading")
5
+
6
+    article(v-if='!loading')
7
         h3 name: {{ profile.user_name }}
7
         h3 name: {{ profile.user_name }}
8
-            span(v-if="profile.profile_prefs?.pronouns") &nbsp;({{ profile.profile_prefs?.pronouns.val }})
9
-        p(v-if="profile.user_email") {{ profile.user_email }}
10
-        
8
+            span(v-if='profile.profile_prefs?.pronouns') &nbsp;({{ profile.profile_prefs?.pronouns.val }})
9
+        p(v-if='profile.user_email') {{ profile.user_email }}
10
+
11
         p I am looking for a&nbsp;
11
         p I am looking for a&nbsp;
12
             span {{ profile.profile_prefs?.presence?.val }}&nbsp;
12
             span {{ profile.profile_prefs?.presence?.val }}&nbsp;
13
             span {{ profile.profile_prefs?.role?.val }}&nbsp;
13
             span {{ profile.profile_prefs?.role?.val }}&nbsp;
15
             span no further than {{ profile.profile_prefs?.distance?.val }} miles away&nbsp;
15
             span no further than {{ profile.profile_prefs?.distance?.val }} miles away&nbsp;
16
             span from {{ profile.profile_prefs?.zipcode?.val }}
16
             span from {{ profile.profile_prefs?.zipcode?.val }}
17
 
17
 
18
-        p I am {{ profile.profile_prefs?.urgency?.val.split("_").join(" ") }}.
19
-        
20
-        img(v-if="profile.reveal.map(t => t.description).includes('image')" :src="profile.profile_media[0]" alt="profile-avatar" style="max-height: 200px; width: auto;")
18
+        p I am {{ profile.profile_prefs?.urgency?.val.split('_').join(' ') }}.
19
+
20
+        img(
21
+            :src='profile.profile_media[0]'
22
+            alt='profile-avatar'
23
+            style='max-height: 200px; width: auto'
24
+            v-if='profile.reveal.map(t => t.description).includes("image")'
25
+        )
21
         h3(v-else) image not revealed
26
         h3(v-else) image not revealed
22
-        
23
-        p About: {{ profile.profile_description}}
27
+
28
+        p About: {{ profile.profile_description }}
24
 
29
 
25
         p reveal: {{ profile.reveal.map(t => t.description) }}
30
         p reveal: {{ profile.reveal.map(t => t.description) }}
26
         p tags: {{ profile.tags.map(t => t.description) }}
31
         p tags: {{ profile.tags.map(t => t.description) }}
27
         p images: {{ profile.profile_media }}
32
         p images: {{ profile.profile_media }}
28
         p responses: {{ profile.responses.length }}
33
         p responses: {{ profile.responses.length }}
29
-        button(@click="$router.go(-1)") back
34
+        button(@click='$router.go(-1)') back
30
 
35
 
31
     p(v-else) Loading...
36
     p(v-else) Loading...
32
 
37
 
33
-    MainNav(@show-sidebar="$emit('show-sidebar')")
38
+    MainNav
34
 </template>
39
 </template>
35
 
40
 
36
 <script>
41
 <script>

+ 50
- 34
frontend/src/views/SurveyView.vue Wyświetl plik

4
         p survey for profile: {{ current }}
4
         p survey for profile: {{ current }}
5
     article.match.w-full
5
     article.match.w-full
6
         ul.w-full
6
         ul.w-full
7
-            template(v-for="(q, i) in profileQuestions" :key="q.response_key_prompt")
8
-                li(v-if="step == i + 1")
9
-                    p {{q.response_key_category}}: 
7
+            template(
8
+                :key='q.response_key_prompt'
9
+                v-for='(q, i) in profileQuestions'
10
+            )
11
+                li(v-if='step == i + 1')
12
+                    p {{ q.response_key_category }}:
10
                         span in db:
13
                         span in db:
11
-                        span(v-if="q.response_key_id") true - id:{{q.response_key_id}} | 
12
-                        span(v-else) false | 
13
-                        span {{q.response_key_prompt}}? 
14
-                        span {{q.response_key_description}} 
14
+                        span(v-if='q.response_key_id') true - id:{{ q.response_key_id }} |
15
+                        span(v-else) false |
16
+                        span {{ q.response_key_prompt }}?
17
+                        span {{ q.response_key_description }}
15
 
18
 
16
                         //- Select
19
                         //- Select
17
-                        div(v-if="q.responses.length")
18
-                            button(
19
-                                v-for="(res, index) in q.responses"
20
-                                :key="index"
21
-                                @click="storeResponseLike(step, q.response_key_id, q.response_key_prompt, res); step++"
22
-                            ).p-0 {{res}}
23
-                        
20
+                        div(v-if='q.responses.length')
21
+                            button.p-0(
22
+                                :key='index'
23
+                                @click='storeResponseLike(step, q.response_key_id, q.response_key_prompt, res); step++'
24
+                                v-for='(res, index) in q.responses'
25
+                            ) {{ res }}
26
+
24
                         //- Fill in the blank
27
                         //- Fill in the blank
25
-                        div(v-else-if="q.response_key_category === 'profile'")
26
-                            input(@input="storeResponseLike(step, q.response_key_id, q.response_key_prompt, profile[q.response_key_prompt])" v-model="profile[q.response_key_prompt]" @keyup.enter="step++") 
27
-                            label >{{ profile[q.response_key_prompt]}}
28
-                        
28
+                        div(v-else-if='q.response_key_category === "profile"')
29
+                            input(
30
+                                @input='storeResponseLike(step, q.response_key_id, q.response_key_prompt, profile[q.response_key_prompt])'
31
+                                @keyup.enter='step++'
32
+                                v-model='profile[q.response_key_prompt]'
33
+                            ) 
34
+                            label >{{ profile[q.response_key_prompt] }}
35
+
29
                         //- Aspects
36
                         //- Aspects
30
-                        div(v-else).f-col
31
-                            input(type="range" min="-3" max="3" list="ticks" @input="storeResponseLike(step, q.response_key_id, q.response_key_prompt, aspects[q.response_key_category])" v-model="aspects[q.response_key_category]").w-full
32
-                            label {{ aspectResponses[parseInt(aspects[q.response_key_category]) + 3] }} 
33
-                    
37
+                        .f-col(v-else)
38
+                            input.w-full(
39
+                                @input='storeResponseLike(step, q.response_key_id, q.response_key_prompt, aspects[q.response_key_category])'
40
+                                list='ticks'
41
+                                max='3'
42
+                                min='-3'
43
+                                type='range'
44
+                                v-model='aspects[q.response_key_category]'
45
+                            )
46
+                            label {{ aspectResponses[parseInt(aspects[q.response_key_category]) + 3] }}
47
+
34
                         nav.f-row
48
                         nav.f-row
35
-                            button(:disabled="step == 0" @click="step--") back
36
-                            p {{step}} of {{profile.length}}
49
+                            button(:disabled='step == 0' @click='step--') back
50
+                            p {{ step }} of {{ profile.length }}
37
                             button(
51
                             button(
38
-                                v-if="(q.response_key_category === 'profile')"
39
-                                @click="storeResponseLike(step, q.response_key_id, q.response_key_prompt, profile[q.response_key_prompt]); step++"
52
+                                @click='storeResponseLike(step, q.response_key_id, q.response_key_prompt, profile[q.response_key_prompt]); step++'
53
+                                v-if='q.response_key_category === "profile"'
40
                             ) next
54
                             ) next
41
                             button(
55
                             button(
56
+                                @click='storeResponseLike(step, q.response_key_id, q.response_key_prompt, aspects[q.response_key_category]); step++'
42
                                 v-else
57
                                 v-else
43
-                                @click="storeResponseLike(step, q.response_key_id, q.response_key_prompt, aspects[q.response_key_category]); step++"
44
                             ) next
58
                             ) next
45
-                    
59
+
46
             //- Confirmation
60
             //- Confirmation
47
-            li(v-if="step == profileQuestions.length + 1")
61
+            li(v-if='step == profileQuestions.length + 1')
48
                 p Does this look correct?
62
                 p Does this look correct?
49
                 h4 {{ profile }}
63
                 h4 {{ profile }}
50
-                h4 {{aspects}}
64
+                h4 {{ aspects }}
51
                 nav.f-row
65
                 nav.f-row
52
-                    button(@click="step--") back
53
-                    p(@click="step = 1").p-1 start over
54
-                    button(@click="onSave") save
66
+                    button(@click='step--') back
67
+                    p.p-1(@click='step = 1') start over
68
+                    button(@click='onSave') save
55
                     //- button(@click="$router.push({ name: 'HomeView' })") save
69
                     //- button(@click="$router.push({ name: 'HomeView' })") save
56
     footer
70
     footer
57
-        button(@click="bypass") +30 user profiles
71
+        button(@click='bypass') +30 user profiles
72
+
73
+    MainNav
58
 </template>
74
 </template>
59
 
75
 
60
 <script>
76
 <script>

+ 2
- 0
frontend/src/wave.js Wyświetl plik

19
     WSlider,
19
     WSlider,
20
     WSpinner,
20
     WSpinner,
21
     WSteps,
21
     WSteps,
22
+    WToolbar,
22
 } from '../node_modules/wave-ui/src/wave-ui/components'
23
 } from '../node_modules/wave-ui/src/wave-ui/components'
23
 
24
 
24
 export default {
25
 export default {
39
     WSlider,
40
     WSlider,
40
     WSpinner,
41
     WSpinner,
41
     WSteps,
42
     WSteps,
43
+    WToolbar,
42
 }
44
 }

+ 5
- 0
frontend/tests/test.js Wyświetl plik

1
+import test from 'ava'
2
+
3
+test('make sure ava works on the frontend', async t => {
4
+    t.pass()
5
+})

+ 7
- 1
frontend/vite.config.js Wyświetl plik

1
 import { defineConfig } from 'vite'
1
 import { defineConfig } from 'vite'
2
 import vue from '@vitejs/plugin-vue'
2
 import vue from '@vitejs/plugin-vue'
3
 
3
 
4
+import path from 'path'
5
+import { fileURLToPath } from 'url'
6
+
7
+const filename = fileURLToPath(import.meta.url)
8
+const dirname = path.dirname(filename)
9
+
4
 // https://vitejs.dev/config/
10
 // https://vitejs.dev/config/
5
 export default defineConfig({
11
 export default defineConfig({
6
     css: {
12
     css: {
14
     plugins: [vue()],
20
     plugins: [vue()],
15
     resolve: {
21
     resolve: {
16
         alias: {
22
         alias: {
17
-            '@': require('path').resolve(__dirname, 'src'),
23
+            '@': path.resolve(dirname, 'src'),
18
         },
24
         },
19
     },
25
     },
20
 })
26
 })

Ładowanie…
Anuluj
Zapisz