refactor: rename Module to ECUE, update routes, UI, and API messages
refactor: rename Module to ECUE in API, UI, and error messages
This commit is contained in:
+10
-4
@@ -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_users from "./routes/(apps)/admin/partials/users.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_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_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_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_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";
|
||||
@@ -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_notes from "./routes/(apps)/notes/partials/notes.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_idStage_ from "./routes/(apps)/stages/api/stages/[idStage].ts";
|
||||
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_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_api_promotions from "./routes/(apps)/students/api/promotions.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/users.tsx": $_apps_admin_partials_users,
|
||||
"./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/[idMob].ts":
|
||||
$_apps_mobility_api_mobilites_idMob_,
|
||||
@@ -156,6 +158,8 @@ const manifest = {
|
||||
$_apps_mobility_partials_index,
|
||||
"./routes/(apps)/mobility/partials/overview.tsx":
|
||||
$_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/api/ajustements.ts": $_apps_notes_api_ajustements,
|
||||
"./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/notes.tsx": $_apps_notes_partials_notes,
|
||||
"./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/[idStage].ts":
|
||||
$_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/overview.tsx":
|
||||
$_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/api/promotions.ts":
|
||||
$_apps_students_api_promotions,
|
||||
|
||||
@@ -106,7 +106,7 @@ export default function EditUser({ userId }: Props) {
|
||||
|
||||
async function addEnseignement() {
|
||||
if (!addModule || !addPromo) {
|
||||
setAddError("Module et Promo sont requis");
|
||||
setAddError("ECUE et Promo sont requis");
|
||||
return;
|
||||
}
|
||||
setAdding(true);
|
||||
@@ -276,7 +276,7 @@ export default function EditUser({ userId }: Props) {
|
||||
class="col-dim"
|
||||
style="font-size: 0.75rem; margin: 0 0 0.75rem"
|
||||
>
|
||||
Modules enseignes par cet utilisateur
|
||||
ECUEs enseignes par cet utilisateur
|
||||
</p>
|
||||
|
||||
{enseignements.length > 0
|
||||
@@ -285,7 +285,7 @@ export default function EditUser({ userId }: Props) {
|
||||
<table class="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Module</th>
|
||||
<th>ECUE</th>
|
||||
<th>Promo</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
@@ -360,7 +360,7 @@ export default function EditUser({ userId }: Props) {
|
||||
setAddModule((e.target as HTMLSelectElement).value)}
|
||||
style="min-width: 12rem"
|
||||
>
|
||||
<option value="">Module</option>
|
||||
<option value="">ECUE</option>
|
||||
{modules.map((m) => (
|
||||
<option key={m.id} value={m.id}>
|
||||
{m.id} -- {m.nom}
|
||||
|
||||
@@ -229,15 +229,14 @@ export default function ImportMaquette() {
|
||||
added++;
|
||||
details.push({
|
||||
type: "change",
|
||||
message: `Module ${mod.code} "${mod.name}" cree`,
|
||||
});
|
||||
} else if (modRes.status !== 409) {
|
||||
errCount++;
|
||||
details.push({
|
||||
message: `ECUE ${mod.code} "${mod.name}" cree`,
|
||||
});
|
||||
} else if (modRes.status !== 409) {
|
||||
errCount++;
|
||||
details.push({
|
||||
type: "error",
|
||||
message: `Module "${mod.code}" : creation echouee`,
|
||||
});
|
||||
continue;
|
||||
message: `ECUE "${mod.code}" : creation echouee`,
|
||||
}); continue;
|
||||
}
|
||||
|
||||
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">
|
||||
{year.label}
|
||||
<span class="col-dim" style="font-weight: 400">
|
||||
— {year.ues.length} UE, {totalMods} modules
|
||||
— {year.ues.length} UE, {totalMods} ECUEs
|
||||
</span>
|
||||
</p>
|
||||
<select
|
||||
@@ -473,7 +472,7 @@ export default function ImportMaquette() {
|
||||
<thead>
|
||||
<tr>
|
||||
<th>UE</th>
|
||||
<th>Module</th>
|
||||
<th>ECUE</th>
|
||||
<th>Code</th>
|
||||
<th>Coeff</th>
|
||||
</tr>
|
||||
@@ -485,7 +484,7 @@ export default function ImportMaquette() {
|
||||
<tr key={`ue-${i}`}>
|
||||
<td style="font-weight: 600">{ue.name}</td>
|
||||
<td class="col-dim" colspan={3}>
|
||||
Aucun module
|
||||
Aucun ECUE
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
@@ -550,7 +549,7 @@ export default function ImportMaquette() {
|
||||
|
||||
<p class="upload-format">
|
||||
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>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ const properties: AppProperties = {
|
||||
users: "Utilisateurs",
|
||||
roles: "Rôles",
|
||||
permissions: "Permissions",
|
||||
modules: "Modules",
|
||||
modules: "ECUEs",
|
||||
enseignements: "Enseignements",
|
||||
promotions: "Promotions",
|
||||
ues: "UEs",
|
||||
@@ -25,7 +25,7 @@ const properties: AppProperties = {
|
||||
"import-maquette",
|
||||
],
|
||||
employeeOnly: true,
|
||||
hint: "PolyMPR module",
|
||||
hint: "PolyMPR ECUE",
|
||||
};
|
||||
|
||||
export default properties;
|
||||
|
||||
@@ -44,7 +44,7 @@ export const handler: Handlers<null, AuthenticatedState> = {
|
||||
|
||||
if (existing) {
|
||||
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" } },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ export const handler: Handlers = {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error creating UE-module:", error);
|
||||
return new Response("Failed to create UE-module", { status: 500 });
|
||||
console.error("Error creating UE-ECUE:", error);
|
||||
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 = () =>
|
||||
new Response(
|
||||
JSON.stringify({ error: "Association UE-Module introuvable" }),
|
||||
JSON.stringify({ error: "Association UE-ECUE introuvable" }),
|
||||
{ status: 404, headers: { "content-type": "application/json" } },
|
||||
);
|
||||
|
||||
|
||||
@@ -581,7 +581,7 @@ export default function ImportNotes() {
|
||||
))}
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
)}
|
||||
@@ -618,7 +618,7 @@ export default function ImportNotes() {
|
||||
|
||||
<p class="upload-format">
|
||||
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
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -324,14 +324,14 @@ export default function NoteRecap({ numEtud }: Props) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Module rows */}
|
||||
{/* ECUE rows */}
|
||||
{ueMods.length === 0
|
||||
? (
|
||||
<p
|
||||
class="col-dim"
|
||||
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>
|
||||
)
|
||||
: (
|
||||
|
||||
@@ -225,7 +225,7 @@ export default function NotesView({ numEtud, prenom }: Props) {
|
||||
<div key={um.idModule} class="ue-module-row">
|
||||
<span class="ue-module-name">
|
||||
{mod ? mod.id : um.idModule} —{" "}
|
||||
{mod ? mod.nom : "Module inconnu"} (coef {um.coeff})
|
||||
{mod ? mod.nom : "ECUE inconnu"} (coef {um.coeff})
|
||||
</span>
|
||||
<span class={`score-chip ${scoreClass(effective)}`}>
|
||||
{effective !== null ? `${effective}/20` : "—"}
|
||||
|
||||
Reference in New Issue
Block a user