Selaa lähdekoodia

:wrench: almost all answers collected and ready to submit

tags/0.0.3^2
juancarbajal98 3 vuotta sitten
vanhempi
commit
f676c89155

+ 1
- 0
frontend/src/components/DynamicTagList.vue Näytä tiedosto

@@ -34,6 +34,7 @@ export default {
34 34
                 return
35 35
             }
36 36
             this.mutableTags.push(this.newTag)
37
+            this.newTag = ''
37 38
         }
38 39
     }
39 40
 }

+ 9
- 5
frontend/src/components/onboarding/AccountType.vue Näytä tiedosto

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

+ 23
- 1
frontend/src/components/onboarding/Aspects.vue Näytä tiedosto

@@ -1,6 +1,10 @@
1 1
 <template lang="pug">
2 2
 form(@submit.prevent="this.$emit('handle-submit')").questionnaire
3
-    QuestionResponse(v-for="question in aspectQuestions" :question="question")
3
+    QuestionResponse(
4
+        v-for="question in aspectQuestions" 
5
+        :question="question" 
6
+        @updated="updateRadio"
7
+    )
4 8
     w-button.ma1.grow(type="submit" bg-color="success")
5 9
         w-icon.mr1 wi-check
6 10
         | SUBMIT ANSWERS
@@ -24,5 +28,23 @@ export default {
24 28
             default: 0
25 29
         }
26 30
     },
31
+    emits: ['handle-submit', 'update-answers'],
32
+    methods: {
33
+        updateRadio(newRadioSelection){
34
+            let old_answers = this.aspectQuestions.map(q=> q.answer)
35
+            console.log(old_answers)
36
+            console.log(newRadioSelection)
37
+            let new_answers = [...old_answers]
38
+            new_answers[newRadioSelection.id-1] = newRadioSelection.answer
39
+            console.log(new_answers)
40
+            // let payload = {
41
+            //     key: 'Aspects',
42
+            //     question: '?',
43
+            //     answer: new_answers
44
+            // }
45
+            // this.$emit('update-answers', payload)
46
+            // console.log(JSON.stringify(payload));
47
+        }
48
+    }
27 49
 }
28 50
 </script>

+ 4
- 2
frontend/src/components/onboarding/CompanyID.vue Näytä tiedosto

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

+ 17
- 4
frontend/src/components/onboarding/Interests.vue Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 <template lang="pug">
2 2
 h3 Interests
3
-p What are some interests you would like in your next candidates?
3
+p {{question}}
4 4
 DynamicTagList(:tags="interests" :placeholder="'interest'")
5
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5
+w-button.ma1.grow(@click="handleSubmit") NEXT
6 6
 </template>
7 7
 <script>
8 8
 import DynamicTagList from '../DynamicTagList.vue'
@@ -18,8 +18,21 @@ export default {
18 18
             default: 0
19 19
         }
20 20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21 22
     data: () => ({
22
-        interests: []
23
-    })
23
+        interests: [],
24
+        question: 'What are some interests you would like in your next candidates?'
25
+    }),
26
+    methods: {
27
+        handleSubmit(){
28
+            let payload = {
29
+                key: 'Interests',
30
+                question: this.question,
31
+                answer: this.interests
32
+            }
33
+            this.$emit('update-answers', payload)
34
+            this.$emit('go-to-step', this.currentStep + 1)
35
+        }
36
+    }
24 37
 }
25 38
 </script>

+ 17
- 4
frontend/src/components/onboarding/LicensesAndCertifications.vue Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 <template lang="pug">
2 2
 h3 Licenses & Certifications
3
-p Are there any licenses and certification requirements?
3
+p {{question}}
4 4
 DynamicTagList(:tags="licensesAndCertifications" :placeholder="'requirement'")
5
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5
+w-button.ma1.grow(@click="handleSubmit") NEXT
6 6
 </template>
7 7
 <script>
8 8
 import DynamicTagList from '../DynamicTagList.vue'
@@ -18,8 +18,21 @@ export default {
18 18
             default: 0
19 19
         }
20 20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21 22
     data: () => ({
22
-        licensesAndCertifications: []
23
-    })
23
+        licensesAndCertifications: [],
24
+        question: 'Are there any licenses and certification requirements?'
25
+    }),
26
+    methods: {
27
+        handleSubmit(){
28
+            let payload = {
29
+                key: 'LicensesAndCertifications',
30
+                question: this.question,
31
+                answer: this.licensesAndCertifications
32
+            }
33
+            this.$emit('update-answers', payload)
34
+            this.$emit('go-to-step', this.currentStep + 1)
35
+        }
36
+    }
24 37
 }
25 38
 </script>

+ 17
- 4
frontend/src/components/onboarding/Location.vue Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 <template lang="pug">
2 2
 h3 Location
3
-p Where would you like to select your candidates from?
3
+p {{question}}
4 4
 DynamicTagList(:tags="locations" :placeholder="'location'")
5
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5
+w-button.ma1.grow(@click="handleSubmit") NEXT
6 6
 </template>
7 7
 <script>
8 8
 import DynamicTagList from '../DynamicTagList.vue'
@@ -18,8 +18,21 @@ export default {
18 18
             default: 0
19 19
         }
20 20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21 22
     data: () => ({
22
-        locations: []
23
-    })
23
+        locations: [],
24
+        question: 'Where would you like to select your candidates from?'
25
+    }),
26
+    methods: {
27
+        handleSubmit(){
28
+            let payload = {
29
+                key: 'Location',
30
+                question: this.question,
31
+                answer: this.locations
32
+            }
33
+            this.$emit('update-answers', payload)
34
+            this.$emit('go-to-step', this.currentStep + 1)
35
+        }
36
+    }
24 37
 }
25 38
 </script>

+ 7
- 5
frontend/src/components/onboarding/Role.vue Näytä tiedosto

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

+ 16
- 3
frontend/src/components/onboarding/Skills.vue Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 <template lang="pug">
2 2
 h3 RECRUITER
3
-p What are some skills you are looking for at your company?
3
+p {{question}}
4 4
 DynamicTagList(:tags="skills" :placeholder="'skill'")
5
-w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") NEXT
5
+w-button.ma1.grow(@click="handleSubmit") NEXT
6 6
 </template>
7 7
 <script>
8 8
 import DynamicTagList from '../DynamicTagList.vue'
@@ -18,8 +18,21 @@ export default {
18 18
             default: 0
19 19
         }
20 20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21 22
     data: () => ({
23
+        question: 'What are some skills you are looking for at your company?',
22 24
         skills: []
23
-    })
25
+    }),
26
+    methods: {
27
+        handleSubmit(){
28
+            let payload = {
29
+                key: 'Skills',
30
+                question: this.question,
31
+                answer: this.skills
32
+            }
33
+            this.$emit('update-answers', payload)
34
+            this.$emit('go-to-step', this.currentStep + 1)
35
+        }
36
+    }
24 37
 }
25 38
 </script>

+ 8
- 6
frontend/src/views/OnboardingView.vue Näytä tiedosto

@@ -6,7 +6,7 @@ main.view--onboarding
6 6
             :currentStep='currentStep'
7 7
             :is='onboardingStep.component'
8 8
             @go-to-step='goToStep'
9
-            @handle-submit='onboardingStep.component == "Aspects" ? onSubmit : null'
9
+            @handle-submit="onSubmit"
10 10
             @update-answers="updateAnswers"
11 11
         )
12 12
 </template>
@@ -37,6 +37,7 @@ const _formatAspectQuestions = steps => {
37 37
                 id: q.response_key_id,
38 38
                 question: q.response_key_prompt,
39 39
                 labels: _makeCategoryFriendly(q.response_key_category),
40
+                answer: null,
40 41
             }
41 42
         })
42 43
         .filter(step => step != null)
@@ -72,16 +73,17 @@ export default {
72 73
     },
73 74
     methods: {
74 75
         onSubmit() {
75
-            Object.values(this.answered).forEach(ans =>
76
-                console.log(ans.question, ans.answer),
77
-            )
76
+            console.log(JSON.stringify(this.answered))
77
+            // Object.values(this.answered).forEach(ans =>
78
+            //     console.log(ans.question, ans.answer),
79
+            // )
78 80
         },
79 81
         goToStep(num) {
80 82
             this.currentStep = num
81 83
         },
82 84
         updateAnswers(payload){
83
-            this.answered[payload.key] = payload.value
84
-            // console.log('this.answered: ', this.answered)
85
+            this.answered[payload.key] = payload.answer
86
+            console.log(`Updated answers: ${JSON.stringify(this.answered)}`);
85 87
         }
86 88
     },
87 89
 }

Loading…
Peruuta
Tallenna