bugsfixed and design changes for generation 13'' screen

This commit is contained in:
José Lima
2025-02-23 18:47:57 +00:00
parent fec3b51553
commit 340ff5a30a
29 changed files with 2292 additions and 1680 deletions

View File

@@ -30,7 +30,6 @@ export const getServerSideProps = withIronSessionSsr(async ({ req, res }) => {
entities,
"view_student_performance"
);
if (allowedEntities.length === 0) return redirect("/");
const students = await (checkAccess(user, ["admin", "developer"])
@@ -58,10 +57,11 @@ const StudentPerformance = ({ user, students, entities, groups }: Props) => {
const performanceStudents = students.map((u) => ({
...u,
group: groups.find((x) => x.participants.includes(u.id))?.name || "N/A",
entitiesLabel: mapBy(u.entities, "id")
.map((id) => entities.find((e) => e.id === id)?.label)
.filter((e) => !!e)
.join(", "),
entitiesLabel: (u.entities || []).reduce((acc, curr, idx) => {
const entity = entities.find((e) => e.id === curr.id);
if (idx === 0) return entity ? entity.label : "";
return acc + (entity ? `${entity.label}` : "");
}, ""),
}));
return (