diff --git a/frontend/src/lib/components/modal/PersonalIdErrorModal.svelte b/frontend/src/lib/components/modal/PersonalIdErrorModal.svelte
new file mode 100644
index 0000000..f1a991e
--- /dev/null
+++ b/frontend/src/lib/components/modal/PersonalIdErrorModal.svelte
@@ -0,0 +1,43 @@
+
+
+{#if isOpened}
+
+
+
+
+
+ Vaše rodné číslo není
+ '{personalIdNumber}'?
+
+
Znamená to, že jsme udělali chybu v přepisu přihlášky.
+
+
+ Kontaktujte nás na telefonu +420 123 456 789,
+
+
+ nebo nám napište na email na
+ portfolio@ssps.cz
+
+
Omlouváme se za komplikace s přijímacím řízením SSPŠaG
+
+
+
+{/if}
+
+
diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
index 2f88152..4f4bcd9 100644
--- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
+++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
@@ -26,6 +26,7 @@
import SchoolSelect from '$lib/components/select/SchoolSelect/SchoolSelect.svelte';
import PersonalIdConfirmCheckBox from '$lib/components/checkbox/PersonalIdConfirmCheckBox.svelte';
import { isPersonalIdNumberWithBirthdateValid } from '$lib/utils/personalIdFormat';
+ import PersonalIdErrorModal from '$lib/components/modal/PersonalIdErrorModal.svelte';
let pageIndex = 0;
let pagesFilled = [false, false, false, false, false, false, false, false];
@@ -203,7 +204,11 @@
// TODO: https://github.com/tjinauyeung/svelte-forms-lib/issues/171!! (Zatím tenhle mega typ)
$: typedErrors = errors as unknown as Writable;
- $: console.log($typedErrors);
+ let visibleModals = {
+ personalIdModal: false,
+ linkErrorModal: false
+ };
+
const onSubmit = async (values: CandidateData) => {
if (pageIndex === 3) {
if (values.candidate.citizenship === 'Česká republika') {
@@ -285,11 +290,13 @@
switch (index) {
case 0:
if ($typedErrors['personalIdOk'] || $typedErrors['personalIdErr']) {
+ visibleModals.personalIdModal = true;
return true;
}
break;
case 1:
if ($typedErrors['linkOk'] || $typedErrors['linkError']) {
+ visibleModals.linkErrorModal = true;
return true;
}
break;
@@ -351,10 +358,10 @@
case 7:
// @ts-ignore
if (
- $typedErrors['candidate']['firstSchool']['name'] ||
- $typedErrors['candidate']['firstSchool']['field'] ||
- $typedErrors['candidate']['secondSchool']['name'] ||
- $typedErrors['candidate']['secondSchool']['field']
+ $typedErrors['candidate']['firstSchool']['name'] ||
+ $typedErrors['candidate']['firstSchool']['field'] ||
+ $typedErrors['candidate']['secondSchool']['name'] ||
+ $typedErrors['candidate']['secondSchool']['field']
) {
return true;
}
@@ -422,6 +429,12 @@
+ {#if visibleModals.personalIdModal}
+ (visibleModals.personalIdModal = false)}
+ personalIdNumber={baseCandidateDetails.personalIdNumber}
+ />
+ {/if}