Przeglądaj źródła

:wrench WIP onboarding answer collection | dynamic tag list

tags/0.0.3^2
juancarbajal98 3 lat temu
rodzic
commit
bcbb965417

+ 1
- 1
backend/db/seeds/04-responses.js Wyświetl plik

@@ -28,7 +28,7 @@ exports.seed = async knex => {
28 28
     for (let i = 1; i <= len; i += 1) {
29 29
         responsesToPush.push(responses.shift())
30 30
         if (i % batchSize === 0 || i > responses.length) {
31
-            await knex('responses').insert(responsesToPush)
31
+            // await knex('responses').insert(responsesToPush)
32 32
             responsesToPush = []
33 33
         }
34 34
     }

+ 40
- 0
frontend/src/components/DynamicTagList.vue Wyświetl plik

@@ -0,0 +1,40 @@
1
+<template lang="pug">
2
+.ListControls(style="display:flex; flex-direction:row;")
3
+    input(type="text" :placeholder='`Add ${placeholder}...`' v-model="newTag")
4
+    w-button.ma1(@click="addTag") +
5
+TagList(:tags="mutableTags")
6
+</template>
7
+<script>
8
+import TagList from './TagList.vue'
9
+export default {
10
+    name: 'DynamicTagList',
11
+    components:{
12
+        TagList,
13
+    },
14
+    props:{
15
+        tags: {
16
+            required: true,
17
+            type: Array,
18
+        },
19
+        placeholder:{
20
+            required: true,
21
+            type: String,
22
+        }
23
+    },
24
+    data() {
25
+        return {
26
+            newTag: null,
27
+            mutableTags: this.tags,
28
+        }    
29
+    },
30
+    methods:{
31
+        addTag(){
32
+            if(!this.newTag){
33
+                console.warn('Type a new tag before adding')
34
+                return
35
+            }
36
+            this.mutableTags.push(this.newTag)
37
+        }
38
+    }
39
+}
40
+</script>

+ 14
- 2
frontend/src/components/onboarding/AccountType.vue Wyświetl plik

@@ -1,7 +1,8 @@
1 1
 <template lang="pug">
2 2
 h3 {Name}, let's get started on your profile while we verify your account
3
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") CANDIDATES
4
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") JOBS
3
+//- w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") CANDIDATES
4
+w-button.ma1.grow(@click="handleSubmit('candidates')") CANDIDATES
5
+w-button.ma1.grow(@click="handleSubmit('jobs')") JOBS
5 6
 </template>
6 7
 <script>
7 8
 export default {
@@ -13,5 +14,16 @@ export default {
13 14
             default: 0
14 15
         }
15 16
     },
17
+    emits: ['go-to-step', 'update-answers'],
18
+    methods: {
19
+        handleSubmit(answer){
20
+            let payload = {
21
+                key: 'AccountType',
22
+                value: answer
23
+            }
24
+            this.$emit('update-answers', payload)
25
+            this.$emit('go-to-step', this.currentStep + 1)
26
+        }
27
+    }
16 28
 }
17 29
 </script>

+ 16
- 3
frontend/src/components/onboarding/CompanyID.vue Wyświetl plik

@@ -1,11 +1,10 @@
1 1
 <template lang="pug">
2 2
 h3 Company ID
3 3
 p PLEASE ENTER YOUR COMPANY ID#:
4
-input(type="text" placeholder="Get this from your admin.")
5
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
4
+input(type="text" placeholder="Get this from your admin." v-model="companyID")
5
+w-button.ma1.grow(@click="handleSubmit") NEXT
6 6
 </template>
7 7
 <script>
8
-// todo add v-model to input, pass down answers array from parent
9 8
 export default {
10 9
     name: 'CompanyID',
11 10
     props: {
@@ -15,5 +14,19 @@ export default {
15 14
             default: 0
16 15
         }
17 16
     },
17
+    emits: ['go-to-step', 'update-answers'],
18
+    data: () => ({
19
+        companyID: null, 
20
+    }),
21
+    methods: {
22
+        handleSubmit(){
23
+            let payload = {
24
+                key: 'CompanyID',
25
+                value: this.companyID
26
+            }
27
+            this.$emit('update-answers', payload)
28
+            this.$emit('go-to-step', this.currentStep + 1)
29
+        }
30
+    }
18 31
 }
19 32
 </script>

+ 8
- 0
frontend/src/components/onboarding/Interests.vue Wyświetl plik

@@ -1,11 +1,16 @@
1 1
 <template lang="pug">
2 2
 h3 Interests
3 3
 p What are some interests you would like in your next candidates?
4
+DynamicTagList(:tags="interests" :placeholder="'interest'")
4 5
 w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5 6
 </template>
6 7
 <script>
8
+import DynamicTagList from '../DynamicTagList.vue'
7 9
 export default {
8 10
     name: 'Interests',
11
+    components:{
12
+        DynamicTagList
13
+    },
9 14
     props: {
10 15
         currentStep:{
11 16
             required: true,
@@ -13,5 +18,8 @@ export default {
13 18
             default: 0
14 19
         }
15 20
     },
21
+    data: () => ({
22
+        interests: []
23
+    })
16 24
 }
17 25
 </script>

+ 8
- 0
frontend/src/components/onboarding/LicensesAndCertifications.vue Wyświetl plik

@@ -1,11 +1,16 @@
1 1
 <template lang="pug">
2 2
 h3 Licenses & Certifications
3 3
 p Are there any licenses and certification requirements?
4
+DynamicTagList(:tags="licensesAndCertifications" :placeholder="'requirement'")
4 5
 w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5 6
 </template>
6 7
 <script>
8
+import DynamicTagList from '../DynamicTagList.vue'
7 9
 export default {
8 10
     name: 'LicensesAndCertifications',
11
+    components:{
12
+        DynamicTagList
13
+    },
9 14
     props: {
10 15
         currentStep:{
11 16
             required: true,
@@ -13,5 +18,8 @@ export default {
13 18
             default: 0
14 19
         }
15 20
     },
21
+    data: () => ({
22
+        licensesAndCertifications: []
23
+    })
16 24
 }
17 25
 </script>

+ 8
- 0
frontend/src/components/onboarding/Location.vue Wyświetl plik

@@ -1,11 +1,16 @@
1 1
 <template lang="pug">
2 2
 h3 Location
3 3
 p Where would you like to select your candidates from?
4
+DynamicTagList(:tags="locations" :placeholder="'location'")
4 5
 w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5 6
 </template>
6 7
 <script>
8
+import DynamicTagList from '../DynamicTagList.vue'
7 9
 export default {
8 10
     name: 'Location',
11
+    components:{
12
+        DynamicTagList
13
+    },
9 14
     props: {
10 15
         currentStep:{
11 16
             required: true,
@@ -13,5 +18,8 @@ export default {
13 18
             default: 0
14 19
         }
15 20
     },
21
+    data: () => ({
22
+        locations: []
23
+    })
16 24
 }
17 25
 </script>

+ 21
- 2
frontend/src/components/onboarding/Role.vue Wyświetl plik

@@ -2,9 +2,10 @@
2 2
 h3 ACTIVELY SEARCHING
3 3
 p What is your role at your company?
4 4
 w-select.mt4(
5
-    :items="[{label: 'RECRUITER'},{label: 'HIRING MANAGER'}]"
5
+    v-model="selected"
6
+    :items="items"
6 7
     placeholder="i am")
7
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
8
+w-button.ma1.grow(@click="handleSubmit") NEXT
8 9
 </template>
9 10
 <script>
10 11
 export default {
@@ -16,5 +17,23 @@ export default {
16 17
             default: 0
17 18
         }
18 19
     },
20
+    data: () => ({
21
+        items: [{label: 'RECRUITER'},{label: 'HIRING MANAGER'}],
22
+        selected: null,
23
+    }),
24
+    methods: {
25
+        handleSubmit(){
26
+            if(!this.selected) {
27
+                console.warn('Please select a role.')
28
+                return
29
+            } 
30
+            let payload = {
31
+                key: 'Role',
32
+                value: this.selected
33
+            }
34
+            this.$emit('update-answers', payload)
35
+            this.$emit('go-to-step', this.currentStep + 1)
36
+        }
37
+    }
19 38
 }
20 39
 </script>

+ 8
- 0
frontend/src/components/onboarding/Skills.vue Wyświetl plik

@@ -1,11 +1,16 @@
1 1
 <template lang="pug">
2 2
 h3 RECRUITER
3 3
 p What are some skills you are looking for at your company?
4
+DynamicTagList(:tags="skills" :placeholder="'skill'")
4 5
 w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5 6
 </template>
6 7
 <script>
8
+import DynamicTagList from '../DynamicTagList.vue'
7 9
 export default {
8 10
     name: 'Skills',
11
+    components:{
12
+        DynamicTagList
13
+    },
9 14
     props: {
10 15
         currentStep:{
11 16
             required: true,
@@ -13,5 +18,8 @@ export default {
13 18
             default: 0
14 19
         }
15 20
     },
21
+    data: () => ({
22
+        skills: []
23
+    })
16 24
 }
17 25
 </script>

+ 0
- 2
frontend/src/views/HomeView.vue Wyświetl plik

@@ -15,7 +15,6 @@ main.view--home
15 15
 <script>
16 16
 import 'wave-ui/dist/wave-ui.css'
17 17
 import ProfileCardList from '../components/ProfileCardList.vue'
18
-import TagList from '../components/TagList.vue'
19 18
 import AspectBar from '../components/AspectBar.vue'
20 19
 import SummaryBar from '../components/SummaryBar.vue'
21 20
 import PairingButton from '../components/PairingButton.vue'
@@ -57,7 +56,6 @@ export default {
57 56
     components: {
58 57
         ProfileCardList,
59 58
         AspectBar,
60
-        TagList,
61 59
         SummaryBar,
62 60
         PairingButton,
63 61
     },

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

@@ -7,8 +7,8 @@ main.view--onboarding
7 7
             :is='onboardingStep.component'
8 8
             @go-to-step='goToStep'
9 9
             @handle-submit='onboardingStep.component == "Aspects" ? onSubmit : null'
10
+            @update-answers="updateAnswers"
10 11
         )
11
-    //- MainNav
12 12
 </template>
13 13
 
14 14
 <script>
@@ -17,7 +17,7 @@ import { allSteps, possible } from '@/utils/lang'
17 17
 import stepViews from '@/components/onboarding'
18 18
 import OnboardingStepComponents from '../utils/onboardingStepComponents'
19 19
 
20
-const SCORED = [1, 2, 3, 4, 5, 6] // consider expanding + modifying DB table
20
+const SCORED = [1, 2, 3, 4, 5, 6] 
21 21
 const _isScored = id => SCORED.includes(id)
22 22
 
23 23
 const _makeCategoryFriendly = responseCategory => {
@@ -71,10 +71,6 @@ export default {
71 71
         this.onboardingStepComponents = OnboardingStepComponents
72 72
     },
73 73
     methods: {
74
-        onUpdate(payload) {
75
-            console.log('payload: ', payload)
76
-            // this.answered[payload.id] = payload
77
-        },
78 74
         onSubmit() {
79 75
             Object.values(this.answered).forEach(ans =>
80 76
                 console.log(ans.question, ans.answer),
@@ -83,6 +79,10 @@ export default {
83 79
         goToStep(num) {
84 80
             this.currentStep = num
85 81
         },
82
+        updateAnswers(payload){
83
+            this.answered[payload.key] = payload.value
84
+            // console.log('this.answered: ', this.answered)
85
+        }
86 86
     },
87 87
 }
88 88
 </script>

Ładowanie…
Anuluj
Zapisz