Skip to content

Commit

Permalink
style: some more textual improvements as required for #4
Browse files Browse the repository at this point in the history
  • Loading branch information
stefa168 committed May 31, 2024
1 parent 131ebb5 commit 4bc8e25
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
// todo catch potential errors
deleteCommission(commissionToBeDeleted).then(() => {
onDeletionAlertStateChange(false);
toast.success("La commissione è stata eliminata correttamente.");
toast.success("La sessione è stata eliminata correttamente.");
// todo redirect only if the currently opened commission is the one that has been deleted
// todo redirect eagerly to avoid potential issues
goto('/');
Expand Down Expand Up @@ -89,7 +89,7 @@
<NewCommissionDialog/>
</li>
<li>
<DropdownButton buttonText="Problemi Attivi"
<DropdownButton buttonText="Sessioni Attive"
childCount={$commissionsPreview.length}
loaded={$commissionsPreviewLoaded}
open={true}>
Expand Down Expand Up @@ -151,15 +151,15 @@
{:else}
<li class="flex items-center mx-2 ps-4 p-2 text-yellow-600 group dark:text-yellow-400">
<MdiAlertCircleOutline class="w-5 h-5"/>
<span class="ms-2 text-sm font-medium">Nessun problema disponibile</span>
<span class="ms-2 text-sm font-medium">Nessuna sessione di laurea disponibile</span>
</li>
{/if}
</DropdownButton>
</li>
<li class="mt-4">
<Button variant="ghost" class="px-3 w-full justify-start" disabled>
<RadixIconsArchive class="me-2 h-4 w-4"/>
Problemi Archiviati
Sessioni Archiviate
</Button>
</li>
<li class="mt-4 pb-4 ">
Expand Down
4 changes: 2 additions & 2 deletions web/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="mt-32 flex flex-col items-center justify-center h-full">
<MdiRobotConfusedOutline class="w-16 h-16"/>
<div class="mt-4 text-center text-lg font-medium text-gray-600 dark:text-gray-400">
<p>Non hai aperto alcun problema.</p>
<p>Per iniziare, scegline o creane uno usando il menù laterale.</p>
<p>Non hai aperto alcuna Sessione di Laurea.</p>
<p>Per iniziare, scegline o creane una usando il menù laterale.</p>
</div>
</div>
2 changes: 1 addition & 1 deletion web/src/routes/NewCommissionDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
variant="ghost"
class="px-3 w-full justify-start">
<MdiCalendarPlusOutline class="me-2 h-4 w-4"/>
Nuovo Problema
Nuova Sessione di Laurea
</Button>

<Dialog.Root
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/commission/[id]/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
const sections: Section[] = [
{label: 'Informazioni', name: 'info', path: '', icon: MdiInformationVariantBoxOutline},
{label: 'Studenti Candidati', name: 'candidates', icon: NimbusUniversity},
{label: 'Docenti della Commissione', name: 'professors', icon: MaterialSymbolsPersonPin},
{label: 'Docenti della Sessione', name: 'professors', icon: MaterialSymbolsPersonPin},
{label: 'Ottimizzazione', name: 'optimization', icon: MageRobotUwuFill},
];
</script>
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/commission/[id]/+layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function load({fetch, params}) {
switch (response.status) {
case 404: {
throw error(404,
`La commissione con ID ${params.id} non esiste.
`La Sessione di Laurea con ID ${params.id} non esiste.
Dettagli: ${await response.text()}`
);
}
Expand Down
12 changes: 7 additions & 5 deletions web/src/routes/commission/[id]/optimization/[opt_id]/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface FormOptConf {
max_duration: number,
max_commissions_morning: number,
max_commissions_afternoon: number,
// Some settings were only available for "Online" sessions, however now they are treated as "additional settings".
// That's why they're called "online" settings in this file, instead of "additional settings".
online: boolean,

min_professor_number: number | null,
Expand Down Expand Up @@ -60,19 +62,19 @@ export const optimizationConfigurationSchema = z.object({
// If online, then the minimum number of professors must be defined
return data.online ? data.min_professor_number !== null : true;
}, {
message: "Il numero minimo di professori deve essere definito se la commissione è online",
message: "Il numero minimo di professori deve essere definito se sono abilitate le impostazioni aggiuntive",
path: ["min_professor_number"]
}).refine((data) => {
// If online, then the minimum number of professors for the master's degree must be defined
return data.online ? data.min_professor_number_masters !== null : true;
}, {
message: "Il numero minimo di professori per il corso di laurea magistrale deve essere definito se la commissione è online",
message: "Il numero minimo di professori per il corso di laurea magistrale deve essere definito se sono abilitate le impostazioni aggiuntive",
path: ["min_professor_number_masters"]
}).refine((data) => {
// If online, then the maximum number of professors must be defined
return data.online ? data.max_professor_number !== null : true;
}, {
message: "Il numero massimo di professori deve essere definito se la commissione è online",
message: "Il numero massimo di professori deve essere definito se sono abilitate le impostazioni aggiuntive",
path: ["max_professor_number"]
}).refine((data) => {
// If online, then the minimum number of professors must be less than or equal to the maximum number of professors
Expand All @@ -82,7 +84,7 @@ export const optimizationConfigurationSchema = z.object({
return true;
}
}, {
message: "Il numero minimo di professori deve essere minore o uguale al numero massimo di professori se la commissione è online",
message: "Il numero minimo di professori deve essere minore o uguale al numero massimo di professori se sono abilitate le impostazioni aggiuntive",
path: ["min_professor_number", "max_professor_number"]
}).refine((data) => {
// If online, then the minimum number of professors must be less than or equal to the maximum number of professors
Expand All @@ -92,7 +94,7 @@ export const optimizationConfigurationSchema = z.object({
return true;
}
}, {
message: "Il numero minimo di professori deve essere minore o uguale al numero massimo di professori se la commissione è online",
message: "Il numero minimo di professori deve essere minore o uguale al numero massimo di professori se sono abilitate le impostazioni aggiuntive",
path: ["min_professor_number_masters", "max_professor_number"]
}).refine((data) => {
// If online, then the minimum number of professors for the master's degree must be less than or equal to the maximum number of professors
Expand Down
8 changes: 4 additions & 4 deletions web/src/routes/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import {z} from "zod";
export const commissionFormSchema = z.object({
title: z
.string()
.min(3, {message: "Il titolo della commissione deve essere avere almeno 3 caratteri"})
.max(256, {message: "Il titolo della commissione deve avere al massimo 256 caratteri"}),
.min(3, {message: "Il titolo della sessione deve essere avere almeno 3 caratteri"})
.max(256, {message: "Il titolo della sessione deve avere al massimo 256 caratteri"}),
excel: z
.instanceof(File, {message: "E' necessario indicare il file della commissione."})
.refine((f) => f.name.includes('xls') || f.name.includes('xlsx'), "Il file della commissione deve essere in formato xls o xlsx")
.instanceof(File, {message: "E' necessario indicare il file della sessione."})
.refine((f) => f.name.includes('xls') || f.name.includes('xlsx'), "Il file della sessione deve essere in formato xls o xlsx")
.nullable()
});

0 comments on commit 4bc8e25

Please sign in to comment.