diff --git a/frontend/src/hooks.server.ts b/frontend/src/hooks.server.ts index 33994e3..7b52491 100644 --- a/frontend/src/hooks.server.ts +++ b/frontend/src/hooks.server.ts @@ -1,21 +1,18 @@ import { API_URL } from '$lib/@api'; -import type { HandleFetch } from '@sveltejs/kit'; +import type { HandleFetch } from '@sveltejs/kit'; -export const handleFetch: HandleFetch = async ({ request, fetch, event,}) => { +export const handleFetch: HandleFetch = async ({ request, fetch, event }) => { console.log(`SSR: handleFetch() BEFORE: ${request.method} ${request.url}`); - const cookie = event.request.headers.get('cookie') || ''; + const cookie = event.request.headers.get('cookie') || ''; - console.log(`SSR: handleFetch() cookie: ${cookie}`); - - request.headers.set('cookie', cookie); + console.log(`SSR: handleFetch() cookie: ${cookie}`); - request = new Request( - request.url.replace(API_URL, 'http://127.0.0.1:8000'), - request - ); + request.headers.set('cookie', cookie); - console.log(`SSR: handleFetch() AFTER: ${request.method} ${request.url}`); + request = new Request(request.url.replace(API_URL, 'http://127.0.0.1:8000'), request); + + console.log(`SSR: handleFetch() AFTER: ${request.method} ${request.url}`); return fetch(request); }; diff --git a/frontend/src/lib/@api/index.ts b/frontend/src/lib/@api/index.ts index ac3193d..15efcfb 100644 --- a/frontend/src/lib/@api/index.ts +++ b/frontend/src/lib/@api/index.ts @@ -1,14 +1,14 @@ -import type { AxiosError } from "axios"; +import type { AxiosError } from 'axios'; -export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise +export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise; -export const API_URL = "http://localhost:8000"; +export const API_URL = 'http://localhost:8000'; export interface ApiError { - error: AxiosError, - msg: string, + error: AxiosError; + msg: string; } export function errorHandler(error: AxiosError, msg: string): ApiError { - return {error, msg} -} \ No newline at end of file + return { error, msg }; +} diff --git a/frontend/src/lib/components/DarkModeToggle.svelte b/frontend/src/lib/components/DarkModeToggle.svelte index a570db6..7eac8b9 100644 --- a/frontend/src/lib/components/DarkModeToggle.svelte +++ b/frontend/src/lib/components/DarkModeToggle.svelte @@ -25,14 +25,14 @@ diff --git a/frontend/src/lib/components/dashboard/CoverLetterUploadCard.svelte b/frontend/src/lib/components/dashboard/CoverLetterUploadCard.svelte index 57abd45..a56f6d4 100644 --- a/frontend/src/lib/components/dashboard/CoverLetterUploadCard.svelte +++ b/frontend/src/lib/components/dashboard/CoverLetterUploadCard.svelte @@ -1,23 +1,20 @@ - - onFileDrop(e.detail)} - title="Motivační dopis" - filetype="PDF" - filesize={10} - fileType={1} - > - + onFileDrop(e.detail)} + title="Motivační dopis" + filetype="PDF" + filesize={10} + fileType={1} +/> diff --git a/frontend/src/lib/components/dashboard/FileType.svelte b/frontend/src/lib/components/dashboard/FileType.svelte index 2a1a01d..1ab928f 100644 --- a/frontend/src/lib/components/dashboard/FileType.svelte +++ b/frontend/src/lib/components/dashboard/FileType.svelte @@ -16,7 +16,7 @@ @apply bg-white rounded-xl shadow-md; @apply hover:bg-sspsBlue; - @apply hover:cursor-pointer; + @apply hover:cursor-pointer; } div, diff --git a/frontend/src/lib/components/dashboard/PortfolioLetterUploadCard.svelte b/frontend/src/lib/components/dashboard/PortfolioLetterUploadCard.svelte index 0aa4778..d85b11c 100644 --- a/frontend/src/lib/components/dashboard/PortfolioLetterUploadCard.svelte +++ b/frontend/src/lib/components/dashboard/PortfolioLetterUploadCard.svelte @@ -1,22 +1,20 @@ - onFileDrop(e.detail)} - title="Portfolio" - filetype="PDF" - filesize={10} - fileType={2}> - + on:filedrop={(e) => onFileDrop(e.detail)} + title="Portfolio" + filetype="PDF" + filesize={10} + fileType={2} +/> diff --git a/frontend/src/lib/components/dashboard/PortfolioZipUploadCard.svelte b/frontend/src/lib/components/dashboard/PortfolioZipUploadCard.svelte index 3131235..eca284c 100644 --- a/frontend/src/lib/components/dashboard/PortfolioZipUploadCard.svelte +++ b/frontend/src/lib/components/dashboard/PortfolioZipUploadCard.svelte @@ -1,22 +1,20 @@ - onFileDrop(e.detail)} - title="Další data" - filetype="ZIP" - filesize={100} - fileType={3}> - + on:filedrop={(e) => onFileDrop(e.detail)} + title="Další data" + filetype="ZIP" + filesize={100} + fileType={3} +/> diff --git a/frontend/src/lib/components/dashboard/ProgressBar.svelte b/frontend/src/lib/components/dashboard/ProgressBar.svelte index 8f90964..91446ba 100644 --- a/frontend/src/lib/components/dashboard/ProgressBar.svelte +++ b/frontend/src/lib/components/dashboard/ProgressBar.svelte @@ -1,22 +1,39 @@
- + + - - - {#if progress === 1} - - {:else} - - {/if} - > - -
\ No newline at end of file + {#if progress === 1} + + {:else} + + {/if} + > + + diff --git a/frontend/src/lib/components/dashboard/StatusNotificationBig.svelte b/frontend/src/lib/components/dashboard/StatusNotificationBig.svelte index 0173972..67a6fd9 100644 --- a/frontend/src/lib/components/dashboard/StatusNotificationBig.svelte +++ b/frontend/src/lib/components/dashboard/StatusNotificationBig.svelte @@ -1,42 +1,41 @@ +
-
-

{title}

- - -
+
+

{title}

+ + +
- diff --git a/frontend/src/lib/components/dashboard/StatusNotificationDot.svelte b/frontend/src/lib/components/dashboard/StatusNotificationDot.svelte index 26f7a69..b88fe5e 100644 --- a/frontend/src/lib/components/dashboard/StatusNotificationDot.svelte +++ b/frontend/src/lib/components/dashboard/StatusNotificationDot.svelte @@ -1,50 +1,47 @@
- - + +
\ No newline at end of file + .missing { + @apply bg-red-700; + } + diff --git a/frontend/src/lib/components/icons/Email.svelte b/frontend/src/lib/components/icons/Email.svelte index 7257881..93fb5de 100644 --- a/frontend/src/lib/components/icons/Email.svelte +++ b/frontend/src/lib/components/icons/Email.svelte @@ -6,7 +6,7 @@ @apply text-center text-2xl text-sspsBlue; @apply pb-1; - @apply select-none; + @apply select-none; } span:hover { @apply cursor-pointer; diff --git a/frontend/src/lib/components/icons/Home.svelte b/frontend/src/lib/components/icons/Home.svelte index a9ffcf2..658a4bf 100644 --- a/frontend/src/lib/components/icons/Home.svelte +++ b/frontend/src/lib/components/icons/Home.svelte @@ -1,20 +1,20 @@ \ No newline at end of file + path { + @apply fill-sspsBlue; + } + path:nth-child(2) { + @apply stroke-sspsBlue; + } + diff --git a/frontend/src/lib/components/icons/Lock.svelte b/frontend/src/lib/components/icons/Lock.svelte index e8efbe0..1d16eb6 100644 --- a/frontend/src/lib/components/icons/Lock.svelte +++ b/frontend/src/lib/components/icons/Lock.svelte @@ -1,5 +1,5 @@ - \ No newline at end of file + svg { + @apply stroke-sspsBlue fill-sspsBlue; + } + g, + path { + @apply fill-sspsBlue stroke-sspsBlue; + } + diff --git a/frontend/src/lib/components/icons/Person.svelte b/frontend/src/lib/components/icons/Person.svelte index 954a815..ba7c3b6 100644 --- a/frontend/src/lib/components/icons/Person.svelte +++ b/frontend/src/lib/components/icons/Person.svelte @@ -1,4 +1,4 @@ - - import lion from '$lib/assets/logo/lion.png'; - + import lion from '$lib/assets/logo/lion.png'; + +
@@ -8,5 +9,4 @@
\ No newline at end of file + diff --git a/frontend/src/lib/components/layout/FullLayout.svelte b/frontend/src/lib/components/layout/FullLayout.svelte index 9dea958..5aa2d26 100644 --- a/frontend/src/lib/components/layout/FullLayout.svelte +++ b/frontend/src/lib/components/layout/FullLayout.svelte @@ -6,7 +6,7 @@
- +
@@ -21,7 +21,7 @@ diff --git a/frontend/src/lib/components/textfield/TelephoneField.svelte b/frontend/src/lib/components/textfield/TelephoneField.svelte index 5f21175..7963f6f 100644 --- a/frontend/src/lib/components/textfield/TelephoneField.svelte +++ b/frontend/src/lib/components/textfield/TelephoneField.svelte @@ -6,29 +6,22 @@ export let value: string = ''; export let error: string = ''; - // Phone Number formatting + // Phone Number formatting $: { let x = value.replace(/\D/g, '').match(/(\d{0,3})(\d{0,3})(\d{0,3})(\d{0,3})/)!; value = - (x[1] ? '+' + x[1] : '') + (x[2] ? ' ' + x[2] : '') + (x[3] ? ' ' + x[3] : '') + (x[4] ? ' ' + x[4] : ''); + (x[1] ? '+' + x[1] : '') + + (x[2] ? ' ' + x[2] : '') + + (x[3] ? ' ' + x[3] : '') + + (x[4] ? ' ' + x[4] : ''); } - +
\ No newline at end of file + diff --git a/frontend/src/lib/stores/candidate.ts b/frontend/src/lib/stores/candidate.ts index a7fe70d..0f8c2b1 100644 --- a/frontend/src/lib/stores/candidate.ts +++ b/frontend/src/lib/stores/candidate.ts @@ -1,26 +1,26 @@ -import { writable } from "svelte/store"; +import { writable } from 'svelte/store'; export interface CandidateData { - name?: string; - surname?: string; - birthplace?: string; - birthdate?: string; - address?: string; - telephone?: string; - citizenship?: string; - email?: string; - sex?: string; - study?: string; - personalIdNumber?: string; - parentName?: string; - parentSurname?: string; - parentTelephone?: string; - parentEmail?: string; + name?: string; + surname?: string; + birthplace?: string; + birthdate?: string; + address?: string; + telephone?: string; + citizenship?: string; + email?: string; + sex?: string; + study?: string; + personalIdNumber?: string; + parentName?: string; + parentSurname?: string; + parentTelephone?: string; + parentEmail?: string; } export interface CandidateLogin { - applicationId: number; - password: string; + applicationId: number; + password: string; } -export const candidateData = writable({}); \ No newline at end of file +export const candidateData = writable({}); diff --git a/frontend/src/lib/stores/portfolio.ts b/frontend/src/lib/stores/portfolio.ts index 63bd20b..7bb7aa6 100644 --- a/frontend/src/lib/stores/portfolio.ts +++ b/frontend/src/lib/stores/portfolio.ts @@ -1,26 +1,26 @@ -import { apiFetchSubmissionProgress } from "../@api/candidate"; -import { writable } from "svelte/store"; +import { apiFetchSubmissionProgress } from '../@api/candidate'; +import { writable } from 'svelte/store'; export type Status = 'submitted' | 'uploaded' | 'missing'; export enum UploadStatus { - None = 1, - Some = 2, - All = 3, - Submitted = 4, + None = 1, + Some = 2, + All = 3, + Submitted = 4 } export interface SubmissionProgress { - status?: UploadStatus; - files?: [number]; + status?: UploadStatus; + files?: [number]; } export const submissionProgress = writable({}); export async function fetchSubmProgress() { - try { - const prog = await apiFetchSubmissionProgress(); - submissionProgress.set(prog); - } catch (e) { - console.error(e); - } -} \ No newline at end of file + try { + const prog = await apiFetchSubmissionProgress(); + submissionProgress.set(prog); + } catch (e) { + console.error(e); + } +} diff --git a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte index b541240..ad877f8 100644 --- a/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte +++ b/frontend/src/routes/(candidate)/(authenticated)/register/+page.svelte @@ -43,7 +43,10 @@ name: yup.string().required(), surname: yup.string(), email: yup.string().email().required(), - telephone: yup.string().required().matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/), + telephone: yup + .string() + .required() + .matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/), birthplace: yup.string().required(), birthdate: yup.string().required(), sex: yup.string(), @@ -53,24 +56,27 @@ study: yup.string().required(), parentName: yup.string(), parentSurname: yup.string(), - parentTelephone: yup.string().required().matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/), + parentTelephone: yup + .string() + .required() + .matches(/^\+\d{1,3} \d{3} \d{3} \d{3}$/), parentEmail: yup.string().email().required() }), onSubmit: async (values) => { if (pageIndex === pageCount) { try { - console.log("submit") + console.log('submit'); // @ts-ignore // love javascript delete values.undefined; - values.birthdate = '2000-01-01' // TODO: reformat user typed date + values.birthdate = '2000-01-01'; // TODO: reformat user typed date await apiFillDetails(values); - goto("/dashboard"); + goto('/dashboard'); } catch (e) { - console.error("error while submitting data: " + e); + console.error('error while submitting data: ' + e); } } - }, + } }); $: console.log($errors); @@ -84,7 +90,10 @@ break; case 1: - if (/* $errors.birthdurname || */ $errors.birthplace || $errors.birthdate /* || $errors.sex */) { + if ( + /* $errors.birthdurname || */ $errors.birthplace || + $errors.birthdate /* || $errors.sex */ + ) { return true; } break; @@ -158,11 +167,7 @@

- + - +
@@ -278,7 +279,7 @@ { await handleSubmit(e); - console.log("clicked " + isPageInvalid()); + console.log('clicked ' + isPageInvalid()); if (isPageInvalid()) return; if (pageIndex === pageCount) { } else { diff --git a/frontend/src/routes/(candidate)/auth/logout/+page.server.ts b/frontend/src/routes/(candidate)/auth/logout/+page.server.ts index 3df003b..90f31a7 100644 --- a/frontend/src/routes/(candidate)/auth/logout/+page.server.ts +++ b/frontend/src/routes/(candidate)/auth/logout/+page.server.ts @@ -6,8 +6,8 @@ import { apiLogout } from '$lib/@api/candidate'; export const load: PageServerLoad = async ({ fetch, cookies }) => { await apiLogout(fetch); - cookies.delete('id', { path: '/' }); - cookies.delete('key', { path: '/' }); + cookies.delete('id', { path: '/' }); + cookies.delete('key', { path: '/' }); throw redirect(302, '/auth/login'); }; diff --git a/frontend/windi.config.ts b/frontend/windi.config.ts index 4efe0ed..50c1365 100644 --- a/frontend/windi.config.ts +++ b/frontend/windi.config.ts @@ -1,13 +1,13 @@ import { defineConfig } from 'windicss/helpers'; export default defineConfig({ - theme: { - extend: { - colors: { - "sspsBlue": '#406280', - "sspsBlueDark": '#243a55', - "sspsGray": "#e6e6e6", - } - } - } + theme: { + extend: { + colors: { + sspsBlue: '#406280', + sspsBlueDark: '#243a55', + sspsGray: '#e6e6e6' + } + } + } });