Merge pull request #107 from EETagent/formatting_more

(frontend) formatting
This commit is contained in:
Vojtěch Jungmann 2022-12-23 22:51:55 +01:00 committed by GitHub
commit fe6ce2ed43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 70 additions and 64 deletions

View file

@ -125,7 +125,7 @@ export const apiUploadCoverLetter = async (
export const apiDeleteCoverLetter = async (): Promise<boolean> => { export const apiDeleteCoverLetter = async (): Promise<boolean> => {
try { try {
await axios.delete(API_URL + '/candidate/remove/cover_letter', { await axios.delete(API_URL + '/candidate/remove/cover_letter', {
withCredentials: true, withCredentials: true
}); });
return true; return true;
} catch (e) { } catch (e) {
@ -155,7 +155,7 @@ export const apiUploadPortfolioLetter = async (
export const apiDeletePortfolioLetter = async (): Promise<boolean> => { export const apiDeletePortfolioLetter = async (): Promise<boolean> => {
try { try {
await axios.delete(API_URL + '/candidate/remove/portfolio_letter', { await axios.delete(API_URL + '/candidate/remove/portfolio_letter', {
withCredentials: true, withCredentials: true
}); });
return true; return true;
} catch (e) { } catch (e) {
@ -185,7 +185,7 @@ export const apiUploadPortfolioZip = async (
export const apiDeletePortfolioZip = async (): Promise<boolean> => { export const apiDeletePortfolioZip = async (): Promise<boolean> => {
try { try {
await axios.delete(API_URL + '/candidate/remove/portfolio_zip', { await axios.delete(API_URL + '/candidate/remove/portfolio_zip', {
withCredentials: true, withCredentials: true
}); });
return true; return true;
} catch (e) { } catch (e) {

View file

@ -11,4 +11,4 @@ export interface ApiError {
export const errorHandler = (error: AxiosError | unknown, msg: string): ApiError => { export const errorHandler = (error: AxiosError | unknown, msg: string): ApiError => {
return { error, msg }; return { error, msg };
} };

View file

@ -72,7 +72,7 @@
</tr> </tr>
<tr> <tr>
<td class="px-2 py-2 font-semibold text-gray-500">Pohlaví</td> <td class="px-2 py-2 font-semibold text-gray-500">Pohlaví</td>
<td class="px-2 py-2">{candidate.sex ?? "NEUVEDENO"}</td> <td class="px-2 py-2">{candidate.sex ?? 'NEUVEDENO'}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -100,7 +100,7 @@
</table> </table>
</div> </div>
</div> </div>
{/each} {/each}
<div class="my-8"> <div class="my-8">
<div class="flex flex-col"> <div class="flex flex-col">

View file

@ -7,8 +7,8 @@
<style> <style>
input { input {
@apply bg-sspsBlue hover:bg-sspsBlueDark @apply bg-sspsBlue hover:bg-sspsBlueDark
@apply rounded-lg p-3 text-xl font-semibold text-white @apply @apply rounded-lg p-3 text-xl font-semibold
@apply transition-colors duration-300; text-white transition-colors duration-300;
@apply w-full; @apply w-full;
} }
</style> </style>

View file

@ -4,19 +4,8 @@
export let error: string = ''; export let error: string = '';
</script> </script>
<input <input class:error on:change type="checkbox" id="gdpr" bind:checked={value} class="peer hidden" />
class:error <label for="gdpr" class="peer-checked:border-sspsBlue peer-checked:text-gray-600" class:error>
on:change
type="checkbox"
id="gdpr"
bind:checked={value}
class="peer hidden"
/>
<label
for="gdpr"
class="peer-checked:border-sspsBlue peer-checked:text-gray-600"
class:error
>
<div class="block"> <div class="block">
<span class="text-2xl">📜</span> <span class="text-2xl">📜</span>

View file

@ -61,11 +61,11 @@
</script> </script>
<div class="card flex flex-col"> <div class="card flex flex-col">
<div class="infoBar flex flex-row-reverse <2xl:flex-col"> <div class="infoBar <2xl:flex-col flex flex-row-reverse">
<StatusNotificationBig {loading} {status} on:click={debounce(handleNotificationClick, 150)} /> <StatusNotificationBig {loading} {status} on:click={debounce(handleNotificationClick, 150)} />
<div class="mr-4"> <div class="mr-4">
<div on:click on:keydown class="flex flex-col"> <div on:click on:keydown class="flex flex-col">
<div class="flex flex-col <2xl:ml-auto <2xl:flex-row <2xl:my-2"> <div class="<2xl:ml-auto <2xl:flex-row <2xl:my-2 flex flex-col">
<InfoButton <InfoButton
bind:showDetails bind:showDetails
on:download={downloadPortfolio} on:download={downloadPortfolio}
@ -75,12 +75,12 @@
</div> </div>
</div> </div>
</div> </div>
<div class="relative flex flex-col my-2 overflow-hidden"> <div class="relative my-2 flex flex-col overflow-hidden">
<div> <div>
<span class="absolute -left-16 -top-36"> <span class="absolute -left-16 -top-36">
<Circles /> <Circles />
</span> </span>
<div class="flex flex-col mt-[5%]"> <div class="mt-[5%] flex flex-col">
<h3>{title}</h3> <h3>{title}</h3>
<slot /> <slot />
</div> </div>
@ -95,11 +95,12 @@
showOnCreate: false, showOnCreate: false,
delay: 0 delay: 0
}} }}
class="flex flex-col justify-between leading-10 mt-4" class="mt-4 flex flex-col justify-between leading-10"
> >
<span>Adresa: <span class="font-bold">{$candidateData.candidate.address}</span></span> <span>Adresa: <span class="font-bold">{$candidateData.candidate.address}</span></span>
<span <span
>Datum narození: <span class="font-bold">{$candidateData.candidate.birthdate}</span></span >Datum narození: <span class="font-bold">{$candidateData.candidate.birthdate}</span
></span
> >
<span <span
>Místo narození: <span class="font-bold">{$candidateData.candidate.birthplace}</span >Místo narození: <span class="font-bold">{$candidateData.candidate.birthplace}</span
@ -119,11 +120,12 @@
showOnCreate: false, showOnCreate: false,
delay: 0 delay: 0
}} }}
class="flex flex-col leading-10 mt-4" class="mt-4 flex flex-col leading-10"
> >
{#each $candidateData.parents as parent} {#each $candidateData.parents as parent}
<div class="flex flex-col"> <div class="flex flex-col">
<span class="text-sspsBlue text-xl font-bold">{parent.name + ' ' + parent.surname}</span <span class="text-sspsBlue text-xl font-bold"
>{parent.name + ' ' + parent.surname}</span
> >
<span>Email: <span class="font-bold">{parent.email}</span></span> <span>Email: <span class="font-bold">{parent.email}</span></span>
<span>Telefon: <span class="font-bold">{parent.telephone}</span></span> <span>Telefon: <span class="font-bold">{parent.telephone}</span></span>

View file

@ -24,12 +24,12 @@
<div on:click on:keydown class="flex flex-col"> <div on:click on:keydown class="flex flex-col">
<div class="info flex flex-col {status}"> <div class="info flex flex-col {status}">
<span class="2xl:text-xl font-bold text-white">{title}</span> <span class="font-bold text-white 2xl:text-xl">{title}</span>
{#if loading} {#if loading}
<div role="status"> <div role="status">
<svg <svg
aria-hidden="true" aria-hidden="true"
class="my-2 h-6 w-6 animate-spin !fill-sspsBlue text-gray-200" class="!fill-sspsBlue my-2 h-6 w-6 animate-spin text-gray-200"
viewBox="0 0 100 101" viewBox="0 0 100 101"
fill="none" fill="none"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"

View file

@ -1,6 +1,4 @@
<svg <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
><path ><path
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 335 B

View file

@ -1,6 +1,4 @@
<svg <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg"
><path ><path
stroke-linecap="round" stroke-linecap="round"
stroke-linejoin="round" stroke-linejoin="round"

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 281 B

View file

@ -10,7 +10,7 @@
<style> <style>
svg { svg {
@apply stroke-current fill-current; @apply fill-current stroke-current;
} }
g, g,
path { path {

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -29,7 +29,7 @@
.bgImage { .bgImage {
@apply -z-20; @apply -z-20;
@apply min-w-screen absolute min-h-screen md:min-w-[50vw]; @apply min-w-screen absolute min-h-screen md:min-w-[50vw];
@apply bg-no-repeat bg-cover; @apply bg-cover bg-no-repeat;
} }
.bgOverlay { .bgOverlay {
@apply min-w-screen absolute -z-10 min-h-screen md:min-w-[50vw]; @apply min-w-screen absolute -z-10 min-h-screen md:min-w-[50vw];

View file

@ -4,7 +4,7 @@
export let helperText: string = ''; export let helperText: string = '';
export let placeholder: string = ''; export let placeholder: string = '';
export let value: string = ''; export let value: string = '';
export let error: string = ''; export let error: string = '';
@ -15,7 +15,17 @@
} }
</script> </script>
<TextField bind:error bind:value on:keydown on:keyup on:change type="text" {placeholder} {helperText} icon> <TextField
bind:error
bind:value
on:keydown
on:keyup
on:change
type="text"
{placeholder}
{helperText}
icon
>
<div slot="icon" class="flex items-center justify-center"> <div slot="icon" class="flex items-center justify-center">
<Person /> <Person />
</div> </div>

View file

@ -3,7 +3,7 @@
export let helperText: string = ''; export let helperText: string = '';
export let placeholder: string = ''; export let placeholder: string = '';
export let value: string = ''; export let value: string = '';
export let error: string = ''; export let error: string = '';
@ -13,4 +13,13 @@
} }
</script> </script>
<TextField bind:error bind:value on:keydown on:keyup on:change type="number" {placeholder} {helperText} /> <TextField
bind:error
bind:value
on:keydown
on:keyup
on:change
type="number"
{placeholder}
{helperText}
/>

View file

@ -4,7 +4,7 @@
export let helperText: string = ''; export let helperText: string = '';
export let placeholder: string = ''; export let placeholder: string = '';
export let value: string = ''; export let value: string = '';
export let error: string = ''; export let error: string = '';
</script> </script>

View file

@ -16,7 +16,7 @@
import 'tippy.js/dist/tippy.css'; import 'tippy.js/dist/tippy.css';
const isTooltip = helperText ? tippy : () => {}; const isTooltip = helperText ? tippy : () => {};
$: tooltipDelay = error != "" ? 0 : 1000; $: tooltipDelay = error != '' ? 0 : 1000;
</script> </script>
<div <div

View file

@ -1,4 +1,4 @@
export interface AdminLogin { export interface AdminLogin {
adminId: number; adminId: number;
password: string; password: string;
} }

View file

@ -23,4 +23,4 @@ export const fetchSubmProgress = async () => {
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
} };

View file

@ -3,6 +3,6 @@ import type { ParamMatcher } from '@sveltejs/kit';
export const match: ParamMatcher = (param) => { export const match: ParamMatcher = (param) => {
const isNumber = /^\d{6}(?:\d{1})?$/.test(param); const isNumber = /^\d{6}(?:\d{1})?$/.test(param);
const isValid = param.startsWith('101') || param.startsWith('102') || param.startsWith('103'); const isValid = param.startsWith('101') || param.startsWith('102') || param.startsWith('103');
return isNumber && isValid; return isNumber && isValid;
}; };

View file

@ -12,7 +12,6 @@
let candidates: Array<CandidatePreview> = data.preview; let candidates: Array<CandidatePreview> = data.preview;
const getCandidates = async (field?: string) => { const getCandidates = async (field?: string) => {
try { try {
candidates = await apiListCandidates(undefined, field); candidates = await apiListCandidates(undefined, field);

View file

@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit"; import { redirect } from '@sveltejs/kit';
import type { PageLoad } from "./$types"; import type { PageLoad } from './$types';
export const load: PageLoad = () => { export const load: PageLoad = () => {
throw redirect(302, "/admin/auth/login") throw redirect(302, '/admin/auth/login');
} };

View file

@ -45,7 +45,7 @@
{#each [0] as animated (animated)} {#each [0] as animated (animated)}
<div <div
class="movable name col-span-3 row-span-4" class="movable name col-span-3 row-span-4"
animate:flip={{ duration: 400}} animate:flip={{ duration: 400 }}
class:showDetailsInfoCard={showDetails} class:showDetailsInfoCard={showDetails}
> >
<DashboardInfoCard <DashboardInfoCard

View file

@ -133,7 +133,9 @@
values.candidate.birthdate = birthdate_formttted; values.candidate.birthdate = birthdate_formttted;
values.parents.filter((x) => x.name !== '' && x.surname !== '' && x.email !== '' && x.telephone !== ''); values.parents.filter(
(x) => x.name !== '' && x.surname !== '' && x.email !== '' && x.telephone !== ''
);
await apiFillDetails(values); await apiFillDetails(values);
goto('/dashboard'); goto('/dashboard');
@ -320,7 +322,6 @@
bind:value={$form.candidate.birthdate} bind:value={$form.candidate.birthdate}
type="text" type="text"
placeholder="Datum narození" placeholder="Datum narození"
helperText="TODO: (Uveďte ve formátu DD.MM.RRRR)" helperText="TODO: (Uveďte ve formátu DD.MM.RRRR)"
/> />
<div class="ml-2"> <div class="ml-2">
@ -471,7 +472,7 @@
<button <button
class:dotActive={i === pageIndex} class:dotActive={i === pageIndex}
on:click={async (e) => { on:click={async (e) => {
const progress = pagesFilled.slice(0, i ).every((item) => item === true); const progress = pagesFilled.slice(0, i).every((item) => item === true);
if (progress) { if (progress) {
if (i > pageIndex) { if (i > pageIndex) {
// if next page is clicked, validate current page // if next page is clicked, validate current page

View file

@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit"; import { redirect } from '@sveltejs/kit';
import type { PageLoad } from "./$types"; import type { PageLoad } from './$types';
export const load: PageLoad = () => { export const load: PageLoad = () => {
throw redirect(302, "/auth/login") throw redirect(302, '/auth/login');
} };