|
15 | 15 | <div |
16 | 16 | v-if="memberAuth" |
17 | 17 | @click=" |
18 | | - () => (showAddWorkExperienceForm = !showAddWorkExperienceForm) |
| 18 | + () => { |
| 19 | + showAddWorkExperienceForm = true |
| 20 | + showUpdateWorkExperienceForm = false |
| 21 | + state.form.workExperience = { ...defaultWorkExperience } |
| 22 | + } |
19 | 23 | " |
20 | 24 | > |
21 | 25 | <img |
|
39 | 43 | <h5 class="sub-title">{{ experience.position }}</h5> |
40 | 44 | </div> |
41 | 45 | <p class="date-container"> |
42 | | - {{ formatDate(experience.start_date) }} - |
| 46 | + {{ formatDate(experience.start_date) }} – |
43 | 47 | {{ |
44 | 48 | experience.end_date |
45 | 49 | ? formatDate(experience.end_date) |
|
64 | 68 | @click=" |
65 | 69 | () => { |
66 | 70 | showUpdateWorkExperienceForm = true |
| 71 | + showAddWorkExperienceForm = false |
67 | 72 | state.form.workExperience = { ...experience } |
68 | 73 | } |
69 | 74 | " |
|
76 | 81 | </ul> |
77 | 82 | <!-- Add Work Experience Form --> |
78 | 83 | <div v-if="showAddWorkExperienceForm"> |
79 | | - <form @submit.prevent="addMemberWorkExperience"> |
| 84 | + <form |
| 85 | + @submit.prevent="addMemberWorkExperience" |
| 86 | + class="border px-16 py-8" |
| 87 | + > |
80 | 88 | <FormAppControlInput |
81 | 89 | v-model:value="state.form.workExperience.company_name" |
82 | 90 | isRequired |
|
128 | 136 | </div> |
129 | 137 | <!-- Update Work Experience Form --> |
130 | 138 | <div v-if="showUpdateWorkExperienceForm"> |
131 | | - <div class="flex justify-end w-full"> |
132 | | - <img |
133 | | - src="/icons/x.svg" |
134 | | - alt="" |
135 | | - class="cursor-pointer" |
136 | | - @click="() => (showUpdateWorkExperienceForm = false)" |
137 | | - /> |
138 | | - </div> |
139 | | - <form @submit.prevent="updateMemberWorkExperience"> |
| 139 | + <form |
| 140 | + @submit.prevent="updateMemberWorkExperience" |
| 141 | + class="border px-16 py-8" |
| 142 | + > |
| 143 | + <div class="flex justify-end w-full"> |
| 144 | + <img |
| 145 | + src="/icons/x.svg" |
| 146 | + alt="" |
| 147 | + class="cursor-pointer" |
| 148 | + @click="() => (showUpdateWorkExperienceForm = false)" |
| 149 | + /> |
| 150 | + </div> |
140 | 151 | <FormAppControlInput |
141 | 152 | v-model:value="state.form.workExperience.company_name" |
142 | 153 | :value="state.form.workExperience.company_name" |
|
167 | 178 | @checkbox-changed=" |
168 | 179 | state.form.workExperience.currently_working = $event |
169 | 180 | " |
| 181 | + :isChecked="state.form.workExperience.end_date ? false : true" |
170 | 182 | labelId="currently-working-edit" |
171 | 183 | class="mt-2" |
172 | 184 | > |
|
195 | 207 | <h3 class="heading">Education</h3> |
196 | 208 | <div |
197 | 209 | v-if="memberAuth" |
198 | | - @click="() => (showAddEducationForm = !showAddEducationForm)" |
| 210 | + @click=" |
| 211 | + () => { |
| 212 | + showAddEducationForm = true |
| 213 | + showUpdateEducationForm = false |
| 214 | + state.form.education = { ...defaultEducation } |
| 215 | + } |
| 216 | + " |
199 | 217 | > |
200 | 218 | <img |
201 | 219 | v-if="!showAddEducationForm" |
|
242 | 260 | @click=" |
243 | 261 | () => { |
244 | 262 | showUpdateEducationForm = true |
| 263 | + showAddEducationForm = false |
245 | 264 | state.form.education = { ...education } |
246 | 265 | } |
247 | 266 | " |
|
254 | 273 | </ul> |
255 | 274 | <!-- Add Education Form --> |
256 | 275 | <div v-if="showAddEducationForm"> |
257 | | - <form @submit.prevent="addMemberEducation"> |
| 276 | + <form @submit.prevent="addMemberEducation" class="border px-16 py-8"> |
258 | 277 | <FormAppControlInput |
259 | 278 | v-model:value="state.form.education.institution_name" |
260 | 279 | isRequired |
|
288 | 307 | </div> |
289 | 308 | <!-- Update Education Form --> |
290 | 309 | <div v-if="showUpdateEducationForm"> |
291 | | - <div class="flex justify-end w-full"> |
292 | | - <img |
293 | | - src="/icons/x.svg" |
294 | | - alt="" |
295 | | - class="cursor-pointer flex" |
296 | | - @click="() => (showUpdateEducationForm = false)" |
297 | | - /> |
298 | | - </div> |
299 | | - <form @submit.prevent="updateMemberEducation"> |
| 310 | + <form @submit.prevent="updateMemberEducation" class="border px-16 py-8"> |
| 311 | + <div class="flex justify-end w-full"> |
| 312 | + <img |
| 313 | + src="/icons/x.svg" |
| 314 | + alt="" |
| 315 | + class="cursor-pointer flex" |
| 316 | + @click="() => (showUpdateEducationForm = false)" |
| 317 | + /> |
| 318 | + </div> |
300 | 319 | <FormAppControlInput |
301 | 320 | v-model:value="state.form.education.institution_name" |
302 | 321 | :value="state.form.education.institution_name" |
|
315 | 334 | <FormAppControlInput |
316 | 335 | inputType="checkbox" |
317 | 336 | @checkbox-changed="state.form.education.still_studying = $event" |
| 337 | + :isChecked="state.form.education.graduated ? false : true" |
318 | 338 | labelId="currently-studying-edit" |
319 | 339 | > |
320 | 340 | I'm still studying |
@@ -368,6 +388,23 @@ const props = defineProps({ |
368 | 388 | }, |
369 | 389 | }) |
370 | 390 |
|
| 391 | +const defaultWorkExperience = { |
| 392 | + company_name: '', |
| 393 | + position: '', |
| 394 | + start_date: '', |
| 395 | + currently_working: false, |
| 396 | + end_date: null, |
| 397 | + id: '', |
| 398 | +} |
| 399 | +
|
| 400 | +const defaultEducation = { |
| 401 | + institution_name: '', |
| 402 | + degree: '', |
| 403 | + still_studying: false, |
| 404 | + graduated: '', |
| 405 | + id: '', |
| 406 | +} |
| 407 | +
|
371 | 408 | const state = reactive({ |
372 | 409 | form: { |
373 | 410 | workExperience: { |
|
0 commit comments