Parcourir la source

:wrench WIP onboarding answer collection | dynamic tag list

tags/0.0.3^2
juancarbajal98 il y a 3 ans
Parent
révision
bcbb965417

+ 1
- 1
backend/db/seeds/04-responses.js Voir le fichier

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

+ 40
- 0
frontend/src/components/DynamicTagList.vue Voir le fichier

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 Voir le fichier

1
 <template lang="pug">
1
 <template lang="pug">
2
 h3 {Name}, let's get started on your profile while we verify your account
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
 </template>
6
 </template>
6
 <script>
7
 <script>
7
 export default {
8
 export default {
13
             default: 0
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
 </script>
29
 </script>

+ 16
- 3
frontend/src/components/onboarding/CompanyID.vue Voir le fichier

1
 <template lang="pug">
1
 <template lang="pug">
2
 h3 Company ID
2
 h3 Company ID
3
 p PLEASE ENTER YOUR COMPANY ID#:
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
 </template>
6
 </template>
7
 <script>
7
 <script>
8
-// todo add v-model to input, pass down answers array from parent
9
 export default {
8
 export default {
10
     name: 'CompanyID',
9
     name: 'CompanyID',
11
     props: {
10
     props: {
15
             default: 0
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
 </script>
32
 </script>

+ 8
- 0
frontend/src/components/onboarding/Interests.vue Voir le fichier

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

+ 8
- 0
frontend/src/components/onboarding/LicensesAndCertifications.vue Voir le fichier

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

+ 8
- 0
frontend/src/components/onboarding/Location.vue Voir le fichier

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

+ 21
- 2
frontend/src/components/onboarding/Role.vue Voir le fichier

2
 h3 ACTIVELY SEARCHING
2
 h3 ACTIVELY SEARCHING
3
 p What is your role at your company?
3
 p What is your role at your company?
4
 w-select.mt4(
4
 w-select.mt4(
5
-    :items="[{label: 'RECRUITER'},{label: 'HIRING MANAGER'}]"
5
+    v-model="selected"
6
+    :items="items"
6
     placeholder="i am")
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
 </template>
9
 </template>
9
 <script>
10
 <script>
10
 export default {
11
 export default {
16
             default: 0
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
 </script>
39
 </script>

+ 8
- 0
frontend/src/components/onboarding/Skills.vue Voir le fichier

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

+ 0
- 2
frontend/src/views/HomeView.vue Voir le fichier

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

+ 6
- 6
frontend/src/views/OnboardingView.vue Voir le fichier

7
             :is='onboardingStep.component'
7
             :is='onboardingStep.component'
8
             @go-to-step='goToStep'
8
             @go-to-step='goToStep'
9
             @handle-submit='onboardingStep.component == "Aspects" ? onSubmit : null'
9
             @handle-submit='onboardingStep.component == "Aspects" ? onSubmit : null'
10
+            @update-answers="updateAnswers"
10
         )
11
         )
11
-    //- MainNav
12
 </template>
12
 </template>
13
 
13
 
14
 <script>
14
 <script>
17
 import stepViews from '@/components/onboarding'
17
 import stepViews from '@/components/onboarding'
18
 import OnboardingStepComponents from '../utils/onboardingStepComponents'
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
 const _isScored = id => SCORED.includes(id)
21
 const _isScored = id => SCORED.includes(id)
22
 
22
 
23
 const _makeCategoryFriendly = responseCategory => {
23
 const _makeCategoryFriendly = responseCategory => {
71
         this.onboardingStepComponents = OnboardingStepComponents
71
         this.onboardingStepComponents = OnboardingStepComponents
72
     },
72
     },
73
     methods: {
73
     methods: {
74
-        onUpdate(payload) {
75
-            console.log('payload: ', payload)
76
-            // this.answered[payload.id] = payload
77
-        },
78
         onSubmit() {
74
         onSubmit() {
79
             Object.values(this.answered).forEach(ans =>
75
             Object.values(this.answered).forEach(ans =>
80
                 console.log(ans.question, ans.answer),
76
                 console.log(ans.question, ans.answer),
83
         goToStep(num) {
79
         goToStep(num) {
84
             this.currentStep = num
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
 </script>
88
 </script>

Chargement…
Annuler
Enregistrer