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

View file

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

View file

@ -72,7 +72,7 @@
</tr>
<tr>
<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>
</tbody>
</table>
@ -100,7 +100,7 @@
</table>
</div>
</div>
{/each}
{/each}
<div class="my-8">
<div class="flex flex-col">

View file

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

View file

@ -4,19 +4,8 @@
export let error: string = '';
</script>
<input
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
>
<input 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">
<span class="text-2xl">📜</span>

View file

@ -61,11 +61,11 @@
</script>
<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)} />
<div class="mr-4">
<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
bind:showDetails
on:download={downloadPortfolio}
@ -75,12 +75,12 @@
</div>
</div>
</div>
<div class="relative flex flex-col my-2 overflow-hidden">
<div class="relative my-2 flex flex-col overflow-hidden">
<div>
<span class="absolute -left-16 -top-36">
<Circles />
</span>
<div class="flex flex-col mt-[5%]">
<div class="mt-[5%] flex flex-col">
<h3>{title}</h3>
<slot />
</div>
@ -95,11 +95,12 @@
showOnCreate: false,
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
>Datum narození: <span class="font-bold">{$candidateData.candidate.birthdate}</span></span
>Datum narození: <span class="font-bold">{$candidateData.candidate.birthdate}</span
></span
>
<span
>Místo narození: <span class="font-bold">{$candidateData.candidate.birthplace}</span
@ -119,11 +120,12 @@
showOnCreate: false,
delay: 0
}}
class="flex flex-col leading-10 mt-4"
class="mt-4 flex flex-col leading-10"
>
{#each $candidateData.parents as parent}
<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>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 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}
<div role="status">
<svg
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"
fill="none"
xmlns="http://www.w3.org/2000/svg"

View file

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

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 335 B

View file

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

Before

Width:  |  Height:  |  Size: 283 B

After

Width:  |  Height:  |  Size: 281 B

View file

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

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -29,7 +29,7 @@
.bgImage {
@apply -z-20;
@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 {
@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 placeholder: string = '';
export let value: string = '';
export let error: string = '';
@ -15,7 +15,17 @@
}
</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">
<Person />
</div>

View file

@ -3,7 +3,7 @@
export let helperText: string = '';
export let placeholder: string = '';
export let value: string = '';
export let error: string = '';
@ -13,4 +13,13 @@
}
</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 placeholder: string = '';
export let value: string = '';
export let error: string = '';
</script>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
import { redirect } from "@sveltejs/kit";
import type { PageLoad } from "./$types";
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
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)}
<div
class="movable name col-span-3 row-span-4"
animate:flip={{ duration: 400}}
animate:flip={{ duration: 400 }}
class:showDetailsInfoCard={showDetails}
>
<DashboardInfoCard

View file

@ -133,7 +133,9 @@
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);
goto('/dashboard');
@ -320,7 +322,6 @@
bind:value={$form.candidate.birthdate}
type="text"
placeholder="Datum narození"
helperText="TODO: (Uveďte ve formátu DD.MM.RRRR)"
/>
<div class="ml-2">
@ -471,7 +472,7 @@
<button
class:dotActive={i === pageIndex}
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 (i > pageIndex) {
// if next page is clicked, validate current page

View file

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