diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 83db25c..3efd3d8 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -5,7 +5,6 @@ import { NavRail } from "./components/NavRail";
import { OnlineClassroom } from "./OnlineClassroom";
import { Scans } from "./Scans";
import { Reports } from "./Reports";
-import { genMachineryCarnet } from "./carnetGenerator/machinery";
const App: Component = () => (
@@ -22,22 +21,9 @@ const App: Component = () => (
function Builder() {
- const svgRaw = genMachineryCarnet({
- fullname: "FERNANDO ENRIQUE ARAOZ MORALES",
- dni: "74059695",
- code: "0123",
- expiryMonth: "NOVIEMBRE",
- expiryYear: "2023",
- qrBase64: "",
- certName: "RETROEXCAVADORA",
- certCustomLabel: "246D3 CAT",
- });
-
return (
);
}
diff --git a/frontend/src/OnlineClassroom/ClassroomVinculation.tsx b/frontend/src/OnlineClassroom/ClassroomVinculation.tsx
index 3e1ba07..05d1129 100644
--- a/frontend/src/OnlineClassroom/ClassroomVinculation.tsx
+++ b/frontend/src/OnlineClassroom/ClassroomVinculation.tsx
@@ -4,12 +4,12 @@ import { JsonResult } from "../types/JsonResult";
import { XcircleIcon } from "../icons/XCircleIcon";
import { LoadingStatus, backend, useLoading, wait } from "../utils/functions";
import { LinkIcon } from "../icons/LinkIcon";
-import { For, Show, createSignal, onMount } from "solid-js";
+import { For, Show, createMemo, createSignal, onMount } from "solid-js";
import { LoadingIcon } from "../icons/LoadingIcon";
import { AxiosError } from "axios";
export function ClassroomVinculation(props: {
- person_surname: string,
+ person_fullname: string,
personId: number,
onLink: (classroom_id: number, classroom_username: string) => void,
}) {
@@ -20,7 +20,7 @@ export function ClassroomVinculation(props: {
setClassroomUsers([]);
setStatus(LoadingStatus.Loading);
- backend.get
>>(`/api/classroom/users/${encodeURIComponent(props.person_surname)}`)
+ backend.get>>(`/api/classroom/users/${encodeURIComponent(props.person_fullname)}`)
.then((response) => {
if (response.status === 200) {
setClassroomUsers(response.data.Ok);
@@ -66,6 +66,7 @@ export function ClassroomVinculation(props: {
{(u) => (
@@ -89,6 +90,7 @@ export function ClassroomVinculation(props: {
function ClassroomSingleUser(props: {
user: ClassroomRegistrationUser,
+ expectedName: string,
onLink: (classroom_id: number, classroom_username: string) => void,
personId: number,
}) {
@@ -124,13 +126,28 @@ function ClassroomSingleUser(props: {
});
};
+ const namesMatch = createMemo(() => {
+ const expected = props.expectedName.toUpperCase().split(" ");
+ const actual = `${props.user.name} ${props.user.surname}`.toUpperCase().split(" ");
+
+ for (let i = 0; i < expected.length; i += 1) {
+ if (expected[i] !== actual[i]) {
+ return false;
+ }
+ }
+
+ return true;
+ });
+
return (
- {props.user.name} {props.user.surname}
+
+ {props.user.name} {props.user.surname}
+
diff --git a/frontend/src/OnlineClassroom/index.tsx b/frontend/src/OnlineClassroom/index.tsx
index 3936328..24087a1 100644
--- a/frontend/src/OnlineClassroom/index.tsx
+++ b/frontend/src/OnlineClassroom/index.tsx
@@ -71,7 +71,7 @@ function ClassroomUser(props: {