diff --git a/client/dist.zip b/client/dist.zip index ebfb4ada7ca20402b6a6db58501a33a6c174a45f..14c374e5a3a5633790ef506b0673d72b7b86b7c1 100644 Binary files a/client/dist.zip and b/client/dist.zip differ diff --git a/client/package.json b/client/package.json index 70510ffba55bb71c53b21267e096a5db862d7c76..afc9c1b5d47c0be4cbe6b76472f320353a90e1f2 100644 --- a/client/package.json +++ b/client/package.json @@ -18,21 +18,21 @@ "@solid-primitives/event-listener": "^2.3.3", "@solid-primitives/i18n": "^2.1.1", "@solid-primitives/utils": "^6.2.3", - "@solidjs/router": "^0.14.7", - "@types/bun": "^1.1.10", - "@typescript-eslint/eslint-plugin": "^8.8.1", - "@typescript-eslint/parser": "^8.8.1", + "@solidjs/router": "^0.14.10", + "@types/bun": "^1.1.13", + "@typescript-eslint/eslint-plugin": "^8.15.0", + "@typescript-eslint/parser": "^8.15.0", "autoprefixer": "^10.4.20", "clsx": "^2.1.1", "dotenv": "^16.4.5", - "eslint": "^9.12.0", + "eslint": "^9.15.0", "phosphor-solid-js": "2.0.0", - "postcss": "^8.4.47", + "postcss": "^8.4.49", "postcss-load-config": "^6.0.1", "prettier": "^3.3.3", - "prettier-plugin-tailwindcss": "^0.6.8", - "solid-js": "^1.9.2", - "tailwindcss": "^3.4.13", + "prettier-plugin-tailwindcss": "^0.6.9", + "solid-js": "^1.9.3", + "tailwindcss": "^3.4.15", "typescript": "^5.6.3", "vite": "5.4.8", "vite-plugin-solid": "^2.10.2" diff --git a/client/prepare_deploy.sh b/client/prepare_deploy.sh new file mode 100644 index 0000000000000000000000000000000000000000..e99f3bdfd2ba6fbefcac51771fb05706126373db --- /dev/null +++ b/client/prepare_deploy.sh @@ -0,0 +1,2 @@ +bun run build +zip -r dist.zip dist/ diff --git a/client/src/binding/ParticipantInfo.ts b/client/src/binding/ParticipantInfo.ts index bac4e0fd16f26fc5d26a6a8e6558c232dc5ebabe..be5d9a34e21be0931bc8fdebab7428f283e8b9e6 100644 --- a/client/src/binding/ParticipantInfo.ts +++ b/client/src/binding/ParticipantInfo.ts @@ -1,8 +1,17 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { Competition } from "./Competition"; import type { DietaryRestriction } from "./DietaryRestriction"; +import type { Role } from "./Role"; import type { TshirtSize } from "./TshirtSize"; +import type { University } from "./University"; export type ParticipantInfo = { + first_name: string; + last_name: string; + email: string; + role: Role; + competition: Competition; + university: University; medical_conditions: string | null; allergies: string | null; pronouns: string | null; diff --git a/client/src/components/forms/AdditionnalInfoForm.tsx b/client/src/components/forms/AdditionnalInfoForm.tsx index 4bdf1000d1db9acbc7c8821642e0c79ed2ab4ee9..e4b28c69677fc9edb3c16e603759e95590f8bb6f 100644 --- a/client/src/components/forms/AdditionnalInfoForm.tsx +++ b/client/src/components/forms/AdditionnalInfoForm.tsx @@ -5,7 +5,6 @@ import { SubmitHandler, } from "@modular-forms/solid" import { TextInput } from "../forms-component/TextInput" -import { Checkbox } from "../forms-component/Checkbox" import { ParticipantInfo } from "../../binding/ParticipantInfo" import { Select } from "../forms-component/Select" import { FileInput } from "../forms-component/FileInput" @@ -15,7 +14,6 @@ import { t } from "../../stores/locale" import { SubmitError } from "../forms-component/SubmitError" import { SubmitSuccess } from "../forms-component/SubmitSuccess" import { YesNo } from "../forms-component/YesNo" -import { InputLabel } from "../forms-component/InputLabel" export function AdditionalInfoForm() { const [loginForm, { Form, Field }] = createForm<ParticipantInfo>() @@ -52,6 +50,12 @@ export function AdditionalInfoForm() { method="post" onSubmit={handleSubmit} > + <div class="flex w-full flex-col gap-1 font-medium md:text-lg lg:text-xl"> + <span>Nom : {localStorage.getItem("name")}</span> + <span>Université : {localStorage.getItem("university")}</span> + <span>Rôle: {localStorage.getItem("role")}</span> + <span>Compétition: {localStorage.getItem("competition")}</span> + </div> <Field name="pronouns" validate={[required(t("additionalInfo.required"))]} @@ -345,10 +349,10 @@ export function AdditionalInfoForm() { )} </Field> - <div class="flex flex-col justify-center"> + <div class="flex flex-col items-center justify-center"> <button type="submit" - class="flex justify-center rounded-md bg-light-highlight px-5 py-4 text-xl font-semibold leading-6 text-white shadow-sm hover:bg-light-highlight focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-light-highlight" + class="flex w-fit justify-center rounded-md bg-light-highlight px-5 py-4 text-xl font-semibold leading-6 text-white shadow-sm hover:bg-light-highlight focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-light-highlight" > Mettre à jour les renseignements personnels </button> diff --git a/client/src/components/forms/ParticipantForm.tsx b/client/src/components/forms/ParticipantForm.tsx index 7e204e429a9bb317c455c9734960dab74fa4d654..2c068948fd35a6d47cb875f059c89b8b18edc4e4 100644 --- a/client/src/components/forms/ParticipantForm.tsx +++ b/client/src/components/forms/ParticipantForm.tsx @@ -205,7 +205,7 @@ export default function ParticipantForm() { /> )} </For> - {localStorage.getItem("role") !== "volunteer" && ( + {localStorage.getItem("role") == "organizer" && ( <tr class="border-b border-gray-200"> <td class="p-2"> <Field name="first_name"> diff --git a/server/src/model/participant_info.rs b/server/src/model/participant_info.rs index 4b55c9f1de01d28f8ab69a7a1f81ac8cfb84e23d..1f4d77cc2178bb99f33a452f02404941895a73a5 100644 --- a/server/src/model/participant_info.rs +++ b/server/src/model/participant_info.rs @@ -8,12 +8,19 @@ use uuid::Uuid; use crate::utility::{deserialize_base64, serialize_base64}; use super::{ - dietary_restriction::DietaryRestriction, tshirt_size::TshirtSize, university::University, + competition::Competition, dietary_restriction::DietaryRestriction, role::Role, + tshirt_size::TshirtSize, university::University, }; #[derive(Debug, Serialize, Deserialize, sqlx::FromRow, TS)] #[ts(export)] pub struct ParticipantInfo { + pub first_name: String, + pub last_name: String, + pub email: String, + pub role: Role, + pub competition: Competition, + pub university: University, pub medical_conditions: Option<String>, pub allergies: Option<String>, pub pronouns: Option<String>, diff --git a/server/src/routes/new_participant.rs b/server/src/routes/new_participant.rs index c098d1bdf7e52cf69167a7660e694128b55b5a10..d5c1f1fa9fb00fbdeadbfa121f0d82efc99ff6ae 100644 --- a/server/src/routes/new_participant.rs +++ b/server/src/routes/new_participant.rs @@ -19,8 +19,8 @@ pub async fn new_participant( } if claims.role == Role::Chef - && ((participant.role == Role::Organizer || participant.role == Role::Volunteer) - || participant.university != claims.university) + // && ((participant.role == Role::Organizer || participant.role == Role::Volunteer) + // || participant.university != claims.university) { return (StatusCode::FORBIDDEN, "Forbidden").into_response(); }