Skip to content

Commit a65de98

Browse files
committed
update: preregister CE & Team process
1 parent 8afd57d commit a65de98

7 files changed

Lines changed: 239 additions & 214 deletions

File tree

backend/drizzle.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dotenv.config();
66
export default defineConfig({
77
schema: "./src/schemas/*",
88
out: "./src/database/migrations",
9-
dialect:"postgresql",
9+
dialect: "postgresql",
1010
dbCredentials: {
1111
url: process.env.OUTSIDE_DATABASE_URL ?? ""
1212
},
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
import { db } from "../db"; // Assurez-vous que votre instance db est correcte
2-
import {userSchema } from "../../schemas/Basic/user.schema";
2+
import { userSchema } from "../../schemas/Basic/user.schema";
33
import { zimbra_password } from "../../utils/secret";
44
import { hashPassword } from "../../services/auth.service";
55

66
export const initUser = async () => {
7-
const existingUser = await db.select().from(userSchema).limit(1);
8-
9-
const hashedPassword = await hashPassword(zimbra_password);
10-
// Si il n'y a pas de ligne existante, insérer une nouvelle ligne
11-
if (existingUser.length === 0) {
12-
await db.insert(userSchema).values({
13-
first_name: "Integration UTT",
14-
last_name: "Integration UTT",
15-
email: "integration@utt.fr",
16-
majeur: true,
17-
password: hashedPassword,
18-
permission: 'Admin',
19-
});
20-
}
21-
};
7+
const existingUser = await db.select().from(userSchema).limit(1);
8+
9+
const hashedPassword = await hashPassword(zimbra_password);
10+
11+
// Si il n'y a pas de ligne existante, insérer une nouvelle ligne
12+
if (existingUser.length === 0) {
13+
await db.insert(userSchema).values({
14+
first_name: "Integration UTT",
15+
last_name: "Integration UTT",
16+
email: "integration@utt.fr",
17+
majeur: true,
18+
password: hashedPassword,
19+
permission: 'Admin',
20+
});
21+
}
22+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { useEffect, useState } from "react";
2+
import { checkPreRegisterStatus } from "../../services/requests/event.service";
3+
4+
export const PreregisterCESection = () => {
5+
const [isPreRegistrationOpen, setIsPreRegistrationOpen] = useState(false);
6+
7+
useEffect(() => {
8+
const fetchStatus = async () => {
9+
try {
10+
const status = await checkPreRegisterStatus();
11+
setIsPreRegistrationOpen(status);
12+
} catch (error) {
13+
alert("Erreur lors de la récupération du statut de pré-inscription.");
14+
}
15+
};
16+
fetchStatus();
17+
}, []);
18+
19+
return (
20+
<div className="max-w-4xl mx-auto p-6 sm:p-8 bg-gradient-to-r from-blue-100 via-blue-200 to-blue-300 rounded-xl shadow-lg">
21+
<h2 className="text-2xl sm:text-3xl font-bold mb-1 text-center text-gray-800">
22+
Pré-inscription personnelle
23+
</h2>
24+
<p className="text-center text-gray-600 mb-4">
25+
Une réponse <u>par étudiant</u>
26+
</p>
27+
28+
{isPreRegistrationOpen ? (
29+
<>
30+
<div className="relative pb-[56.25%] rounded-lg shadow overflow-hidden mb-4">
31+
<iframe
32+
src="https://forms.gle/32yHKGSTzfFvp7NP9"
33+
className="absolute inset-0 w-full h-full border-none"
34+
title="Formulaire de pré-inscription CE"
35+
loading="lazy"
36+
>
37+
Chargement…
38+
</iframe>
39+
</div>
40+
</>
41+
) : (
42+
<p className="text-center text-red-500 text-lg font-semibold">
43+
La pré-inscription est actuellement fermée.
44+
</p>
45+
)}
46+
</div>
47+
);
48+
};

frontend/src/components/shotgun/preregisterGForm.tsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

frontend/src/components/shotgun/preregisterSection.tsx

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)