From 3a498caeef238171e04110b449945fe5448bbfe8 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Sat, 14 Jan 2023 11:11:16 +0100 Subject: [PATCH] feat: school name, health insurance fill in register, show on candidate dashboard --- .../dashboard/DashboardInfoCard.svelte | 5 +- frontend/src/lib/stores/candidate.ts | 6 ++- .../(authenticated)/register/+page.svelte | 50 +++++++++++++++---- 3 files changed, 49 insertions(+), 12 deletions(-) diff --git a/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte b/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte index be69728..eab48b8 100644 --- a/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte +++ b/frontend/src/lib/components/dashboard/DashboardInfoCard.svelte @@ -158,8 +158,9 @@ >{$candidateData.candidate.personalIdNumber} - Telefon: {$candidateData.candidate.telephone} + IČO/Název školy: {$candidateData.candidate.schoolName} + Číslo zdravotní pojišťovny: {$candidateData.candidate.healthInsurance} + Telefon: {$candidateData.candidate.telephone}
({ email: '', sex: '', study: '', - personalIdNumber: '' + personalIdNumber: '', + schoolName: '', + healthInsurance: '' }, parents: [] }); diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index 6b7b045..2004550 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -53,6 +53,8 @@ zip: '', citizenship: '', personalIdNumber: '', + schoolName: '', + healthInsurance: '', study: '' }, parents: [ @@ -97,6 +99,8 @@ zip: yup.string().required(), citizenship: yup.string().required(), personalIdNumber: yup.string().required(), + schoolName: yup.string().required(), + healthInsurance: yup.number().required(), study: yup.string().required() }), parents: yup.array().of( @@ -313,7 +317,9 @@ if ( $typedErrors['candidate']['citizenship'] || $typedErrors['candidate']['personalIdNumber'] || - $typedErrors['candidate']['study'] + $typedErrors['candidate']['schoolName'] || + $typedErrors['candidate']['healthInsurance'] || + $typedErrors['candidate']['study'] ) { return true; } @@ -569,7 +575,7 @@ Zadejte prosím své občanství, rodné číslo, či jeho alternativu Vaší země a obor na který se hlásíte.

-
+
- - - +
+ + + {#if $form.candidate.citizenship === 'Česká republika' || !$form.candidate.citizenship} + + {:else} + + {/if} + + + + + + +
{#if $form.candidate.citizenship === 'Česká republika' || !$form.candidate.citizenship}