Skip to content

Commit

Permalink
add button for freezing series and semester
Browse files Browse the repository at this point in the history
  • Loading branch information
vikibrezinova committed Aug 22, 2024
1 parent fab06e5 commit 7fc3929
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions src/components/SemesterAdministration/SemesterAdministration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Loading} from '../Loading/Loading'
import {PublicationUploader} from '../PublicationUploader/PublicationUploader'
import {Result} from '../Results/ResultsRow'
import styles from './SemesterAdministration.module.scss'
import { SecurityUpdateSharp } from '@mui/icons-material'

Check failure on line 17 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·SecurityUpdateSharp·` with `SecurityUpdateSharp`

Check warning on line 17 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

'SecurityUpdateSharp' is defined but never used

interface PostalCard {
code: number
Expand Down Expand Up @@ -102,21 +103,33 @@ export const SemesterAdministration: FC = () => {
return (
<>
<Typography variant="h3">Administrácia semestra pre opravovateľov.</Typography>
<Stack mt={3} pl={2} alignItems="start">
<Button variant="button2" onClick={() => axios.post(`/api/competition/semester/${semester.id}/results/freeze`)}>
Uzavrieť semester
</Button>
</Stack>
{semester.series_set.map((series) => (
<Stack key={series.id} gap={1} mt={5}>
<Typography variant="h2">{series.order}. séria</Typography>
<Stack direction="row" justifyContent="space-between" alignItems="center">
<Typography variant="h3">Opravovanie úloh:</Typography>
<Typography variant="body1" component="div">
<b>Termín série:</b> {formatDateTime(series.deadline)}
</Typography>
</Stack>
<Stack px={2} direction="row" justifyContent="space-between">
{series?.problems.map((problem) => (
<Link key={problem.id} variant="button2" href={`/strom/admin/opravit-ulohu/${problem.id}`}>
{problem.order}. úloha
</Link>
))}
<Stack>

Check failure on line 112 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Missing "key" prop for element in iterator
<Stack key={series.id} gap={1} mt={5}>
<Typography variant="h2">{series.order}. séria</Typography>
<Stack pl={2} alignItems="start">
<Button variant="button2" onClick={() => axios.post(`/api/competition/series/${series.id}/results/freeze`)}>

Check failure on line 116 in src/components/SemesterAdministration/SemesterAdministration.tsx

View workflow job for this annotation

GitHub Actions / branch-test

Replace `·variant="button2"·onClick={()·=>·axios.post(`/api/competition/series/${series.id}/results/freeze`)}` with `⏎················variant="button2"⏎················onClick={()·=>·axios.post(`/api/competition/series/${series.id}/results/freeze`)}⏎··············`
Uzavrieť sériu
</Button>
</Stack>
<Stack direction="row" justifyContent="space-between" alignItems="center">
<Typography variant="h3">Opravovanie úloh:</Typography>
<Typography variant="body1" component="div">
<b>Termín série:</b> {formatDateTime(series.deadline)}
</Typography>
</Stack>
<Stack px={2} direction="row" justifyContent="space-between">
{series?.problems.map((problem) => (
<Link key={problem.id} variant="button2" href={`/strom/admin/opravit-ulohu/${problem.id}`}>
{problem.order}. úloha
</Link>
))}
</Stack>
</Stack>
</Stack>
))}
Expand Down

0 comments on commit 7fc3929

Please sign in to comment.