diff --git a/frontend/src/lib/components/registerViews/RegisterView.svelte b/frontend/src/lib/components/registerViews/RegisterView.svelte
new file mode 100644
index 0000000..0a407fe
--- /dev/null
+++ b/frontend/src/lib/components/registerViews/RegisterView.svelte
@@ -0,0 +1,4 @@
+
\ No newline at end of file
diff --git a/frontend/src/lib/components/select/SchoolSelect.svelte b/frontend/src/lib/components/select/SchoolSelect.svelte
index 09040ec..a7edbc2 100644
--- a/frontend/src/lib/components/select/SchoolSelect.svelte
+++ b/frontend/src/lib/components/select/SchoolSelect.svelte
@@ -1,4 +1,5 @@
-Selected color: {selectedSchool}
-
\ No newline at end of file
+
+
+
+ Selected school: {selectedSchool.name}
+
+
+
+
+ Obor:
+
+
+
\ No newline at end of file
diff --git a/frontend/src/lib/stores/candidate.ts b/frontend/src/lib/stores/candidate.ts
index 7b22dc7..16dca75 100644
--- a/frontend/src/lib/stores/candidate.ts
+++ b/frontend/src/lib/stores/candidate.ts
@@ -1,6 +1,11 @@
import type { GradeBackend } from '$lib/components/grades/GradesTable.svelte';
import { writable } from 'svelte/store';
+
+export interface School {
+ name: string;
+ field: string;
+}
export interface CandidateData {
candidate: {
name: string;
@@ -18,8 +23,8 @@ export interface CandidateData {
schoolName: string;
healthInsurance: string;
grades: Array;
- firstSchool: string;
- secondSchool: string;
+ firstSchool: School;
+ secondSchool: School;
testLanguage: string;
};
parents: Array<{
@@ -83,8 +88,8 @@ export const candidateData = writable({
schoolName: '',
healthInsurance: '',
grades: [],
- firstSchool: '',
- secondSchool: '',
+ firstSchool: {name: '', field: ''},
+ secondSchool: {name: '', field: ''},
testLanguage: ''
},
parents: []
diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
index a27e294..b314288 100644
--- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
+++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte
@@ -22,9 +22,10 @@
import type { CandidateData } from '$lib/stores/candidate';
import AccountLinkCheckBox from '$lib/components/checkbox/AccountLinkCheckBox.svelte';
import GradesTable from '$lib/components/grades/GradesTable.svelte';
+ import SchoolSelect from '$lib/components/select/SchoolSelect.svelte';
let pageIndex = 0;
- let pagesFilled = [false, false, false, false, false, false];
+ let pagesFilled = [false, false, false, false, false, false, false];
const pageCount = pagesFilled.length;
let pageTexts = [
'Zpracování osobních údajů',
@@ -64,8 +65,8 @@
schoolName: '',
healthInsurance: '',
grades: [],
- firstSchool: '',
- secondSchool: '',
+ firstSchool: {name: '', field: ''},
+ secondSchool: {name: '', field: ''},
testLanguage: '',
},
parents: [
@@ -127,6 +128,14 @@
})
.required()
).required(),
+ firstSchool: yup.object().shape({
+ name: yup.string().required(),
+ field: yup.string().required(),
+ }),
+ secondSchool: yup.object().shape({
+ name: yup.string().required(),
+ field: yup.string().required(),
+ }),
testLanguage: yup.string().required(),
}),
parents: yup.array().of(
@@ -228,7 +237,7 @@
return false;
}
};
-
+ $: console.log($typedErrors);
const onSubmit = async (values: CandidateData) => {
if (pageIndex === 3) {
if (values.candidate.citizenship === 'Česká republika') {
@@ -252,6 +261,7 @@
personalIdBirthdateMatch = true;
}
if (pageIndex === pageCount) {
+ console.log('submitting');
// clone values to oldValues
let oldValues = JSON.parse(JSON.stringify(values));
try {
@@ -368,6 +378,15 @@
}
break;
case 6:
+ // @ts-ignore
+ if ($typedErrors["candidate"]["firstSchool"].name || $typedErrors["candidate"]["firstSchool"].field ||
+ // @ts-ignore
+ $typedErrors["candidate"]["secondSchool"].name || $typedErrors["candidate"]["secondSchool"].field
+ ) {
+ return true;
+ }
+ break;
+ case 7:
if ($typedErrors["candidate"]["grades"].length > 0) return true;
break;
default:
@@ -688,6 +707,16 @@
{:else if pageIndex === 6}
+ Přihlášky na školy
+
+
+
+
+
+
+
+
+ {:else if pageIndex === 7}
{pageTexts[5]}
Přidejte prosím přepis Vaších známek z posledních dvou let studia