Преглед изворни кода

:wrench: almost all answers collected and ready to submit

tags/0.0.3^2
juancarbajal98 пре 3 година
родитељ
комит
f676c89155

+ 1
- 0
frontend/src/components/DynamicTagList.vue Прегледај датотеку

34
                 return
34
                 return
35
             }
35
             }
36
             this.mutableTags.push(this.newTag)
36
             this.mutableTags.push(this.newTag)
37
+            this.newTag = ''
37
         }
38
         }
38
     }
39
     }
39
 }
40
 }

+ 9
- 5
frontend/src/components/onboarding/AccountType.vue Прегледај датотеку

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 {{question}}
3
 //- w-button.ma1.grow(@click="this.$emit('go-to-step', currentStep + 1)") CANDIDATES
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
 </template>
6
 </template>
7
 <script>
7
 <script>
8
 export default {
8
 export default {
15
         }
15
         }
16
     },
16
     },
17
     emits: ['go-to-step', 'update-answers'],
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
     methods: {
21
     methods: {
19
-        handleSubmit(answer){
22
+        handleSubmit(accountType){
20
             let payload = {
23
             let payload = {
21
                 key: 'AccountType',
24
                 key: 'AccountType',
22
-                value: answer
25
+                question: this.question,
26
+                answer: accountType
23
             }
27
             }
24
             this.$emit('update-answers', payload)
28
             this.$emit('update-answers', payload)
25
             this.$emit('go-to-step', this.currentStep + 1)
29
             this.$emit('go-to-step', this.currentStep + 1)

+ 23
- 1
frontend/src/components/onboarding/Aspects.vue Прегледај датотеку

1
 <template lang="pug">
1
 <template lang="pug">
2
 form(@submit.prevent="this.$emit('handle-submit')").questionnaire
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
     w-button.ma1.grow(type="submit" bg-color="success")
8
     w-button.ma1.grow(type="submit" bg-color="success")
5
         w-icon.mr1 wi-check
9
         w-icon.mr1 wi-check
6
         | SUBMIT ANSWERS
10
         | SUBMIT ANSWERS
24
             default: 0
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
 </script>
50
 </script>

+ 4
- 2
frontend/src/components/onboarding/CompanyID.vue Прегледај датотеку

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

+ 17
- 4
frontend/src/components/onboarding/Interests.vue Прегледај датотеку

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 {{question}}
4
 DynamicTagList(:tags="interests" :placeholder="'interest'")
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
 </template>
6
 </template>
7
 <script>
7
 <script>
8
 import DynamicTagList from '../DynamicTagList.vue'
8
 import DynamicTagList from '../DynamicTagList.vue'
18
             default: 0
18
             default: 0
19
         }
19
         }
20
     },
20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21
     data: () => ({
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
 </script>
38
 </script>

+ 17
- 4
frontend/src/components/onboarding/LicensesAndCertifications.vue Прегледај датотеку

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 {{question}}
4
 DynamicTagList(:tags="licensesAndCertifications" :placeholder="'requirement'")
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
 </template>
6
 </template>
7
 <script>
7
 <script>
8
 import DynamicTagList from '../DynamicTagList.vue'
8
 import DynamicTagList from '../DynamicTagList.vue'
18
             default: 0
18
             default: 0
19
         }
19
         }
20
     },
20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21
     data: () => ({
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
 </script>
38
 </script>

+ 17
- 4
frontend/src/components/onboarding/Location.vue Прегледај датотеку

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 {{question}}
4
 DynamicTagList(:tags="locations" :placeholder="'location'")
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
 </template>
6
 </template>
7
 <script>
7
 <script>
8
 import DynamicTagList from '../DynamicTagList.vue'
8
 import DynamicTagList from '../DynamicTagList.vue'
18
             default: 0
18
             default: 0
19
         }
19
         }
20
     },
20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21
     data: () => ({
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
 </script>
38
 </script>

+ 7
- 5
frontend/src/components/onboarding/Role.vue Прегледај датотеку

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

+ 16
- 3
frontend/src/components/onboarding/Skills.vue Прегледај датотеку

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 {{question}}
4
 DynamicTagList(:tags="skills" :placeholder="'skill'")
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
 </template>
6
 </template>
7
 <script>
7
 <script>
8
 import DynamicTagList from '../DynamicTagList.vue'
8
 import DynamicTagList from '../DynamicTagList.vue'
18
             default: 0
18
             default: 0
19
         }
19
         }
20
     },
20
     },
21
+    emits: ['go-to-step', 'update-answers'],
21
     data: () => ({
22
     data: () => ({
23
+        question: 'What are some skills you are looking for at your company?',
22
         skills: []
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
 </script>
38
 </script>

+ 8
- 6
frontend/src/views/OnboardingView.vue Прегледај датотеку

6
             :currentStep='currentStep'
6
             :currentStep='currentStep'
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="onSubmit"
10
             @update-answers="updateAnswers"
10
             @update-answers="updateAnswers"
11
         )
11
         )
12
 </template>
12
 </template>
37
                 id: q.response_key_id,
37
                 id: q.response_key_id,
38
                 question: q.response_key_prompt,
38
                 question: q.response_key_prompt,
39
                 labels: _makeCategoryFriendly(q.response_key_category),
39
                 labels: _makeCategoryFriendly(q.response_key_category),
40
+                answer: null,
40
             }
41
             }
41
         })
42
         })
42
         .filter(step => step != null)
43
         .filter(step => step != null)
72
     },
73
     },
73
     methods: {
74
     methods: {
74
         onSubmit() {
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
         goToStep(num) {
81
         goToStep(num) {
80
             this.currentStep = num
82
             this.currentStep = num
81
         },
83
         },
82
         updateAnswers(payload){
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…
Откажи
Сачувај