Skip to content

Commit

Permalink
Merge branch '148-advanced-tests' of github.com:SELab-2/UGent-1 into …
Browse files Browse the repository at this point in the history
…148-advanced-tests
  • Loading branch information
robinpdev committed May 22, 2024
2 parents af8dd23 + 246a2fc commit c2830e0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
13 changes: 8 additions & 5 deletions frontend/app/[locale]/components/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ interface ListViewProps {
search: boolean;
}

const convertDate = (date_str: string) => {
const convertDate = (t, date_str) => {
if (date_str === null) {
return t('no_deadline');
}
let date = new Date(date_str);
date = new Date(date.getTime());
let date_local = date.toLocaleString('en-US', {
Expand Down Expand Up @@ -172,7 +175,7 @@ const ListView: NextPage<ListViewProps> = ({
'course_students': (data) => [data.id, data.email],
'course_teachers': (data) => [data.id, data.email],
'courses': (data) => [data.course_id, data.name, data.description, data.open_course],
'projects': (data) => [data.project_id, data.name, convertDate(data.deadline)],
'projects': (data) => [data.project_id, data.name, convertDate(t, data.deadline)],
'groups': async (data) => {
let l = [];
// Iterate over the values of the object
Expand All @@ -186,8 +189,8 @@ const ListView: NextPage<ListViewProps> = ({
setGroupSize((await getProject(data.project_id)).group_size);
return [data.group_id, data.user, data.group_nr, l.join(', ')];
},
'submissions': (data) => [data.submission_id, data.group_id, convertDate(data.timestamp), data.output_test !== undefined],
'submissions_group': (data) => [data.submission_id, data.group_id, convertDate(data.timestamp), data.output_test !== undefined],
'submissions': (data) => [data.submission_id, data.group_id, convertDate(t,data.timestamp), data.output_test !== undefined],
'submissions_group': (data) => [data.submission_id, data.group_id, convertDate(t,data.timestamp), data.output_test !== undefined],
'archived_courses': (data) => [data.course_id, data.name, data.description, data.open_course],
};

Expand Down Expand Up @@ -499,7 +502,7 @@ const ListView: NextPage<ListViewProps> = ({
{rows.map((row, index) => (
<StyledTableRow key={index}>
{((get !== 'groups' && get !== 'projects' && get !== 'courses' && !(get === 'submissions' && !action_name) && get != 'users') &&
get !== 'course_teachers' && !(action_name && user?.role === 3 && get !== 'archived_courses') &&
get !== 'course_teachers' && !(action_name && user?.role === 3) && get !== 'archived_courses' &&
<StyledTableCell>
{<CheckBoxWithCustomCheck checked={false}/>}
</StyledTableCell>)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/[locale]/course/archived/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ArchivePage = async ({params: {locale}}) => {
const {t, resources} = await initTranslations(locale, i18nNamespaces);
const headers = [t('name'),
<React.Fragment key="description"><NotesIcon style={{ fontSize: '20px', verticalAlign: 'middle', marginBottom: '3px' }}/>{" " + t('description')}</React.Fragment>,
, t('open'), ''];
, t('open')];
const headers_backend = ['name', 'description', 'open'];

return (
Expand Down
3 changes: 2 additions & 1 deletion frontend/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,6 @@
"join_leave": "Join/Leave",
"not_in_group": "Join a group to submit",
"edit_user_details": "Edit user details",
"status_button_tooltip": "Required, optional or forbidden file"
"status_button_tooltip": "Required, optional or forbidden file",
"no_deadline": "No deadline"
}
3 changes: 2 additions & 1 deletion frontend/locales/nl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,6 @@
"join_leave": "Toetreden/Verlaten",
"not_in_group": "Je kan niet indienen zonder in een groep te zitten",
"edit_user_details": "Gebruiker bewerken",
"status_button_tooltip": "Verplicht, optioneel of verboden bestand"
"status_button_tooltip": "Verplicht, optioneel of verboden bestand",
"no_deadline": "Geen deadline"
}

0 comments on commit c2830e0

Please sign in to comment.