-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into 148-advanced-tests
- Loading branch information
Showing
23 changed files
with
690 additions
and
76 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.../pigeonhole/apps/submissions/migrations/0005_submissions_feedback_simple_test_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.2.13 on 2024-05-22 15:53 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('submissions', '0004_remove_submissions_file_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='submissions', | ||
name='feedback_simple_test', | ||
field=models.JSONField(blank=True, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='submissions', | ||
name='output_simple_test', | ||
field=models.BooleanField(blank=True, default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React from 'react'; | ||
import ProjectCalendar from '../components/ProjectCalendar'; | ||
import initTranslations from "@app/i18n"; | ||
import NavBar from '@app/[locale]/components/NavBar'; | ||
import TranslationsProvider from "@app/[locale]/components/TranslationsProvider"; | ||
import {Box, Typography} from "@mui/material"; | ||
|
||
|
||
|
||
const CalendarPage: React.FC = async ({params: {locale}}: { params: { locale: any } }) => { | ||
const {t, resources} = await initTranslations(locale, ['common']) | ||
|
||
return ( | ||
<TranslationsProvider | ||
resources={resources} | ||
locale={locale} | ||
namespaces={["common"]} | ||
> | ||
<NavBar/> | ||
<Box | ||
padding={15} | ||
> | ||
<Typography | ||
variant={"h3"} | ||
align={"center"} | ||
> | ||
{t("project_calendar")} | ||
</Typography> | ||
<ProjectCalendar/> | ||
</Box> | ||
</TranslationsProvider> | ||
); | ||
}; | ||
|
||
export default CalendarPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useState, useEffect } from 'react'; | ||
import { getCoursesForUser, getProjectsFromCourse } from '@lib/api'; | ||
|
||
interface Data { | ||
id: number; | ||
name: string; | ||
deadline: string; // ISO date string | ||
} | ||
|
||
export const useProjects = () => { | ||
const [projects, setProjects] = useState<Data[]>([]); | ||
const [loading, setLoading] = useState(true); | ||
const [error, setError] = useState<Error | null>(null); | ||
|
||
useEffect(() => { | ||
const fetchProjects = async () => { | ||
try { | ||
const courses = await getCoursesForUser(); | ||
const temp_projects: Data[] = []; | ||
for (const course of courses) { | ||
const course_projects = await getProjectsFromCourse(course.course_id); | ||
for (const project of course_projects) { | ||
temp_projects.push({ | ||
id: project.project_id, | ||
name: project.name, | ||
deadline: project.deadline, | ||
}); | ||
} | ||
} | ||
console.log(temp_projects); | ||
setProjects(temp_projects); | ||
} catch (err) { | ||
setError(err as Error); | ||
} finally { | ||
setLoading(false); | ||
} | ||
}; | ||
|
||
fetchProjects(); | ||
}, []); | ||
|
||
return { projects, loading, error }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.