From ed5364026398c9f7ddaddf5b35df04c1aa98dcc7 Mon Sep 17 00:00:00 2001 From: EETagent Date: Sun, 15 Jan 2023 23:36:04 +0100 Subject: [PATCH 1/9] feat: add fieldOfStudy to backend response --- core/src/database/query/application.rs | 1 + core/src/models/application.rs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/database/query/application.rs b/core/src/database/query/application.rs index 1f5334e..dde822f 100644 --- a/core/src/database/query/application.rs +++ b/core/src/database/query/application.rs @@ -12,6 +12,7 @@ pub struct ApplicationCandidateJoin { pub surname: Option, pub email: Option, pub telephone: Option, + pub field_of_study: Option, } use crate::{Query}; diff --git a/core/src/models/application.rs b/core/src/models/application.rs index aac9c2f..6cbb328 100644 --- a/core/src/models/application.rs +++ b/core/src/models/application.rs @@ -14,6 +14,7 @@ pub struct ApplicationResponse { pub surname: String, pub email: String, pub telephone: String, + pub field_of_study: Option, } impl ApplicationResponse { @@ -25,7 +26,6 @@ impl ApplicationResponse { let surname = EncryptedString::decrypt_option(&EncryptedString::try_from(&c.surname).ok(), private_key).await?; let email = EncryptedString::decrypt_option(&EncryptedString::try_from(&c.email).ok(), private_key).await?; let telephone = EncryptedString::decrypt_option(&EncryptedString::try_from(&c.telephone).ok(), private_key).await?; - Ok( Self { application_id: c.application_id, @@ -34,6 +34,7 @@ impl ApplicationResponse { email: email.unwrap_or_default(), telephone: telephone.unwrap_or_default(), candidate_id: c.candidate_id, + field_of_study: c.field_of_study, } ) } From d35328cad67b9b8e0f528332428bdbe2156ed5f5 Mon Sep 17 00:00:00 2001 From: EETagent Date: Sun, 15 Jan 2023 23:36:14 +0100 Subject: [PATCH 2/9] fix: implement on frontend --- frontend/src/lib/components/admin/table/Table.svelte | 2 +- frontend/src/lib/stores/candidate.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/admin/table/Table.svelte b/frontend/src/lib/components/admin/table/Table.svelte index f4d65ca..bdb4106 100644 --- a/frontend/src/lib/components/admin/table/Table.svelte +++ b/frontend/src/lib/components/admin/table/Table.svelte @@ -36,7 +36,7 @@ {candidate.surname} - {candidate.study} + {candidate.fieldOfStudy} diff --git a/frontend/src/lib/stores/candidate.ts b/frontend/src/lib/stores/candidate.ts index 2f2e1b9..cbeed2a 100644 --- a/frontend/src/lib/stores/candidate.ts +++ b/frontend/src/lib/stores/candidate.ts @@ -28,7 +28,7 @@ export interface CandidatePreview { applicationId?: number; name?: string; surname?: string; - study?: string; + fieldOfStudy?: string; } export interface CandidateLogin { From 8c30c12395ba193805af15dec9da9e52af282c67 Mon Sep 17 00:00:00 2001 From: EETagent Date: Sun, 15 Jan 2023 23:42:41 +0100 Subject: [PATCH 3/9] fix: remove study from candidate details page --- .../src/lib/components/admin/list/CandidateDetails.svelte | 4 ---- frontend/src/lib/stores/candidate.ts | 2 -- .../candidate/[code=application]/+page.server.ts | 1 - 3 files changed, 7 deletions(-) diff --git a/frontend/src/lib/components/admin/list/CandidateDetails.svelte b/frontend/src/lib/components/admin/list/CandidateDetails.svelte index e634f27..f837b52 100644 --- a/frontend/src/lib/components/admin/list/CandidateDetails.svelte +++ b/frontend/src/lib/components/admin/list/CandidateDetails.svelte @@ -62,10 +62,6 @@ E-mail {candidate.email} - - Obor - {candidate.study} - Rodné číslo {candidate.personalIdNumber} diff --git a/frontend/src/lib/stores/candidate.ts b/frontend/src/lib/stores/candidate.ts index cbeed2a..013c204 100644 --- a/frontend/src/lib/stores/candidate.ts +++ b/frontend/src/lib/stores/candidate.ts @@ -11,7 +11,6 @@ export interface CandidateData { citizenship: string; email: string; sex: string; - study: string; personalIdNumber: string; schoolName: string; healthInsurance: string; @@ -71,7 +70,6 @@ export const candidateData = writable({ citizenship: '', email: '', sex: '', - study: '', personalIdNumber: '', schoolName: '', healthInsurance: '' diff --git a/frontend/src/routes/(admin)/admin/(authenticated)/candidate/[code=application]/+page.server.ts b/frontend/src/routes/(admin)/admin/(authenticated)/candidate/[code=application]/+page.server.ts index a311a3f..50a759b 100644 --- a/frontend/src/routes/(admin)/admin/(authenticated)/candidate/[code=application]/+page.server.ts +++ b/frontend/src/routes/(admin)/admin/(authenticated)/candidate/[code=application]/+page.server.ts @@ -17,7 +17,6 @@ export const load: PageServerLoad = async ({ fetch, params }) => { citizenship: '', email: '', sex: '', - study: '', personalIdNumber: '', schoolName: '', healthInsurance: '' From ba69562bf9df18485d9631bca9520b493011de11 Mon Sep 17 00:00:00 2001 From: EETagent Date: Sun, 15 Jan 2023 23:54:03 +0100 Subject: [PATCH 4/9] fix: remove study from register form --- .../(authenticated)/register/+page.svelte | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index f34b5da..1380596 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -62,7 +62,6 @@ personalIdNumber: '', schoolName: '', healthInsurance: '', - study: '' }, parents: [ { @@ -110,7 +109,6 @@ personalIdNumber: yup.string().required(), schoolName: yup.string().required(), healthInsurance: yup.number().required(), - study: yup.string().required() }), parents: yup.array().of( yup.object().shape({ @@ -332,8 +330,7 @@ $typedErrors['candidate']['citizenship'] || $typedErrors['candidate']['personalIdNumber'] || $typedErrors['candidate']['schoolName'] || - $typedErrors['candidate']['healthInsurance'] || - $typedErrors['candidate']['study'] + $typedErrors['candidate']['healthInsurance'] ) { return true; } @@ -640,7 +637,7 @@ {/if} - + {/if} - - - {/if} From 707f761abcb31e05b4ce225caef404a1c3700455 Mon Sep 17 00:00:00 2001 From: EETagent Date: Sun, 15 Jan 2023 23:59:25 +0100 Subject: [PATCH 5/9] fix: hide school badge on initial confirmation page --- .../(candidate)/(authenticated)/register/+page.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index 1380596..c5f61d9 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -386,9 +386,12 @@
-
- -
+ + {#if pageIndex > 0} +
+ +
+ {/if}