Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bortoz committed Nov 25, 2024
1 parent db0ff34 commit d52df00
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/cli/firebase/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ async function importUsers(users: User[], customClaims: object, options: ImportO
let user = await auth.getUserByEmail(record.email).catch(noop);
if (!user) {
user = await auth.createUser({
uid: record.id,
email: record.email,
emailVerified: true,
password: record.password,
Expand Down Expand Up @@ -305,6 +306,7 @@ async function importVariantMappings(db: Firestore, options: ImportOptions) {
}

const userSchema = z.object({
id: z.string().optional(),
name: z.string(),
email: z.string().email(),
password: z.string(),
Expand Down
11 changes: 7 additions & 4 deletions src/web/teacher/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ const FinalizeModal = forwardRef(function FinalizeModal(
// Generate a list of string that can uniquely identify a student. Multiple
// strings are generated to prevent possible errors during data entry.
function normalize(student: Student) {
const info = student.userData!;
const info = student.userData;
const orderings = [
["name", "surname", "classYear", "classSection"],
["surname", "name", "classYear", "classSection"],
];
return orderings.map((fields) => {
return deburr(fields.map((field) => info[field]).join("\n"))
return deburr(fields.map((field) => info?.[field] ?? "").join("\n"))
.toLowerCase()
.replaceAll(/[^\w\n]/g, "");
});
Expand Down Expand Up @@ -247,7 +247,7 @@ const DeleteModal = forwardRef(function DeleteModal(
<i>Seleziona tutti</i>&rdquo; come filtro.
</p>
<Form onSubmit={confirm} className="!max-w-full">
<CheckboxField field="notAgain" label="Non mostrare più questo pop-up" />
<CheckboxField field="notAgain" label="Non mostrare più questo pop-up" optional />
<div className="flex flex-wrap justify-center gap-2">
<FormButton onClick={() => close("0")}>Annulla</FormButton>
<SubmitButton className="btn-warning">Continua</SubmitButton>
Expand Down Expand Up @@ -382,7 +382,10 @@ function Table() {
singleClickEdit={true}
suppressClickEdit={frozen}
readOnlyEdit={true}
rowSelection="single"
rowSelection={{
mode: "singleRow",
checkboxes: false,
}}
onCellEditRequest={onCellEditRequest}
enableBrowserTooltips={true}
localeText={AG_GRID_LOCALE_IT}
Expand Down

0 comments on commit d52df00

Please sign in to comment.