refactor: rename Module to ECUE, update routes, UI, and API messages
Check Deno code / Check Deno code (pull_request) Failing after 27s
Tests / Unit tests (pull_request) Successful in 12s
Tests / Integration tests (pull_request) Successful in 1m16s

refactor: rename Module to ECUE in API, UI, and error messages
This commit is contained in:
2026-05-01 14:26:00 +02:00
parent b6586f7715
commit ae4d4d3020
10 changed files with 36 additions and 31 deletions
+10 -4
View File
@@ -31,13 +31,14 @@ import * as $_apps_admin_partials_roles from "./routes/(apps)/admin/partials/rol
import * as $_apps_admin_partials_ues from "./routes/(apps)/admin/partials/ues.tsx"; import * as $_apps_admin_partials_ues from "./routes/(apps)/admin/partials/ues.tsx";
import * as $_apps_admin_partials_users from "./routes/(apps)/admin/partials/users.tsx"; import * as $_apps_admin_partials_users from "./routes/(apps)/admin/partials/users.tsx";
import * as $_apps_admin_users_id_ from "./routes/(apps)/admin/users/[id].tsx"; import * as $_apps_admin_users_id_ from "./routes/(apps)/admin/users/[id].tsx";
import * as $_apps_mobility_slug_ from "./routes/(apps)/mobility/[slug].tsx"; import * as $_apps_mobility_slug_ from "./routes/(apps)/mobility/[...slug].tsx";
import * as $_apps_mobility_api_mobilites from "./routes/(apps)/mobility/api/mobilites.ts"; import * as $_apps_mobility_api_mobilites from "./routes/(apps)/mobility/api/mobilites.ts";
import * as $_apps_mobility_api_mobilites_idMob_ from "./routes/(apps)/mobility/api/mobilites/[idMob].ts"; import * as $_apps_mobility_api_mobilites_idMob_ from "./routes/(apps)/mobility/api/mobilites/[idMob].ts";
import * as $_apps_mobility_api_mobilites_idMob_contrat from "./routes/(apps)/mobility/api/mobilites/[idMob]/contrat.ts"; import * as $_apps_mobility_api_mobilites_idMob_contrat from "./routes/(apps)/mobility/api/mobilites/[idMob]/contrat.ts";
import * as $_apps_mobility_index from "./routes/(apps)/mobility/index.tsx"; import * as $_apps_mobility_index from "./routes/(apps)/mobility/index.tsx";
import * as $_apps_mobility_partials_index from "./routes/(apps)/mobility/partials/index.tsx"; import * as $_apps_mobility_partials_index from "./routes/(apps)/mobility/partials/index.tsx";
import * as $_apps_mobility_partials_overview from "./routes/(apps)/mobility/partials/overview.tsx"; import * as $_apps_mobility_partials_overview from "./routes/(apps)/mobility/partials/overview.tsx";
import * as $_apps_mobility_partials_overview_numEtud_ from "./routes/(apps)/mobility/partials/overview/[numEtud].tsx";
import * as $_apps_notes_slug_ from "./routes/(apps)/notes/[slug].tsx"; import * as $_apps_notes_slug_ from "./routes/(apps)/notes/[slug].tsx";
import * as $_apps_notes_api_ajustements from "./routes/(apps)/notes/api/ajustements.ts"; import * as $_apps_notes_api_ajustements from "./routes/(apps)/notes/api/ajustements.ts";
import * as $_apps_notes_api_ajustements_numEtud_idUE_ from "./routes/(apps)/notes/api/ajustements/[numEtud]/[idUE].ts"; import * as $_apps_notes_api_ajustements_numEtud_idUE_ from "./routes/(apps)/notes/api/ajustements/[numEtud]/[idUE].ts";
@@ -54,12 +55,13 @@ import * as $_apps_notes_partials_admin_import from "./routes/(apps)/notes/parti
import * as $_apps_notes_partials_index from "./routes/(apps)/notes/partials/index.tsx"; import * as $_apps_notes_partials_index from "./routes/(apps)/notes/partials/index.tsx";
import * as $_apps_notes_partials_notes from "./routes/(apps)/notes/partials/notes.tsx"; import * as $_apps_notes_partials_notes from "./routes/(apps)/notes/partials/notes.tsx";
import * as $_apps_notes_recap_numEtud_ from "./routes/(apps)/notes/recap/[numEtud].tsx"; import * as $_apps_notes_recap_numEtud_ from "./routes/(apps)/notes/recap/[numEtud].tsx";
import * as $_apps_stages_slug_ from "./routes/(apps)/stages/[slug].tsx"; import * as $_apps_stages_slug_ from "./routes/(apps)/stages/[...slug].tsx";
import * as $_apps_stages_api_stages from "./routes/(apps)/stages/api/stages.ts"; import * as $_apps_stages_api_stages from "./routes/(apps)/stages/api/stages.ts";
import * as $_apps_stages_api_stages_idStage_ from "./routes/(apps)/stages/api/stages/[idStage].ts"; import * as $_apps_stages_api_stages_idStage_ from "./routes/(apps)/stages/api/stages/[idStage].ts";
import * as $_apps_stages_index from "./routes/(apps)/stages/index.tsx"; import * as $_apps_stages_index from "./routes/(apps)/stages/index.tsx";
import * as $_apps_stages_partials_index from "./routes/(apps)/stages/partials/index.tsx"; import * as $_apps_stages_partials_index from "./routes/(apps)/stages/partials/index.tsx";
import * as $_apps_stages_partials_overview from "./routes/(apps)/stages/partials/overview.tsx"; import * as $_apps_stages_partials_overview from "./routes/(apps)/stages/partials/overview.tsx";
import * as $_apps_stages_partials_overview_numEtud_ from "./routes/(apps)/stages/partials/overview/[numEtud].tsx";
import * as $_apps_students_slug_ from "./routes/(apps)/students/[slug].tsx"; import * as $_apps_students_slug_ from "./routes/(apps)/students/[slug].tsx";
import * as $_apps_students_api_promotions from "./routes/(apps)/students/api/promotions.ts"; import * as $_apps_students_api_promotions from "./routes/(apps)/students/api/promotions.ts";
import * as $_apps_students_api_promotions_idPromo_ from "./routes/(apps)/students/api/promotions/[idPromo].ts"; import * as $_apps_students_api_promotions_idPromo_ from "./routes/(apps)/students/api/promotions/[idPromo].ts";
@@ -145,7 +147,7 @@ const manifest = {
"./routes/(apps)/admin/partials/ues.tsx": $_apps_admin_partials_ues, "./routes/(apps)/admin/partials/ues.tsx": $_apps_admin_partials_ues,
"./routes/(apps)/admin/partials/users.tsx": $_apps_admin_partials_users, "./routes/(apps)/admin/partials/users.tsx": $_apps_admin_partials_users,
"./routes/(apps)/admin/users/[id].tsx": $_apps_admin_users_id_, "./routes/(apps)/admin/users/[id].tsx": $_apps_admin_users_id_,
"./routes/(apps)/mobility/[slug].tsx": $_apps_mobility_slug_, "./routes/(apps)/mobility/[...slug].tsx": $_apps_mobility_slug_,
"./routes/(apps)/mobility/api/mobilites.ts": $_apps_mobility_api_mobilites, "./routes/(apps)/mobility/api/mobilites.ts": $_apps_mobility_api_mobilites,
"./routes/(apps)/mobility/api/mobilites/[idMob].ts": "./routes/(apps)/mobility/api/mobilites/[idMob].ts":
$_apps_mobility_api_mobilites_idMob_, $_apps_mobility_api_mobilites_idMob_,
@@ -156,6 +158,8 @@ const manifest = {
$_apps_mobility_partials_index, $_apps_mobility_partials_index,
"./routes/(apps)/mobility/partials/overview.tsx": "./routes/(apps)/mobility/partials/overview.tsx":
$_apps_mobility_partials_overview, $_apps_mobility_partials_overview,
"./routes/(apps)/mobility/partials/overview/[numEtud].tsx":
$_apps_mobility_partials_overview_numEtud_,
"./routes/(apps)/notes/[slug].tsx": $_apps_notes_slug_, "./routes/(apps)/notes/[slug].tsx": $_apps_notes_slug_,
"./routes/(apps)/notes/api/ajustements.ts": $_apps_notes_api_ajustements, "./routes/(apps)/notes/api/ajustements.ts": $_apps_notes_api_ajustements,
"./routes/(apps)/notes/api/ajustements/[numEtud]/[idUE].ts": "./routes/(apps)/notes/api/ajustements/[numEtud]/[idUE].ts":
@@ -178,7 +182,7 @@ const manifest = {
"./routes/(apps)/notes/partials/index.tsx": $_apps_notes_partials_index, "./routes/(apps)/notes/partials/index.tsx": $_apps_notes_partials_index,
"./routes/(apps)/notes/partials/notes.tsx": $_apps_notes_partials_notes, "./routes/(apps)/notes/partials/notes.tsx": $_apps_notes_partials_notes,
"./routes/(apps)/notes/recap/[numEtud].tsx": $_apps_notes_recap_numEtud_, "./routes/(apps)/notes/recap/[numEtud].tsx": $_apps_notes_recap_numEtud_,
"./routes/(apps)/stages/[slug].tsx": $_apps_stages_slug_, "./routes/(apps)/stages/[...slug].tsx": $_apps_stages_slug_,
"./routes/(apps)/stages/api/stages.ts": $_apps_stages_api_stages, "./routes/(apps)/stages/api/stages.ts": $_apps_stages_api_stages,
"./routes/(apps)/stages/api/stages/[idStage].ts": "./routes/(apps)/stages/api/stages/[idStage].ts":
$_apps_stages_api_stages_idStage_, $_apps_stages_api_stages_idStage_,
@@ -186,6 +190,8 @@ const manifest = {
"./routes/(apps)/stages/partials/index.tsx": $_apps_stages_partials_index, "./routes/(apps)/stages/partials/index.tsx": $_apps_stages_partials_index,
"./routes/(apps)/stages/partials/overview.tsx": "./routes/(apps)/stages/partials/overview.tsx":
$_apps_stages_partials_overview, $_apps_stages_partials_overview,
"./routes/(apps)/stages/partials/overview/[numEtud].tsx":
$_apps_stages_partials_overview_numEtud_,
"./routes/(apps)/students/[slug].tsx": $_apps_students_slug_, "./routes/(apps)/students/[slug].tsx": $_apps_students_slug_,
"./routes/(apps)/students/api/promotions.ts": "./routes/(apps)/students/api/promotions.ts":
$_apps_students_api_promotions, $_apps_students_api_promotions,
+4 -4
View File
@@ -106,7 +106,7 @@ export default function EditUser({ userId }: Props) {
async function addEnseignement() { async function addEnseignement() {
if (!addModule || !addPromo) { if (!addModule || !addPromo) {
setAddError("Module et Promo sont requis"); setAddError("ECUE et Promo sont requis");
return; return;
} }
setAdding(true); setAdding(true);
@@ -276,7 +276,7 @@ export default function EditUser({ userId }: Props) {
class="col-dim" class="col-dim"
style="font-size: 0.75rem; margin: 0 0 0.75rem" style="font-size: 0.75rem; margin: 0 0 0.75rem"
> >
Modules enseignes par cet utilisateur ECUEs enseignes par cet utilisateur
</p> </p>
{enseignements.length > 0 {enseignements.length > 0
@@ -285,7 +285,7 @@ export default function EditUser({ userId }: Props) {
<table class="data-table"> <table class="data-table">
<thead> <thead>
<tr> <tr>
<th>Module</th> <th>ECUE</th>
<th>Promo</th> <th>Promo</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@@ -360,7 +360,7 @@ export default function EditUser({ userId }: Props) {
setAddModule((e.target as HTMLSelectElement).value)} setAddModule((e.target as HTMLSelectElement).value)}
style="min-width: 12rem" style="min-width: 12rem"
> >
<option value="">Module</option> <option value="">ECUE</option>
{modules.map((m) => ( {modules.map((m) => (
<option key={m.id} value={m.id}> <option key={m.id} value={m.id}>
{m.id} -- {m.nom} {m.id} -- {m.nom}
@@ -229,15 +229,14 @@ export default function ImportMaquette() {
added++; added++;
details.push({ details.push({
type: "change", type: "change",
message: `Module ${mod.code} "${mod.name}" cree`, message: `ECUE ${mod.code} "${mod.name}" cree`,
}); });
} else if (modRes.status !== 409) { } else if (modRes.status !== 409) {
errCount++; errCount++;
details.push({ details.push({
type: "error", type: "error",
message: `Module "${mod.code}" : creation echouee`, message: `ECUE "${mod.code}" : creation echouee`,
}); }); continue;
continue;
} }
const linkRes = await fetch("/admin/api/ue-modules", { const linkRes = await fetch("/admin/api/ue-modules", {
@@ -446,7 +445,7 @@ export default function ImportMaquette() {
<p style="font-size: 0.85rem; font-weight: 700; margin: 0"> <p style="font-size: 0.85rem; font-weight: 700; margin: 0">
{year.label} {year.label}
<span class="col-dim" style="font-weight: 400"> <span class="col-dim" style="font-weight: 400">
{year.ues.length} UE, {totalMods} modules {year.ues.length} UE, {totalMods} ECUEs
</span> </span>
</p> </p>
<select <select
@@ -473,7 +472,7 @@ export default function ImportMaquette() {
<thead> <thead>
<tr> <tr>
<th>UE</th> <th>UE</th>
<th>Module</th> <th>ECUE</th>
<th>Code</th> <th>Code</th>
<th>Coeff</th> <th>Coeff</th>
</tr> </tr>
@@ -485,7 +484,7 @@ export default function ImportMaquette() {
<tr key={`ue-${i}`}> <tr key={`ue-${i}`}>
<td style="font-weight: 600">{ue.name}</td> <td style="font-weight: 600">{ue.name}</td>
<td class="col-dim" colspan={3}> <td class="col-dim" colspan={3}>
Aucun module Aucun ECUE
</td> </td>
</tr> </tr>
) )
@@ -550,7 +549,7 @@ export default function ImportMaquette() {
<p class="upload-format"> <p class="upload-format">
Format : fichier maquette FISE / FISA avec lignes <strong>UE</strong> Format : fichier maquette FISE / FISA avec lignes <strong>UE</strong>
et <strong>modules</strong> (colonnes code, nom, coefficient) et <strong>ECUEs</strong> (colonnes code, nom, coefficient)
</p> </p>
</div> </div>
); );
+2 -2
View File
@@ -8,7 +8,7 @@ const properties: AppProperties = {
users: "Utilisateurs", users: "Utilisateurs",
roles: "Rôles", roles: "Rôles",
permissions: "Permissions", permissions: "Permissions",
modules: "Modules", modules: "ECUEs",
enseignements: "Enseignements", enseignements: "Enseignements",
promotions: "Promotions", promotions: "Promotions",
ues: "UEs", ues: "UEs",
@@ -25,7 +25,7 @@ const properties: AppProperties = {
"import-maquette", "import-maquette",
], ],
employeeOnly: true, employeeOnly: true,
hint: "PolyMPR module", hint: "PolyMPR ECUE",
}; };
export default properties; export default properties;
+1 -1
View File
@@ -44,7 +44,7 @@ export const handler: Handlers<null, AuthenticatedState> = {
if (existing) { if (existing) {
return new Response( return new Response(
JSON.stringify({ error: "Un module avec cet identifiant existe déjà" }), JSON.stringify({ error: "Un ECUE avec cet identifiant existe déjà" }),
{ status: 409, headers: { "content-type": "application/json" } }, { status: 409, headers: { "content-type": "application/json" } },
); );
} }
+2 -2
View File
@@ -65,8 +65,8 @@ export const handler: Handlers = {
headers: { "Content-Type": "application/json" }, headers: { "Content-Type": "application/json" },
}); });
} catch (error) { } catch (error) {
console.error("Error creating UE-module:", error); console.error("Error creating UE-ECUE:", error);
return new Response("Failed to create UE-module", { status: 500 }); return new Response("Failed to create UE-ECUE", { status: 500 });
} }
}, },
}; };
@@ -6,7 +6,7 @@ import { and, eq } from "npm:drizzle-orm@0.45.2";
const NOT_FOUND = () => const NOT_FOUND = () =>
new Response( new Response(
JSON.stringify({ error: "Association UE-Module introuvable" }), JSON.stringify({ error: "Association UE-ECUE introuvable" }),
{ status: 404, headers: { "content-type": "application/json" } }, { status: 404, headers: { "content-type": "application/json" } },
); );
@@ -581,7 +581,7 @@ export default function ImportNotes() {
))} ))}
</div> </div>
<p class="col-dim" style="font-size: 0.72rem; margin-top: 0.35rem"> <p class="col-dim" style="font-size: 0.72rem; margin-top: 0.35rem">
M = module (importe) | UE = moyenne UE (ignore) | X = malus M = ECUE (importe) | UE = moyenne UE (ignore) | X = malus
</p> </p>
</div> </div>
)} )}
@@ -618,7 +618,7 @@ export default function ImportNotes() {
<p class="upload-format"> <p class="upload-format">
Format : <strong>Nom</strong> | <strong>Prenom</strong> |{" "} Format : <strong>Nom</strong> | <strong>Prenom</strong> |{" "}
<strong>CODE - Module</strong> (colonnes notes){" "} <strong>CODE - ECUE</strong> (colonnes notes){" "}
les colonnes UE et MALUS sont auto-detectees les colonnes UE et MALUS sont auto-detectees
</p> </p>
</div> </div>
+2 -2
View File
@@ -324,14 +324,14 @@ export default function NoteRecap({ numEtud }: Props) {
)} )}
</div> </div>
{/* Module rows */} {/* ECUE rows */}
{ueMods.length === 0 {ueMods.length === 0
? ( ? (
<p <p
class="col-dim" class="col-dim"
style="font-size: 0.8rem; padding: 0.25rem 0; margin-bottom: 0.75rem" style="font-size: 0.8rem; padding: 0.25rem 0; margin-bottom: 0.75rem"
> >
Aucun module associe a cette UE pour cette promotion. Aucun ECUE associe a cette UE pour cette promotion.
</p> </p>
) )
: ( : (
+1 -1
View File
@@ -225,7 +225,7 @@ export default function NotesView({ numEtud, prenom }: Props) {
<div key={um.idModule} class="ue-module-row"> <div key={um.idModule} class="ue-module-row">
<span class="ue-module-name"> <span class="ue-module-name">
{mod ? mod.id : um.idModule} {" "} {mod ? mod.id : um.idModule} {" "}
{mod ? mod.nom : "Module inconnu"} (coef {um.coeff}) {mod ? mod.nom : "ECUE inconnu"} (coef {um.coeff})
</span> </span>
<span class={`score-chip ${scoreClass(effective)}`}> <span class={`score-chip ${scoreClass(effective)}`}>
{effective !== null ? `${effective}/20` : "—"} {effective !== null ? `${effective}/20` : "—"}