Explorar el Código

:recycle: reformatting everything

tags/0.0.1
j hace 4 años
padre
commit
9ae6c671e1
Se han modificado 37 ficheros con 8954 adiciones y 8788 borrados
  1. 11
    0
      frontend/.eslintrc.json
  2. 0
    8
      frontend/.prettierrc
  3. 13
    0
      frontend/.prettierrc.json
  4. 6
    5
      frontend/README.md
  5. 14
    14
      frontend/index.html
  6. 8530
    8402
      frontend/package-lock.json
  7. 34
    28
      frontend/package.json
  8. 3
    3
      frontend/postcss.config.js
  9. 16
    10
      frontend/src/App.vue
  10. 11
    7
      frontend/src/components/HelloWorld.vue
  11. 11
    10
      frontend/src/components/card.vue
  12. 42
    35
      frontend/src/components/form.vue
  13. 10
    12
      frontend/src/components/icon.vue
  14. 15
    17
      frontend/src/components/navbar.vue
  15. 26
    20
      frontend/src/entities/_modules.js
  16. 2
    4
      frontend/src/entities/grouping/grouping.js
  17. 5
    5
      frontend/src/entities/grouping/grouping.schema.js
  18. 0
    1
      frontend/src/entities/index.js
  19. 2
    4
      frontend/src/entities/profile/profile.js
  20. 8
    10
      frontend/src/entities/profile/profile.schema.js
  21. 1
    1
      frontend/src/entities/profile/profile.spec.js
  22. 3
    3
      frontend/src/entities/response/response.schema.js
  23. 10
    8
      frontend/src/entities/survey/survey.schema.js
  24. 13
    6
      frontend/src/services/grouping.service.js
  25. 1
    1
      frontend/src/services/index.js
  26. 3
    3
      frontend/src/services/profile.service.js
  27. 2
    4
      frontend/src/sss/import.css
  28. 3
    3
      frontend/src/views/About.vue
  29. 3
    3
      frontend/src/views/AcctSettings.vue
  30. 94
    98
      frontend/src/views/Chat.vue
  31. 4
    4
      frontend/src/views/EditProfile.vue
  32. 3
    3
      frontend/src/views/EditSurvey.vue
  33. 33
    33
      frontend/src/views/Match.vue
  34. 6
    6
      frontend/src/views/SearchSettings.vue
  35. 1
    2
      frontend/src/views/account.vue
  36. 8
    8
      frontend/src/views/home.vue
  37. 7
    7
      frontend/vite.config.js

+ 11
- 0
frontend/.eslintrc.json Ver fichero

@@ -0,0 +1,11 @@
1
+{
2
+    "env": {
3
+        "node": true
4
+    },
5
+    "extends": [
6
+        "eslint:recommended",
7
+        "plugin:vue/vue3-recommended",
8
+        "prettier"
9
+    ],
10
+    "rules": {}
11
+}

+ 0
- 8
frontend/.prettierrc Ver fichero

@@ -1,8 +0,0 @@
1
-{
2
-    "trailingComma": "all",
3
-    "tabWidth": 4,
4
-    "semi": false,
5
-    "singleQuote": true,
6
-    "bracketSpacing": true,
7
-    "arrowParens": "avoid"
8
-}

+ 13
- 0
frontend/.prettierrc.json Ver fichero

@@ -0,0 +1,13 @@
1
+{
2
+    "trailingComma": "all",
3
+    "tabWidth": 4,
4
+    "semi": false,
5
+    "singleQuote": true,
6
+    "bracketSpacing": true,
7
+    "arrowParens": "avoid",
8
+    "pugAttributeSeparator": "none",
9
+    "pugSortAttributes": "asc",
10
+    "pugFramework": "vue",
11
+    "pugSingleFileComponentIndentation": false,
12
+    "pugClassNotation": "literal"
13
+}

+ 6
- 5
frontend/README.md Ver fichero

@@ -7,9 +7,10 @@ An API for the siimee application
7 7
 You will need...
8 8
 
9 9
 ### Node.js 14+
10
-* OSX: `brew install node` using [Homebrew](http://brew.sh/)
11
-* Linux: `apt install nodejs` ([see Ubuntu/Debian specific instructions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)) or `pacman -S nodejs` (Arch Linux)
12
-* Windows: [Install](https://nodejs.org/en/download/)
10
+
11
+-   OSX: `brew install node` using [Homebrew](http://brew.sh/)
12
+-   Linux: `apt install nodejs` ([see Ubuntu/Debian specific instructions](https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions)) or `pacman -S nodejs` (Arch Linux)
13
+-   Windows: [Install](https://nodejs.org/en/download/)
13 14
 
14 15
 ## :package: Installation
15 16
 
@@ -29,5 +30,5 @@ TBD
29 30
 
30 31
 ## :heart: Built With
31 32
 
32
-* [Vue.js](https://vuejs.org/) - Our framework
33
-* [Vite](https://vitejs.dev/) - Next generation build tooling
33
+-   [Vue.js](https://vuejs.org/) - Our framework
34
+-   [Vite](https://vitejs.dev/) - Next generation build tooling

+ 14
- 14
frontend/index.html Ver fichero

@@ -1,17 +1,17 @@
1 1
 <!DOCTYPE html>
2 2
 <html lang="en">
3
-  <head>
4
-    <meta charset="UTF-8" />
5
-    <link rel="icon" href="/favicon.ico" />
6
-    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
-    <title>Vite App</title>
8
-  </head>
9
-  <body>
10
-    <div id="app"></div>
11
-    <script>
12
-      // DUMB shim 
13
-      var global = window;
14
-    </script>
15
-    <script type="module" src="/src/main.js"></script>
16
-  </body>
3
+    <head>
4
+        <meta charset="UTF-8" />
5
+        <link rel="icon" href="/favicon.ico" />
6
+        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+        <title>Vite App</title>
8
+    </head>
9
+    <body>
10
+        <div id="app"></div>
11
+        <script>
12
+            // DUMB shim
13
+            var global = window
14
+        </script>
15
+        <script type="module" src="/src/main.js"></script>
16
+    </body>
17 17
 </html>

+ 8530
- 8402
frontend/package-lock.json
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 34
- 28
frontend/package.json Ver fichero

@@ -1,30 +1,36 @@
1 1
 {
2
-  "name": "vite-project",
3
-  "version": "0.0.0",
4
-  "scripts": {
5
-    "dev": "vite",
6
-    "build": "vite build",
7
-    "serve": "vite preview"
8
-  },
9
-  "dependencies": {
10
-    "events": "^3.3.0",
11
-    "joi": "^17.4.0",
12
-    "process": "^0.11.10",
13
-    "vue": "^3.0.5",
14
-    "vue-router": "^4.0.12"
15
-  },
16
-  "devDependencies": {
17
-    "@vitejs/plugin-vue": "^1.2.2",
18
-    "@vue/compiler-sfc": "^3.0.5",
19
-    "autoprefixer": "^10.2.5",
20
-    "naive-ui": "^2.20.3",
21
-    "postcss": "^8.2.13",
22
-    "postcss-calc": "^8.0.0",
23
-    "postcss-import": "^14.0.1",
24
-    "precss": "^4.0.0",
25
-    "pug": "^3.0.2",
26
-    "pug-plain-loader": "^1.1.0",
27
-    "sugarss": "^3.0.3",
28
-    "vite": "^2.2.3"
29
-  }
2
+    "name": "vite-project",
3
+    "version": "0.0.0",
4
+    "scripts": {
5
+        "dev": "vite",
6
+        "build": "vite build",
7
+        "serve": "vite preview",
8
+        "lint": "eslint --ext .js,.vue --fix src",
9
+        "format": "prettier .  --write"
10
+    },
11
+    "dependencies": {
12
+        "events": "^3.3.0",
13
+        "joi": "^17.4.0",
14
+        "process": "^0.11.10",
15
+        "vue": "^3.0.5",
16
+        "vue-router": "^4.0.12"
17
+    },
18
+    "devDependencies": {
19
+        "@prettier/plugin-pug": "^1.17.3",
20
+        "@vitejs/plugin-vue": "^1.2.2",
21
+        "@vue/compiler-sfc": "^3.0.5",
22
+        "autoprefixer": "^10.2.5",
23
+        "eslint": "^8.3.0",
24
+        "eslint-config-prettier": "^8.3.0",
25
+        "eslint-plugin-vue": "^8.1.1",
26
+        "naive-ui": "^2.20.3",
27
+        "postcss": "^8.2.13",
28
+        "postcss-calc": "^8.0.0",
29
+        "postcss-import": "^14.0.1",
30
+        "precss": "^4.0.0",
31
+        "pug": "^3.0.2",
32
+        "pug-plain-loader": "^1.1.0",
33
+        "sugarss": "^3.0.3",
34
+        "vite": "^2.2.3"
35
+    }
30 36
 }

+ 3
- 3
frontend/postcss.config.js Ver fichero

@@ -4,6 +4,6 @@ module.exports = {
4 4
         require('postcss-import'),
5 5
         require('postcss-calc'),
6 6
         require('precss'),
7
-        require('autoprefixer')
8
-    ]
9
-}
7
+        require('autoprefixer'),
8
+    ],
9
+}

+ 16
- 10
frontend/src/App.vue Ver fichero

@@ -14,7 +14,7 @@ import { Connector } from '@/utils/db'
14 14
 import {
15 15
     fetchProfilesByUserId,
16 16
     fetchMembershipsByProfileId,
17
-    postMembershipByProfileId
17
+    postMembershipByProfileId,
18 18
 } from '@/services'
19 19
 
20 20
 import helloWorld from '@/components/HelloWorld.vue'
@@ -25,7 +25,6 @@ import navbar from '@/components/navbar.vue'
25 25
 export default {
26 26
     components: { card, 'siimee-form': form, helloWorld, navbar },
27 27
     setup() {
28
-
29 28
         const cards = ref([
30 29
             { name: 'jwick' },
31 30
             { name: 'hwick' },
@@ -50,8 +49,10 @@ export default {
50 49
                 step.forEach(prompt => {
51 50
                     stepWithPrompts.push({
52 51
                         ...prompt,
53
-                        category: responsesById[prompt.id]['response_key_category'],
54
-                        question: responsesById[prompt.id]['response_key_prompt'],
52
+                        category:
53
+                            responsesById[prompt.id]['response_key_category'],
54
+                        question:
55
+                            responsesById[prompt.id]['response_key_prompt'],
55 56
                     })
56 57
                 })
57 58
                 return stepWithPrompts
@@ -62,15 +63,19 @@ export default {
62 63
         const t = async () => {
63 64
             const tempProfiles = await fetchProfilesByUserId(1)
64 65
             let groupings = []
65
-            for(let p of tempProfiles) {
66
-                const memberships = await fetchMembershipsByProfileId(p.profile_id)
66
+            for (let p of tempProfiles) {
67
+                const memberships = await fetchMembershipsByProfileId(
68
+                    p.profile_id,
69
+                )
67 70
                 groupings.push(memberships)
68 71
             }
69 72
             console.log(groupings)
70 73
             groupings = []
71 74
             await postMembershipByProfileId({ profileId: 1, targetId: 22 })
72
-            for(let p of tempProfiles) {
73
-                const memberships = await fetchMembershipsByProfileId(p.profile_id)
75
+            for (let p of tempProfiles) {
76
+                const memberships = await fetchMembershipsByProfileId(
77
+                    p.profile_id,
78
+                )
74 79
                 groupings.push(memberships)
75 80
             }
76 81
             console.log(groupings)
@@ -79,13 +84,14 @@ export default {
79 84
         return {
80 85
             cards,
81 86
             remove,
82
-            completedForm
87
+            completedForm,
83 88
         }
84
-    }
89
+    },
85 90
 }
86 91
 </script>
87 92
 
88 93
 <style lang="postcss">
94
+// prettier-ignore
89 95
 @import './sss/theme.sss'
90 96
 
91 97
 #app

+ 11
- 7
frontend/src/components/HelloWorld.vue Ver fichero

@@ -1,12 +1,12 @@
1 1
 <template lang="pug">
2
-.wrapper(v-if="state.loaded")
2
+.wrapper
3 3
     h1 {{ msg }}
4 4
 
5 5
     p
6
-        a(href="https://vitejs.dev/guide/features.html" target="_blank") Vite Documentation |
7
-        a(href="https://v3.vuejs.org/" target="_blank") Vue 3 Documentation
6
+        a(href='https://vitejs.dev/guide/features.html' target='_blank') Vite Documentation |
7
+        a(href='https://v3.vuejs.org/' target='_blank') Vue 3 Documentation
8 8
 
9
-    button(@click="state.count++") count is: {{ state.count }}
9
+    button(@click='state.count++') count is: {{ state.count }}
10 10
 
11 11
     p Edit
12 12
     code components/HelloWorld.vue
@@ -20,12 +20,16 @@ import { api } from '@/utils'
20 20
 import { Profile } from '@/entities/profile'
21 21
 
22 22
 defineProps({
23
-    msg: String
23
+    msg: {
24
+        type: String,
25
+        default: 'default msg',
26
+    },
24 27
 })
28
+
25 29
 const state = reactive({
26 30
     count: 0,
27 31
     loaded: false,
28
-    profile: null
32
+    profile: null,
29 33
 })
30 34
 
31 35
 state.profile = new Profile({
@@ -34,7 +38,7 @@ state.profile = new Profile({
34 38
     apt: 2,
35 39
     city: 'candyland',
36 40
     state: 'lollipop',
37
-    zip: 90002
41
+    zip: 90002,
38 42
 })
39 43
 // console.log(state.profile)
40 44
 // console.log(state.profile.isValid())

+ 11
- 10
frontend/src/components/card.vue Ver fichero

@@ -1,28 +1,28 @@
1 1
 <template lang="pug">
2 2
 .card.f-col.start.b-solid.rounded.bg-primary.mr-1
3
-    .front(v-if="!state.flipped")
3
+    .front(v-if='!state.flipped')
4 4
         header.t-right.dark.ph-1.pt-1
5 5
             h3 hidden
6 6
 
7 7
         main.ph-1
8 8
             section
9
-                img(alt="Vue logo" src="@/assets/logo.png").w-full
9
+                img.w-full(alt='Vue logo' src='@/assets/logo.png')
10 10
 
11 11
         footer.ph-1.b-1
12
-            button(@click="state.count++").b-solid.rounded.p-0 {{ state.count }}
13
-            button(@click="flip").b-solid.rounded.p-0 flip
14
-            button(@click="close").b-solid.rounded.p-0 close
12
+            button.b-solid.rounded.p-0(@click='state.count++') {{ state.count }}
13
+            button.b-solid.rounded.p-0(@click='flip') flip
14
+            button.b-solid.rounded.p-0(@click='close') close
15 15
     .back(v-else)
16 16
         header.t-right.dark.ph-1.pt-1
17 17
             h3 revealed: {{ card.name }}
18 18
 
19 19
         main.ph-1
20 20
             section
21
-                img(alt="Vue logo" src="@/assets/logo.png").w-full
21
+                img.w-full(alt='Vue logo' src='@/assets/logo.png')
22 22
 
23 23
         footer.ph-1.b-1
24
-            button(@click="flip").b-solid.rounded.p-0 unflip
25
-            button(@click="close").b-solid.rounded.p-0 close
24
+            button.b-solid.rounded.p-0(@click='flip') unflip
25
+            button.b-solid.rounded.p-0(@click='close') close
26 26
 </template>
27 27
 
28 28
 <script setup>
@@ -32,14 +32,14 @@ const instance = getCurrentInstance()
32 32
 
33 33
 const props = defineProps({
34 34
     msg: String,
35
-    card: Object
35
+    card: Object,
36 36
 })
37 37
 
38 38
 const state = reactive({
39 39
     count: 0,
40 40
     loaded: false,
41 41
     profile: null,
42
-    flipped: false
42
+    flipped: false,
43 43
 })
44 44
 
45 45
 const close = e => {
@@ -51,6 +51,7 @@ const flip = e => {
51 51
 </script>
52 52
 
53 53
 <style lang="postcss">
54
+// prettier-ignore
54 55
 @import '@/sss/theme.sss'
55 56
 
56 57
 .card

+ 42
- 35
frontend/src/components/form.vue Ver fichero

@@ -1,30 +1,31 @@
1 1
 <template lang="pug">
2
-.form.f-col.start.mr-1.w-full(v-if="form.length")
2
+.form.f-col.start.mr-1.w-full(v-if='form.length')
3 3
     header
4 4
         p answers to save: {{ answers }}
5 5
 
6
-    ul(v-for="(step, i) in form").w-full
7
-        li(
8
-            v-if="step && step.length"
9
-            v-for="prompt in step" v-show="(i + 1) == state.step"
10
-        ).f-row.start.b-solid.p-0
6
+    ul.w-full(v-for='(step, i) in form')
7
+        li.f-row.start.b-solid.p-0(
8
+            v-for='prompt in step'
9
+            v-if='step && step.length'
10
+            v-show='(i + 1) == state.step'
11
+        )
11 12
             h3 {{ prompt.question }}?
12
-            .response-wrapper(v-if="prompt.type === 'input-string'")
13
-                label {{prompt.type}}
14
-                input(v-model="answers[makeKebob(prompt.question)]")
15
-            .response-wrapper(v-else-if="prompt.type === 'tag-cloud'")
16
-                label {{prompt.type}}
17
-                button(
18
-                    v-for="response in prompt.responses"
19
-                    :prompt-question="makeKebob(prompt.question)"
20
-                    @click="respondFromTag"
21
-                    :disabled="response == answers[makeKebob(prompt.question)]"
22
-                ).p-0 {{ response }}
23
-    
13
+            .response-wrapper(v-if='prompt.type === "input-string"')
14
+                label {{ prompt.type }}
15
+                input(v-model='answers[makeKebob(prompt.question)]')
16
+            .response-wrapper(v-else-if='prompt.type === "tag-cloud"')
17
+                label {{ prompt.type }}
18
+                button.p-0(
19
+                    :disabled='response == answers[makeKebob(prompt.question)]'
20
+                    :prompt-question='makeKebob(prompt.question)'
21
+                    @click='respondFromTag'
22
+                    v-for='response in prompt.responses'
23
+                ) {{ response }}
24
+
24 25
     footer.f-row.w-full
25
-        button(@click="back" :disabled="state.step == 1").p-1 back
26
-        button(@click="next" :disabled="state.step == form.length").p-1 next
27
-        button(@click="next" :disabled="state.step != form.length").p-1 save
26
+        button.p-1(:disabled='state.step == 1' @click='back') back
27
+        button.p-1(:disabled='state.step == form.length' @click='next') next
28
+        button.p-1(:disabled='state.step != form.length' @click='next') save
28 29
         .f-grow
29 30
         p step: {{ state.step }} of {{ form.length }}
30 31
 </template>
@@ -34,23 +35,23 @@ import Joi from 'joi'
34 35
 import { validatorMapping, makeKebob } from '@/utils'
35 36
 import { defineProps, reactive } from 'vue'
36 37
 
37
-const props = defineProps({ 
38
-    form: { 
38
+const props = defineProps({
39
+    form: {
39 40
         type: Array,
40
-        required: true
41
-    } 
41
+        required: true,
42
+    },
42 43
 })
43 44
 /**
44 45
  * Our form is comprised of steps, and each step has a series of questions
45
-*/
46
+ */
46 47
 const state = reactive({ step: 1 })
47 48
 
48 49
 /**
49
- * Create state object to store answers based on the questions in formSteps 
50
+ * Create state object to store answers based on the questions in formSteps
50 51
  */
51 52
 const answers = reactive({})
52 53
 const resetAnswers = () => {
53
-    Object.keys(answers).forEach(key => answers[key] = null)
54
+    Object.keys(answers).forEach(key => (answers[key] = null))
54 55
 }
55 56
 resetAnswers()
56 57
 /**
@@ -58,7 +59,8 @@ resetAnswers()
58 59
  */
59 60
 const respondFromTag = e => {
60 61
     const answer = e.target.textContent
61
-    const questionKey = e.target.attributes.getNamedItem('prompt-question').nodeValue
62
+    const questionKey =
63
+        e.target.attributes.getNamedItem('prompt-question').nodeValue
62 64
     answers[questionKey] = answer
63 65
 }
64 66
 /**
@@ -81,32 +83,37 @@ const isValid = step => {
81 83
  */
82 84
 const next = e => {
83 85
     const validity = isValid(state.step - 1)
84
-    if(validity.error) return console.error(validity.error)
86
+    if (validity.error) return console.error(validity.error)
85 87
 
86 88
     // Save or next
87
-    if(state.step === props.form.length) {
89
+    if (state.step === props.form.length) {
88 90
         alert('saved...')
89 91
         resetAnswers()
90 92
         state.step = 1
91
-    } else if(state.step < props.form.length) {
93
+    } else if (state.step < props.form.length) {
92 94
         state.step++
93 95
     } else {
94
-        console.error(`Cannot perform action: next() | on form step: ${state.step} of ${props.formSteps.length}`)        
96
+        console.error(
97
+            `Cannot perform action: next() | on form step: ${state.step} of ${props.formSteps.length}`,
98
+        )
95 99
     }
96 100
 }
97 101
 /**
98 102
  * Back a step in the form
99 103
  */
100 104
 const back = e => {
101
-    if(state.step > 1) {
105
+    if (state.step > 1) {
102 106
         state.step--
103 107
     } else {
104
-        console.error(`Cannot perform action: back() | on form step: ${state.step} of ${props.formSteps.length}`)        
108
+        console.error(
109
+            `Cannot perform action: back() | on form step: ${state.step} of ${props.formSteps.length}`,
110
+        )
105 111
     }
106 112
 }
107 113
 </script>
108 114
 
109 115
 <style lang="postcss">
116
+// prettier-ignore
110 117
 @import '@/sss/theme.sss'
111 118
 
112 119
 .form

+ 10
- 12
frontend/src/components/icon.vue Ver fichero

@@ -3,19 +3,17 @@
3 3
 </template>
4 4
 
5 5
 <script>
6
-export default {
7
-  
8
-}
6
+export default {}
9 7
 </script>
10 8
 
11 9
 <style lang="postcss">
12 10
 .icon
13
-  display: block
14
-  border-radius: 50%
15
-  width: 48px
16
-  height: 48px
17
-  background-image: url('https://i.imgur.com/WFqSBgc.png')
18
-  background-color: rgba(20,20,20,0.3)
19
-  background-position: 50% 0
20
-  background-size: auto 125%
21
-</style>
11
+    display: block
12
+    border-radius: 50%
13
+    width: 48px
14
+    height: 48px
15
+    background-image: url('https://i.imgur.com/WFqSBgc.png')
16
+    background-color: rgba(20,20,20,0.3)
17
+    background-position: 50% 0
18
+    background-size: auto 125%
19
+</style>

+ 15
- 17
frontend/src/components/navbar.vue Ver fichero

@@ -1,25 +1,23 @@
1 1
 <template lang="pug">
2
-nav(id="nav")
3
-  router-link(to="/") Browse
4
-  router-link(to="/match") Match
5
-  router-link(to="/account") Account
2
+nav#nav 
3
+    router-link(to='/') Browse
4
+    router-link(to='/match') Match
5
+    router-link(to='/account') Account
6 6
 </template>
7 7
 
8 8
 <script>
9
-export default {
10
-  
11
-}
9
+export default {}
12 10
 </script>
13 11
 
14 12
 <style lang="postcss">
15 13
 nav
16
-  display: flex
17
-  justify-content: space-evenly
18
-  background-color: #000
19
-  color: #fff
20
-  padding: 40px 0
21
-  margin: 0
22
-  position: absolute
23
-  bottom: 0
24
-  width: 100%
25
-</style>
14
+    display: flex
15
+    justify-content: space-evenly
16
+    background-color: #000
17
+    color: #fff
18
+    padding: 40px 0
19
+    margin: 0
20
+    position: absolute
21
+    bottom: 0
22
+    width: 100%
23
+</style>

+ 26
- 20
frontend/src/entities/_modules.js Ver fichero

@@ -6,8 +6,8 @@
6 6
  * Data common to every single data TYPE
7 7
  * Universal fields required for storing anything
8 8
  */
9
- class _baseRecord {
10
-     /**
9
+class _baseRecord {
10
+    /**
11 11
      * Standard record to extend with more detail
12 12
      */
13 13
     constructor() {
@@ -40,7 +40,7 @@ const allModules = {
40 40
      */
41 41
     parent: ({ id = '' }) => {
42 42
         const module = {
43
-            'parentId': id
43
+            parentId: id,
44 44
         }
45 45
         return module
46 46
     },
@@ -50,9 +50,9 @@ const allModules = {
50 50
      */
51 51
     hourly: ({ hours, rate }) => {
52 52
         let module = {
53
-            'hours': hours,
54
-            'rate': rate,
55
-            'total': hours * rate
53
+            hours: hours,
54
+            rate: rate,
55
+            total: hours * rate,
56 56
         }
57 57
         return module
58 58
     },
@@ -63,8 +63,8 @@ const allModules = {
63 63
      */
64 64
     contact: ({ name, email }) => {
65 65
         const module = {
66
-            'name': name,
67
-            'email': email
66
+            name: name,
67
+            email: email,
68 68
         }
69 69
 
70 70
         // This is used for checking, maybe validation in the future(?)
@@ -83,8 +83,8 @@ const allModules = {
83 83
      */
84 84
     transaction: ({ amount, date }) => {
85 85
         let module = {
86
-            'amount': amount,
87
-            'date': date
86
+            amount: amount,
87
+            date: date,
88 88
         }
89 89
         return module
90 90
     },
@@ -95,9 +95,9 @@ const allModules = {
95 95
      */
96 96
     subjNote: ({ subject, note, status }) => {
97 97
         let module = {
98
-            'subject': subject,
99
-            'note': note,
100
-            'status': status
98
+            subject: subject,
99
+            note: note,
100
+            status: status,
101 101
         }
102 102
 
103 103
         if (!status) {
@@ -112,17 +112,23 @@ const allModules = {
112 112
      * Use location() for anything that needs to store location information
113 113
      * (People, companies, etc)
114 114
      */
115
-    location: ({ street = '', apt = '', city = '', state = '', zip = 11111 }) => {
115
+    location: ({
116
+        street = '',
117
+        apt = '',
118
+        city = '',
119
+        state = '',
120
+        zip = 11111,
121
+    }) => {
116 122
         const module = {
117
-            'address': street,
118
-            'apt': apt,
119
-            'city': city,
120
-            'state': state,
121
-            'zip': zip
123
+            address: street,
124
+            apt: apt,
125
+            city: city,
126
+            state: state,
127
+            zip: zip,
122 128
         }
123 129
 
124 130
         return module
125 131
     },
126 132
 }
127 133
 
128
-export { _baseRecord, allModules }
134
+export { _baseRecord, allModules }

+ 2
- 4
frontend/src/entities/grouping/grouping.js Ver fichero

@@ -32,10 +32,8 @@ class Grouping extends _baseRecord {
32 32
          * Log out some useful error messages
33 33
          * TODO: Send validate.error to logging error handler
34 34
          */
35
-        if(validate.error) {
36
-            console.error(
37
-                `error: ${validate.error} - ${this.type} validation`
38
-            )
35
+        if (validate.error) {
36
+            console.error(`error: ${validate.error} - ${this.type} validation`)
39 37
         }
40 38
 
41 39
         /** validate(this) always returns something so force it to a bool */

+ 5
- 5
frontend/src/entities/grouping/grouping.schema.js Ver fichero

@@ -6,7 +6,7 @@ import Joi from 'joi'
6 6
  * uses the module system to use common fields
7 7
  * but sets fields with our validation types
8 8
  * @constructor
9
-*/
9
+ */
10 10
 const groupingSchema = {
11 11
     type: 'object',
12 12
     properties: Joi.object().keys({
@@ -19,13 +19,13 @@ const groupingSchema = {
19 19
         /** our fields */
20 20
         grouping_id: Joi.number().required(),
21 21
         grouping_name: Joi.string(),
22
-        grouping_type: Joi.string()
22
+        grouping_type: Joi.string(),
23 23
     }),
24 24
     /** fields required before saving */
25
-    required: [ 'grouping_id' ],
25
+    required: ['grouping_id'],
26 26
     validate(instance) {
27 27
         return this.properties.validate(instance)
28
-    }
28
+    },
29 29
 }
30 30
 
31
-export { groupingSchema }
31
+export { groupingSchema }

+ 0
- 1
frontend/src/entities/index.js Ver fichero

@@ -5,4 +5,3 @@ export * from './response'
5 5
 export * from './profile'
6 6
 export * from './survey'
7 7
 export * from './grouping'
8
-

+ 2
- 4
frontend/src/entities/profile/profile.js Ver fichero

@@ -35,10 +35,8 @@ class Profile extends _baseRecord {
35 35
          * Log out some useful error messages
36 36
          * TODO: Send validate.error to logging error handler
37 37
          */
38
-        if(validate.error) {
39
-            console.error(
40
-                `error: ${validate.error} - ${this.type} validation`
41
-            )
38
+        if (validate.error) {
39
+            console.error(`error: ${validate.error} - ${this.type} validation`)
42 40
         }
43 41
 
44 42
         /** validate(this) always returns something so force it to a bool */

+ 8
- 10
frontend/src/entities/profile/profile.schema.js Ver fichero

@@ -7,7 +7,7 @@ import { allModules, responseSchema } from '..'
7 7
  * uses the module system to use common fields
8 8
  * but sets fields with our validation types
9 9
  * @constructor
10
-*/
10
+ */
11 11
 const profileSchema = {
12 12
     type: 'object',
13 13
     properties: Joi.object().keys({
@@ -20,15 +20,13 @@ const profileSchema = {
20 20
         /** our fields */
21 21
         email: Joi.string().email({
22 22
             minDomainSegments: 2,
23
-            tlds: { allow: ['com', 'net'] }
23
+            tlds: { allow: ['com', 'net'] },
24 24
         }),
25 25
 
26 26
         /** fields that should match backend service*/
27 27
         user_id: Joi.number(),
28 28
         profile_id: Joi.number(),
29
-        responses: Joi.array().items(
30
-            responseSchema
31
-        ), // response entity schema goes here
29
+        responses: Joi.array().items(responseSchema), // response entity schema goes here
32 30
         user_type: Joi.string(),
33 31
 
34 32
         /** tricky module system fields */
@@ -37,14 +35,14 @@ const profileSchema = {
37 35
             apt: Joi.string(),
38 36
             city: Joi.string(),
39 37
             state: Joi.string(),
40
-            zip: Joi.number()
41
-        })
38
+            zip: Joi.number(),
39
+        }),
42 40
     }),
43 41
     /** fields required before saving */
44
-    required: [ ],
42
+    required: [],
45 43
     validate(instance) {
46 44
         return this.properties.validate(instance)
47
-    }
45
+    },
48 46
 }
49 47
 
50
-export { profileSchema }
48
+export { profileSchema }

+ 1
- 1
frontend/src/entities/profile/profile.spec.js Ver fichero

@@ -1 +1 @@
1
-// Write your profile test here
1
+// Write your profile test here

+ 3
- 3
frontend/src/entities/response/response.schema.js Ver fichero

@@ -3,12 +3,12 @@ import Joi from 'joi'
3 3
 
4 4
 /**
5 5
  * response schema object
6
-*/
6
+ */
7 7
 const responseSchema = Joi.object({
8 8
     profile_id: Joi.number(),
9 9
     response_id: Joi.number(),
10 10
     response_key_id: Joi.number(),
11
-    val:  Joi.string(),
11
+    val: Joi.string(),
12 12
 })
13 13
 
14
-export { responseSchema }
14
+export { responseSchema }

+ 10
- 8
frontend/src/entities/survey/survey.schema.js Ver fichero

@@ -7,7 +7,7 @@ import { allModules } from '..'
7 7
  * uses the module system to use common fields
8 8
  * but sets fields with our validation types
9 9
  * @constructor
10
-*/
10
+ */
11 11
 const surveySchema = {
12 12
     type: 'object',
13 13
     properties: Joi.object().keys({
@@ -18,16 +18,18 @@ const surveySchema = {
18 18
         type: Joi.string(),
19 19
 
20 20
         /** our fields */
21
-        email: Joi.string().email({
22
-            minDomainSegments: 2,
23
-            tlds: { allow: ['com', 'net'] }
24
-        }).required(),
21
+        email: Joi.string()
22
+            .email({
23
+                minDomainSegments: 2,
24
+                tlds: { allow: ['com', 'net'] },
25
+            })
26
+            .required(),
25 27
     }),
26 28
     /** fields required before saving */
27
-    required: [ 'email' ],
29
+    required: ['email'],
28 30
     validate(instance) {
29 31
         return this.properties.validate(instance)
30
-    }
32
+    },
31 33
 }
32 34
 
33
-export { surveySchema }
35
+export { surveySchema }

+ 13
- 6
frontend/src/services/grouping.service.js Ver fichero

@@ -11,22 +11,29 @@ import { Grouping } from '../entities'
11 11
 const fetchMembershipsByProfileId = async profileId => {
12 12
     const membershipsForProfileId = await db.get(`/membership/${profileId}`)
13 13
     const validGroupingInstances = []
14
-    for(let membership of membershipsForProfileId) {
14
+    for (let membership of membershipsForProfileId) {
15 15
         const grouping = new Grouping(membership)
16
-        if(grouping.isValid()) {
16
+        if (grouping.isValid()) {
17 17
             validGroupingInstances.push(grouping)
18 18
         }
19 19
     }
20 20
     return validGroupingInstances
21 21
 }
22 22
 
23
-const postMembershipByProfileId = async ({ profileId, targetId, groupingType = 'match' }) => {
23
+const postMembershipByProfileId = async ({
24
+    profileId,
25
+    targetId,
26
+    groupingType = 'match',
27
+}) => {
24 28
     const membership = {
25 29
         target_id: targetId,
26 30
         grouping_type: groupingType,
27
-        grouping_name: `delete_${profileId}_${targetId}`
31
+        grouping_name: `delete_${profileId}_${targetId}`,
28 32
     }
29
-    const createdMembershipRecord = await db.post(`/membership/${profileId}/join`, membership)
33
+    const createdMembershipRecord = await db.post(
34
+        `/membership/${profileId}/join`,
35
+        membership,
36
+    )
30 37
     return createdMembershipRecord
31 38
 }
32
-export { fetchMembershipsByProfileId, postMembershipByProfileId }
39
+export { fetchMembershipsByProfileId, postMembershipByProfileId }

+ 1
- 1
frontend/src/services/index.js Ver fichero

@@ -1,2 +1,2 @@
1 1
 export * from './profile.service'
2
-export * from './grouping.service'
2
+export * from './grouping.service'

+ 3
- 3
frontend/src/services/profile.service.js Ver fichero

@@ -11,13 +11,13 @@ import { Profile } from '../entities/profile'
11 11
 const fetchProfilesByUserId = async userId => {
12 12
     const profilesForUserId = await db.get(`/user/${userId}/profiles`)
13 13
     const validProfileInstances = []
14
-    for(let profileData of profilesForUserId) {
14
+    for (let profileData of profilesForUserId) {
15 15
         const profile = new Profile(profileData)
16
-        if(profile.isValid()) {
16
+        if (profile.isValid()) {
17 17
             validProfileInstances.push(profile)
18 18
         }
19 19
     }
20 20
     return validProfileInstances
21 21
 }
22 22
 
23
-export { fetchProfilesByUserId }
23
+export { fetchProfilesByUserId }

+ 2
- 4
frontend/src/sss/import.css Ver fichero

@@ -1,4 +1,2 @@
1
-@import './partials/_reset.sss'
2
-@import './partials/_ratios.sss'
3
-@import './partials/_helpers.sss'
4
-@import './partials/_typography.sss'
1
+@import './partials/_reset.sss' @import './partials/_ratios.sss' @import
2
+    './partials/_helpers.sss' @import './partials/_typography.sss';

+ 3
- 3
frontend/src/views/About.vue Ver fichero

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="about">
3
-    <h1>This is an about page</h1>
4
-  </div>
2
+    <div class="about">
3
+        <h1>This is an about page</h1>
4
+    </div>
5 5
 </template>

+ 3
- 3
frontend/src/views/AcctSettings.vue Ver fichero

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="AcctSettings">
3
-    <h1>Account Settings</h1>
4
-  </div>
2
+    <div class="AcctSettings">
3
+        <h1>Account Settings</h1>
4
+    </div>
5 5
 </template>

+ 94
- 98
frontend/src/views/Chat.vue Ver fichero

@@ -1,110 +1,106 @@
1 1
 <template>
2
-  <div class="chat">
2
+    <div class="chat">
3
+        <div class="chat--nav">
4
+            <span>&lt; Back</span>
5
+            <h3>Company Name</h3>
6
+            <span>...</span>
7
+        </div>
3 8
 
4
-    <div class="chat--nav">
5
-      <span>&lt; Back</span>
6
-      <h3>Company Name</h3>
7
-      <span>...</span>
8
-    </div>
9
-
10
-    <div class="chat--history">
11
-      <span>Hey there... </span>
12
-    </div>
9
+        <div class="chat--history">
10
+            <span>Hey there... </span>
11
+        </div>
13 12
 
14
-    <div class="message">
15
-      <!-- <h2>Messages</h2> -->
16
-      <span>Type messages here...</span>
13
+        <div class="message">
14
+            <!-- <h2>Messages</h2> -->
15
+            <span>Type messages here...</span>
16
+        </div>
17 17
     </div>
18
-
19
-  </div>
20
-
21 18
 </template>
22 19
 
23 20
 <script>
24
-  import icon from '@/components/icon'
25
-  import card from '@/components/card'
26
-  import { defineComponent } from 'vue'
27
-  import { NButton } from 'naive-ui'
21
+import icon from '@/components/icon'
22
+import card from '@/components/card'
23
+import { defineComponent } from 'vue'
24
+import { NButton } from 'naive-ui'
28 25
 
29
-  export default defineComponent({
26
+export default defineComponent({
30 27
     components: {
31
-      NButton,
32
-      card,
33
-      icon
34
-    }
35
-  })
28
+        NButton,
29
+        card,
30
+        icon,
31
+    },
32
+})
36 33
 </script>
37 34
 
38 35
 <style lang="postcss">
39
-  h3
40
-    margin: 0
41
-  
42
-  .chat
43
-    width: 100%
44
-    display: flex
45
-    flex-flow: column
46
-    /* padding: 20px */
47
-    text-align: left
48
-    height: 90%
49
-  
50
-
51
-  .chat--nav
52
-    display: flex
53
-    flex-direction: row
54
-    justify-content: space-between
55
-    border-bottom: 1px solid rgba(0,0,0,0.5)
56
-    width: 100%
57
-    & > *
58
-      padding: 10px
59
-    
60
-  
61
-
62
-  .chat--history
63
-    padding: 20px
64
-    flex: 1
65
-    overflow: auto
66
-  
67
-
68
-  .row
69
-    display: flex
70
-    flex-direction: row
71
-    /* width: 100vw */
72
-    overflow:scroll
73
-  
74
-
75
-  .message
76
-    position: relative
77
-    bottom: 0
78
-    min-height: 60px
79
-    width: 100%
80
-    display: block
81
-    text-align: left
82
-    /* margin-bottom: 10px */
83
-    background-color: transparent
84
-    border: 1px solid #ccc
85
-    padding: 12px
86
-    
87
-  
88
-  .n-card__content
89
-    padding-top: 0
90
-  
91
-
92
-  .matched
93
-    display: flex
94
-    flex-direction: row
95
-    background-color: rgba(0,0,0,0.0)
96
-    margin-bottom: 12px
97
-    border-bottom: 1px solid rgba(150,150,150,0.25)
98
-  
99
-
100
-  .icon
101
-    /* display: inline-block */
102
-    padding: 8px 12px
103
-    margin: -1px
104
-    /* flex-grow: 0 */
105
-    border-bottom: 1px solid rgba(250,250,250,0.95)
106
-  
107
-  .active
108
-    /* background-color: rgba(250,50,50,0.3) */
109
-  
110
-</style>
36
+h3
37
+  margin: 0
38
+
39
+.chat
40
+  width: 100%
41
+  display: flex
42
+  flex-flow: column
43
+  /* padding: 20px */
44
+  text-align: left
45
+  height: 90%
46
+
47
+
48
+.chat--nav
49
+  display: flex
50
+  flex-direction: row
51
+  justify-content: space-between
52
+  border-bottom: 1px solid rgba(0,0,0,0.5)
53
+  width: 100%
54
+  & > *
55
+    padding: 10px
56
+
57
+
58
+
59
+.chat--history
60
+  padding: 20px
61
+  flex: 1
62
+  overflow: auto
63
+
64
+
65
+.row
66
+  display: flex
67
+  flex-direction: row
68
+  /* width: 100vw */
69
+  overflow:scroll
70
+
71
+
72
+.message
73
+  position: relative
74
+  bottom: 0
75
+  min-height: 60px
76
+  width: 100%
77
+  display: block
78
+  text-align: left
79
+  /* margin-bottom: 10px */
80
+  background-color: transparent
81
+  border: 1px solid #ccc
82
+  padding: 12px
83
+
84
+
85
+.n-card__content
86
+  padding-top: 0
87
+
88
+
89
+.matched
90
+  display: flex
91
+  flex-direction: row
92
+  background-color: rgba(0,0,0,0.0)
93
+  margin-bottom: 12px
94
+  border-bottom: 1px solid rgba(150,150,150,0.25)
95
+
96
+
97
+.icon
98
+  /* display: inline-block */
99
+  padding: 8px 12px
100
+  margin: -1px
101
+  /* flex-grow: 0 */
102
+  border-bottom: 1px solid rgba(250,250,250,0.95)
103
+
104
+.active
105
+  /* background-color: rgba(250,50,50,0.3) */
106
+</style>

+ 4
- 4
frontend/src/views/EditProfile.vue Ver fichero

@@ -1,6 +1,6 @@
1 1
 <template>
2
-  <div class="EditProfile">
3
-    <h1>Edit Profile</h1>
4
-    <p>Edit Photos</p>
5
-  </div>
2
+    <div class="EditProfile">
3
+        <h1>Edit Profile</h1>
4
+        <p>Edit Photos</p>
5
+    </div>
6 6
 </template>

+ 3
- 3
frontend/src/views/EditSurvey.vue Ver fichero

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="EditSurvey">
3
-    <h1>Edit Survey</h1>
4
-  </div>
2
+    <div class="EditSurvey">
3
+        <h1>Edit Survey</h1>
4
+    </div>
5 5
 </template>

+ 33
- 33
frontend/src/views/Match.vue Ver fichero

@@ -1,41 +1,41 @@
1 1
 <template>
2
-<div class="match">
3
-    <div class="matches">
4
-        <h1>Matches</h1>
5
-        <div class="row">
6
-            <card />
7
-            <card />
8
-            <card />
2
+    <div class="match">
3
+        <div class="matches">
4
+            <h1>Matches</h1>
5
+            <div class="row">
6
+                <card />
7
+                <card />
8
+                <card />
9
+            </div>
9 10
         </div>
10
-    </div>
11 11
 
12
-    <div class="messages">
13
-        <h2>Messages</h2>
14
-        <div class="matched active">
15
-            <icon />
16
-            <div class="messagecontent">
17
-                <h3>NSE Tropical</h3>
18
-                Recently active, match now!
12
+        <div class="messages">
13
+            <h2>Messages</h2>
14
+            <div class="matched active">
15
+                <icon />
16
+                <div class="messagecontent">
17
+                    <h3>NSE Tropical</h3>
18
+                    Recently active, match now!
19
+                </div>
19 20
             </div>
20
-        </div>
21 21
 
22
-        <div class="matched">
23
-            <icon />
24
-            <div class="messagecontent">
25
-                <h3>Golden Communications</h3>
26
-                Click to match now!
22
+            <div class="matched">
23
+                <icon />
24
+                <div class="messagecontent">
25
+                    <h3>Golden Communications</h3>
26
+                    Click to match now!
27
+                </div>
27 28
             </div>
28
-        </div>
29 29
 
30
-        <div class="matched">
31
-            <icon />
32
-            <div class="messagecontent">
33
-                <h3>Mojo Solutions</h3>
34
-                Click to match now!
30
+            <div class="matched">
31
+                <icon />
32
+                <div class="messagecontent">
33
+                    <h3>Mojo Solutions</h3>
34
+                    Click to match now!
35
+                </div>
35 36
             </div>
36 37
         </div>
37 38
     </div>
38
-</div>
39 39
 </template>
40 40
 
41 41
 <script>
@@ -45,10 +45,10 @@ import icon from '@/components/icon.vue'
45 45
 import card from '@/components/card.vue'
46 46
 
47 47
 export default defineComponent({
48
-  components: {
49
-    card,
50
-    icon
51
-  }
48
+    components: {
49
+        card,
50
+        icon,
51
+    },
52 52
 })
53 53
 </script>
54 54
 
@@ -56,4 +56,4 @@ export default defineComponent({
56 56
 .row
57 57
     display: flex
58 58
     flex-direction: row
59
-</style>
59
+</style>

+ 6
- 6
frontend/src/views/SearchSettings.vue Ver fichero

@@ -1,8 +1,8 @@
1 1
 <template>
2
-  <div class="SearchSettings">
3
-    <h1>Search Settings</h1>
4
-    <p>Max-Distance | Remote</p>
5
-    <p>Part-time | Full-time</p>
6
-    <p>Current Location</p>
7
-  </div>
2
+    <div class="SearchSettings">
3
+        <h1>Search Settings</h1>
4
+        <p>Max-Distance | Remote</p>
5
+        <p>Part-time | Full-time</p>
6
+        <p>Current Location</p>
7
+    </div>
8 8
 </template>

+ 1
- 2
frontend/src/views/account.vue Ver fichero

@@ -85,5 +85,4 @@ span
85 85
   flex-direction: row
86 86
   justify-content: space-between
87 87
   padding: 0 5vh
88
-
89
-</style>
88
+</style>

+ 8
- 8
frontend/src/views/home.vue Ver fichero

@@ -1,8 +1,8 @@
1 1
 <template lang="pug">
2 2
 .home
3
-  n-button naive test
4
-  img(alt="Vue logo" src="../assets/logo.png")
5
-  hello-world
3
+    n-button naive test
4
+    img(alt='Vue logo' src='../assets/logo.png')
5
+    hello-world(:msg='"this is a message prop"')
6 6
 </template>
7 7
 
8 8
 <script>
@@ -11,10 +11,10 @@ import HelloWorld from '@/components/HelloWorld.vue'
11 11
 import { NButton } from 'naive-ui'
12 12
 
13 13
 export default {
14
-  name: 'Home',
15
-  components: {
16
-    HelloWorld,
17
-    NButton
18
-  }
14
+    name: 'Home',
15
+    components: {
16
+        'hello-world': HelloWorld,
17
+        NButton,
18
+    },
19 19
 }
20 20
 </script>

+ 7
- 7
frontend/vite.config.js Ver fichero

@@ -3,10 +3,10 @@ import vue from '@vitejs/plugin-vue'
3 3
 
4 4
 // https://vitejs.dev/config/
5 5
 export default defineConfig({
6
-  plugins: [vue()],
7
-  resolve: {
8
-    alias: {
9
-      '@': require('path').resolve(__dirname, 'src')
10
-    }
11
-  },
12
-})
6
+    plugins: [vue()],
7
+    resolve: {
8
+        alias: {
9
+            '@': require('path').resolve(__dirname, 'src'),
10
+        },
11
+    },
12
+})

Loading…
Cancelar
Guardar