From cd1fbd56f62d70560ab729679ee20f89d5a5a125 Mon Sep 17 00:00:00 2001 From: Michal Masrna Date: Sun, 24 Nov 2024 11:16:21 +0100 Subject: [PATCH] SemesterAdministration only display Freeze buttons if the series/semester is not yet complete --- .../SemesterAdministration.tsx | 20 +++++++++++++------ src/types/api/generated/competition.ts | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/components/SemesterAdministration/SemesterAdministration.tsx b/src/components/SemesterAdministration/SemesterAdministration.tsx index 13f5d06b..604bd2f7 100644 --- a/src/components/SemesterAdministration/SemesterAdministration.tsx +++ b/src/components/SemesterAdministration/SemesterAdministration.tsx @@ -132,18 +132,26 @@ export const SemesterAdministration: FC = () => { <> Semester - + {semester.complete ? ( + Semester je uzavretý + ) : ( + + )} {semesterFreezeError && {semesterFreezeError}} {semester.series_set.map((series) => ( {series.order}. séria - + {series.complete ? ( + Séria je uzavretá + ) : ( + + )} {seriesFreezeError && {seriesFreezeError}} diff --git a/src/types/api/generated/competition.ts b/src/types/api/generated/competition.ts index 7f9d0dae..78610e60 100644 --- a/src/types/api/generated/competition.ts +++ b/src/types/api/generated/competition.ts @@ -142,6 +142,7 @@ export interface Semester { start: string end: string additional_name?: string | null + complete: boolean frozen_results?: string | null competition?: any | null late_tags?: any[] @@ -159,6 +160,7 @@ export interface SemesterWithProblems { start: string end: string additional_name?: string | null + complete: boolean frozen_results?: string | null competition?: any | null late_tags?: any[]