Skip to content

Commit

Permalink
alles addchange assignment pagina aangepast + restrictie ui duidelijk…
Browse files Browse the repository at this point in the history
…er gemaakt
  • Loading branch information
Bendemeurichy committed May 21, 2024
1 parent cf1d58a commit dff7e07
Show file tree
Hide file tree
Showing 7 changed files with 353 additions and 153 deletions.
14 changes: 10 additions & 4 deletions frontend/frontend/src/components/WarningPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from './CustomComponents'
import { Button, SecondaryButton } from './CustomComponents'
import {
DialogActions,
DialogContent,
Expand Down Expand Up @@ -43,12 +43,18 @@ export default function WarningPopup({
<>
{/* Warning popup dialog */}
<Dialog open={open} onClose={handleClose}>
<DialogTitle id='popUpTitle' sx={{ textAlign: 'center' }}>{title}</DialogTitle>
<DialogTitle id="popUpTitle" sx={{ textAlign: 'center' }}>
{title}
</DialogTitle>
<DialogContent>
<DialogContentText id='popUpText'>{content}</DialogContentText>
<DialogContentText id="popUpText">
{content}
</DialogContentText>
</DialogContent>
<DialogActions sx={{ justifyContent: 'center' }}>
<Button onClick={handleClose}>{t('cancel')}</Button>
<SecondaryButton onClick={handleClose}>
{t('cancel')}
</SecondaryButton>
{/* Action button */}
<Button onClick={hanldeAction} autoFocus>
{buttonName}
Expand Down
12 changes: 10 additions & 2 deletions frontend/frontend/src/i18n/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,20 @@ const english = {
open_with_ui: 'Open with UI',
choose_existing: 'Choose existing',
make_new_script: 'Make new script',
cant_add_teachers_to_student_list: 'You cannot add teachers to the student list',
cant_add_students_to_teacher_list: 'You cannot add students to the teacher list',
cant_add_teachers_to_student_list:
'You cannot add teachers to the student list',
cant_add_students_to_teacher_list:
'You cannot add students to the teacher list',
cant_add_users_twice: 'You cannot add users to a subject twice',
this_user_doesnt_exist: 'This user does not exist',
status: 'Status',
visibility: 'Change Visibility',
template_saved_successfully: 'Template saved successfully',
save_course_warning: 'Save Course?',
try_again: 'Try again',
openinUi: 'Open in UI',
openInEditor: 'Open in editor',
no_params: 'No parameters where found in the template.',
}

export default english
12 changes: 10 additions & 2 deletions frontend/frontend/src/i18n/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,20 @@ const dutch = {
open_with_ui: 'Open met UI',
choose_existing: 'Kies een bestaand script',
make_new_script: 'Maak nieuw script aan',
cant_add_teachers_to_student_list: 'Je kan geen leerkrachten aan de studenten lijst toevoegen',
cant_add_students_to_teacher_list: 'Je kan geen studenten aan de leerkrachten lijst toevoegen',
cant_add_teachers_to_student_list:
'Je kan geen leerkrachten aan de studenten lijst toevoegen',
cant_add_students_to_teacher_list:
'Je kan geen studenten aan de leerkrachten lijst toevoegen',
cant_add_users_twice: 'Je kan gebruikers geen twee keer toevoegen',
this_user_doesnt_exist: 'Deze gebruiker bestaat niet',
status: 'Status',
visibility: 'Verander Zichtbaarheid',
template_saved_successfully: 'Template succesvol opgeslagen',
save_course_warning: 'Vak Opslaan?',
try_again: 'Probeer opnieuw',
openinUi: 'Open in UI',
openInEditor: 'Open in editor',
no_params: 'Geen parameters gevonden in de template.',
}

export default dutch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import DialogTitle from '@mui/material/DialogTitle'
import AddIcon from '@mui/icons-material/Add'
import RestrictionsDialog from './RestrictionsDialog'
import { t } from 'i18next'
import { IconButton } from '@mui/material'
import { IconButton, Tooltip } from '@mui/material'
import { restriction } from './AddChangeAssignmentPage.tsx'

/**
Expand Down Expand Up @@ -36,19 +36,21 @@ export default function AddRestrictionButton({
return (
<>
{/* Add Restriction Button */}
<IconButton
id="addRestrictionButton"
sx={{
bgcolor: 'secondary.main',
marginRight: 1,
}}
onClick={() => {
setOpen(true)
setScroll('paper')
}}
>
<AddIcon sx={{ color: 'secondary.contrastText' }}></AddIcon>
</IconButton>
<Tooltip title={t('add_restriction')}>
<IconButton
id="addRestrictionButton"
sx={{
bgcolor: 'secondary.main',
marginRight: 1,
}}
onClick={() => {
setOpen(true)
setScroll('paper')
}}
>
<AddIcon sx={{ color: 'secondary.contrastText' }}></AddIcon>
</IconButton>
</Tooltip>
{/* Add Restriction Dialog */}
<Dialog
open={open}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useState } from 'react'
import {
Box,
TextField,
Button,
Checkbox,
IconButton,
List,
ListItem,
ListItemText,
IconButton,
Button,
TextField,
} from '@mui/material'
import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline'
Expand All @@ -16,6 +16,7 @@ import AppBar from '@mui/material/AppBar'
import Toolbar from '@mui/material/Toolbar'
import CloseIcon from '@mui/icons-material/Close'
import { restriction } from './AddChangeAssignmentPage.tsx'
import { t } from 'i18next'

// Define a type for the parameters
type ParamValue = string | number | boolean | string[]
Expand Down Expand Up @@ -242,6 +243,18 @@ export default function RestrictionTemplateUI({
</Toolbar>
</AppBar>
<Box aria-label={'Content'} padding={1}>
{params.length === 0 && (
<Box
height={'100%'}
alignItems={'center'}
display={'flex'}
justifyContent={'center'}
width={'100%'}
flexGrow={1}
>
<Typography variant={'h6'}>{t('no_params')}</Typography>
</Box>
)}
{params.map((param, index) => (
<div key={index} style={{ marginBottom: '20px' }}>
{param.type === 'number' && (
Expand Down
Loading

0 comments on commit dff7e07

Please sign in to comment.