From 3fb6873b999afbcd342a97da6ff0e1dfbeb19c48 Mon Sep 17 00:00:00 2001 From: lander Date: Sat, 23 Mar 2024 15:15:31 +0100 Subject: [PATCH 1/9] chore: projectview init --- .../src/components/projects/ProjectCard.vue | 45 ++++++++++++++++++ .../composables/services/project.service.ts | 46 ++++--------------- frontend/src/router/routes.ts | 4 ++ .../src/views/dashboard/DashboardView.vue | 16 ++++++- frontend/src/views/projects/ProjectView.vue | 17 +++++++ 5 files changed, 91 insertions(+), 37 deletions(-) create mode 100644 frontend/src/components/projects/ProjectCard.vue create mode 100644 frontend/src/views/projects/ProjectView.vue diff --git a/frontend/src/components/projects/ProjectCard.vue b/frontend/src/components/projects/ProjectCard.vue new file mode 100644 index 00000000..7e7dab1e --- /dev/null +++ b/frontend/src/components/projects/ProjectCard.vue @@ -0,0 +1,45 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/composables/services/project.service.ts b/frontend/src/composables/services/project.service.ts index 3ce4d2da..bd9e0606 100644 --- a/frontend/src/composables/services/project.service.ts +++ b/frontend/src/composables/services/project.service.ts @@ -1,53 +1,27 @@ import {Project} from '@/types/Projects.ts'; import {ref} from 'vue'; -import {endpoints} from '@/config/endpoints.ts'; import axios from 'axios'; -import { get, getList } from '@/composables/services/helpers.ts'; - +import {endpoints} from '@/config/endpoints.ts'; -export function useProject() { - const projects = ref(null); - const project = ref(null); +export function useCourses() { + const courses = ref(null); + const course = ref(null); - async function getProjectByID(id: number) { + async function getCourseByID(id: number) { const endpoint = endpoints.projects.retrieve.replace('{id}', id.toString()); - get(endpoint, project, Project.fromJSON); - console.log(project) - } - - async function getProjectsByCourse(course_id: number) { - const endpoint = endpoints.projects.byCourse.replace('{course_id}', course_id.toString()); - getList(endpoint, projects, Project.fromJSON); - console.log(projects.value ? projects.value.map((project, index) => `Project ${index + 1}: ${JSON.stringify(project)}`) : 'Projects is null'); - } - - async function getProjectsByCourseAndDeadline(course_id: number, deadlineDate: Date ) { - - const endpoint = endpoints.projects.byCourse.replace('{course_id}', course_id.toString()); axios.get(endpoint).then(response => { - const allProjects = response.data.map((projectData: Project) => Project.fromJSON(projectData)); - - // Filter projects based on the deadline date - const projectsWithMatchingDeadline = allProjects.filter((project: Project) => { - const projectDeadlineDate = project.deadline; - return projectDeadlineDate.toDateString() === deadlineDate.toDateString(); - }); - - // Update the projects ref with the filtered projects - projects.value = projectsWithMatchingDeadline; + course.value = Project.fromJSON(response.data); }).catch(error => { console.log(error.data); }); - console.log(projects.value ? projects.value.map((project, index) => `Project ${index + 1}: ${JSON.stringify(project)}`) : 'Projects is null'); + console.log(Project) } return { - projects, - project, - getProjectByID, - getProjectsByCourse, - getProjectsByCourseAndDeadline + courses, + course, + getCourseByID }; } \ No newline at end of file diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index 2d406745..2baddaa4 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -1,5 +1,6 @@ import DashboardView from '@/views/dashboard/DashboardView.vue'; import CourseView from '@/views/courses/CourseView.vue'; +import ProjectView from '@/views/projects/ProjectView.vue'; import LoginView from '@/views/authentication/LoginView.vue'; import {RouteRecordRaw} from 'vue-router'; @@ -11,5 +12,8 @@ export const routes: RouteRecordRaw[] = [ { path: '/courses/', children: [ { path: ':id', component: CourseView, name: 'course-view' } ]}, + { path: '/projects/', children: [ + { path: ':id', component: ProjectView, name: 'project-view' } + ]}, { path: '/:pathMatch(.*)*', redirect: { name: 'dashboard' } } ]; \ No newline at end of file diff --git a/frontend/src/views/dashboard/DashboardView.vue b/frontend/src/views/dashboard/DashboardView.vue index 7cd0fe90..263f74a9 100644 --- a/frontend/src/views/dashboard/DashboardView.vue +++ b/frontend/src/views/dashboard/DashboardView.vue @@ -8,6 +8,8 @@ import {useI18n} from 'vue-i18n'; import {PrimeIcons} from 'primevue/api'; import {onMounted } from 'vue'; import { useCourses } from '@/composables/services/courses.service.ts'; +import {Project} from "@/composables/services/project.service.ts"; +import {ref} from 'vue'; /* Composable injections */ const { t } = useI18n(); @@ -21,6 +23,16 @@ onMounted(async () => { await getCoursesByStudent(1); // TODO make this the id of the logged in user }); +/** + * TODO straks, dit hieronder zoals hierboven doen + */ +const projects = ref([ + new Project(1, 'No Life Simulator', '-100 hours of your life', 'Computationele Biologie', + '31-12-2024'), + new Project(1, 'No Friends Simulator', '-10 good friends', 'Movile and Broadband Access Networks', + '31-12-2024'), +]); + diff --git a/frontend/src/views/projects/ProjectView.vue b/frontend/src/views/projects/ProjectView.vue new file mode 100644 index 00000000..edf0b271 --- /dev/null +++ b/frontend/src/views/projects/ProjectView.vue @@ -0,0 +1,17 @@ + + + + + \ No newline at end of file From b67c7ed65d2d0a6099f4f1a9b2ef6216ada7897c Mon Sep 17 00:00:00 2001 From: Lander Maes Date: Sat, 23 Mar 2024 16:27:43 +0100 Subject: [PATCH 2/9] chore: fetching projects in dashboard --- .../src/components/projects/ProjectCard.vue | 2 +- .../src/views/dashboard/DashboardView.vue | 22 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/projects/ProjectCard.vue b/frontend/src/components/projects/ProjectCard.vue index 7e7dab1e..b64658c4 100644 --- a/frontend/src/components/projects/ProjectCard.vue +++ b/frontend/src/components/projects/ProjectCard.vue @@ -1,7 +1,7 @@ From 9a165dc5a34dc8064b9c48c41783a7c39aab9bb6 Mon Sep 17 00:00:00 2001 From: Lander Maes Date: Sun, 24 Mar 2024 15:28:06 +0100 Subject: [PATCH 3/9] chore: fetching projects in dashboard 2 --- frontend/package-lock.json | 9 +++++++++ frontend/package.json | 1 + frontend/src/views/dashboard/DashboardView.vue | 12 ++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7afc4f25..3be14847 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "axios": "^1.6.8", + "moment": "^2.30.1", "pinia": "^2.1.7", "primeflex": "^3.3.1", "primeicons": "^6.0.1", @@ -2707,6 +2708,14 @@ "ufo": "^1.3.2" } }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "engines": { + "node": "*" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index 38850775..c963c290 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ }, "dependencies": { "axios": "^1.6.8", + "moment": "^2.30.1", "pinia": "^2.1.7", "primeflex": "^3.3.1", "primeicons": "^6.0.1", diff --git a/frontend/src/views/dashboard/DashboardView.vue b/frontend/src/views/dashboard/DashboardView.vue index eb29c875..037b704b 100644 --- a/frontend/src/views/dashboard/DashboardView.vue +++ b/frontend/src/views/dashboard/DashboardView.vue @@ -2,26 +2,26 @@ import ButtonGroup from 'primevue/buttongroup'; import Button from 'primevue/button'; import CourseCard from '@/components/courses/CourseCard.vue'; -//import ProjectCard from '@/components/projects/ProjectCard.vue'; +import ProjectCard from '@/components/projects/ProjectCard.vue'; import BaseLayout from '@/components/layout/BaseLayout.vue'; import Title from '@/components/Title.vue'; import {useI18n} from 'vue-i18n'; import {PrimeIcons} from 'primevue/api'; import {onMounted } from 'vue'; import { useCourses } from '@/composables/services/courses.service.ts'; -//import { useProject } from '@/composables/services/project.service.ts'; +import { useProject } from '@/composables/services/project.service.ts'; /* Composable injections */ const { t } = useI18n(); /* Service injection */ const { courses, getCoursesByStudent } = useCourses(); -//const { projects, getProjectsByStudent } = useProject(); +const { projects, getProjectsByStudent } = useProject(); onMounted(async () => { console.log("fetching courses"); await getCoursesByStudent(1); // TODO make this the id of the logged in user - //await getProjectsByStudent(1); + await getProjectsByStudent('1'); }); @@ -56,10 +56,10 @@ onMounted(async () => {
- +
From 8c782e252680f59e50c1104d79c81d15f8de3ef7 Mon Sep 17 00:00:00 2001 From: Lander Maes Date: Sun, 24 Mar 2024 17:49:00 +0100 Subject: [PATCH 4/9] chore: fetching projects with course context --- .../src/components/projects/ProjectCard.vue | 9 ++--- .../composables/services/project.service.ts | 17 ++++++++- frontend/src/router/routes.ts | 36 +++++++++---------- frontend/src/types/Projects.ts | 17 +++++++++ .../src/views/dashboard/DashboardView.vue | 6 ++-- 5 files changed, 59 insertions(+), 26 deletions(-) diff --git a/frontend/src/components/projects/ProjectCard.vue b/frontend/src/components/projects/ProjectCard.vue index b64658c4..79b55caa 100644 --- a/frontend/src/components/projects/ProjectCard.vue +++ b/frontend/src/components/projects/ProjectCard.vue @@ -6,17 +6,20 @@ import {PrimeIcons} from 'primevue/api'; import {useI18n} from 'vue-i18n'; /* Component props */ -defineProps<{ +const props = defineProps<{ project: Project }>(); /* Composable injections */ const { t } = useI18n(); +console.log(props.project) + /* Default image thumbnails */ const images = Object.keys(import.meta.glob('@/assets/img/placeholders/*', { eager: true })); + diff --git a/frontend/src/composables/services/project.service.ts b/frontend/src/composables/services/project.service.ts index 97737eae..947ac3f8 100644 --- a/frontend/src/composables/services/project.service.ts +++ b/frontend/src/composables/services/project.service.ts @@ -37,6 +37,20 @@ export function useProject() { console.log(projects.value ? projects.value.map((project, index) => `Project ${index + 1}: ${JSON.stringify(project)}`) : 'Projects is null'); } + async function getProjectWithCourseContext(student_id: string) { + const endpoint = endpoints.courses.byStudent.replace('{student_id}', student_id); + const courses = ref(null); + await getList(endpoint, courses, Course.fromJSON, toast); + + for (const course of courses.value ? courses.value : []) { + const courseEndpoint = endpoints.projects.byCourse.replace('{course_id}', course.id.toString()); + axios.get(courseEndpoint).then(response => { + const allProjectsFromCourse = response.data.map((projectData: any) => Project.fromJSONWithCourse(projectData, course)); + projects.value = [...(projects.value || []), ...allProjectsFromCourse]; + }); + } + } + async function getProjectsByCourseAndDeadline(course_id: number, deadlineDate: Date ) { const endpoint = endpoints.projects.byCourse.replace('{course_id}', course_id.toString()); @@ -65,6 +79,7 @@ export function useProject() { getProjectByID, getProjectsByCourse, getProjectsByCourseAndDeadline, - getProjectsByStudent + getProjectsByStudent, + getProjectWithCourseContext }; } \ No newline at end of file diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index 2baddaa4..92f33dc4 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -1,19 +1,19 @@ -import DashboardView from '@/views/dashboard/DashboardView.vue'; -import CourseView from '@/views/courses/CourseView.vue'; -import ProjectView from '@/views/projects/ProjectView.vue'; -import LoginView from '@/views/authentication/LoginView.vue'; -import {RouteRecordRaw} from 'vue-router'; - -export const routes: RouteRecordRaw[] = [ - { path: '/auth/', children: [ - { path: 'login', component: LoginView, name: 'login' }, - ]}, - { path: '/', component: DashboardView, name: 'dashboard' }, - { path: '/courses/', children: [ - { path: ':id', component: CourseView, name: 'course-view' } - ]}, - { path: '/projects/', children: [ - { path: ':id', component: ProjectView, name: 'project-view' } - ]}, - { path: '/:pathMatch(.*)*', redirect: { name: 'dashboard' } } +import DashboardView from '@/views/dashboard/DashboardView.vue'; +import CourseView from '@/views/courses/CourseView.vue'; +import ProjectView from '@/views/projects/ProjectView.vue'; +import LoginView from '@/views/authentication/LoginView.vue'; +import {RouteRecordRaw} from 'vue-router'; + +export const routes: RouteRecordRaw[] = [ + { path: '/auth/', children: [ + { path: 'login', component: LoginView, name: 'login' }, + ]}, + { path: '/', component: DashboardView, name: 'dashboard' }, + { path: '/courses/', children: [ + { path: ':id', component: CourseView, name: 'course-view' } + ]}, + { path: '/projects/', children: [ + { path: ':id', component: ProjectView, name: 'project-view' } + ]}, + { path: '/:pathMatch(.*)*', redirect: { name: 'dashboard' } } ]; \ No newline at end of file diff --git a/frontend/src/types/Projects.ts b/frontend/src/types/Projects.ts index 7e72cbd9..a295808d 100644 --- a/frontend/src/types/Projects.ts +++ b/frontend/src/types/Projects.ts @@ -51,4 +51,21 @@ export class Project { project.group_size ); } + + static fromJSONWithCourse(project: Project, course: Course): Project { + return new Project( + project.id, + project.name, + project.description, + project.visible, + project.archived, + project.locked_groups, + new Date(project.start_date), + new Date(project.deadline), + project.max_score, + project.score_visible, + project.group_size, + project.course = course + ); + } } \ No newline at end of file diff --git a/frontend/src/views/dashboard/DashboardView.vue b/frontend/src/views/dashboard/DashboardView.vue index 037b704b..8112b1f0 100644 --- a/frontend/src/views/dashboard/DashboardView.vue +++ b/frontend/src/views/dashboard/DashboardView.vue @@ -7,7 +7,7 @@ import BaseLayout from '@/components/layout/BaseLayout.vue'; import Title from '@/components/Title.vue'; import {useI18n} from 'vue-i18n'; import {PrimeIcons} from 'primevue/api'; -import {onMounted } from 'vue'; +import {onMounted} from 'vue'; import { useCourses } from '@/composables/services/courses.service.ts'; import { useProject } from '@/composables/services/project.service.ts'; @@ -16,12 +16,12 @@ const { t } = useI18n(); /* Service injection */ const { courses, getCoursesByStudent } = useCourses(); -const { projects, getProjectsByStudent } = useProject(); +const { projects, getProjectWithCourseContext } = useProject(); onMounted(async () => { console.log("fetching courses"); await getCoursesByStudent(1); // TODO make this the id of the logged in user - await getProjectsByStudent('1'); + await getProjectWithCourseContext('1'); }); From 5f51f293602bc30e32dc18a9a12dc1ecfc6e3fb7 Mon Sep 17 00:00:00 2001 From: lander Date: Sun, 24 Mar 2024 23:58:05 +0100 Subject: [PATCH 5/9] chore: add ProjectCard.vue --- frontend/src/assets/lang/en.json | 4 ++ frontend/src/assets/lang/nl.json | 4 ++ .../src/components/projects/ProjectCard.vue | 67 ++++++++++++++----- frontend/src/router/router.ts | 3 +- frontend/src/types/Projects.ts | 2 +- frontend/src/views/projects/ProjectView.vue | 2 +- 6 files changed, 62 insertions(+), 20 deletions(-) diff --git a/frontend/src/assets/lang/en.json b/frontend/src/assets/lang/en.json index a790cc13..4304ec6c 100644 --- a/frontend/src/assets/lang/en.json +++ b/frontend/src/assets/lang/en.json @@ -22,6 +22,10 @@ }, "calendar": { "title": "Calendar" + }, + "projects": { + "deadline": "Deadline", + "submissionStatus": "Indienstatus" } }, "components": { diff --git a/frontend/src/assets/lang/nl.json b/frontend/src/assets/lang/nl.json index 1ff23e63..4d4e522f 100644 --- a/frontend/src/assets/lang/nl.json +++ b/frontend/src/assets/lang/nl.json @@ -31,6 +31,10 @@ }, "calendar": { "title": "Kalender" + }, + "projects": { + "deadline": "Deadline", + "submissionStatus": "Indienstatus" } }, "components": { diff --git a/frontend/src/components/projects/ProjectCard.vue b/frontend/src/components/projects/ProjectCard.vue index 79b55caa..c59c6347 100644 --- a/frontend/src/components/projects/ProjectCard.vue +++ b/frontend/src/components/projects/ProjectCard.vue @@ -4,43 +4,76 @@ import Button from 'primevue/button'; import {Project} from '@/types/Projects.ts'; import {PrimeIcons} from 'primevue/api'; import {useI18n} from 'vue-i18n'; +import {computed} from "vue"; /* Component props */ const props = defineProps<{ project: Project }>(); +const formattedDeadline = computed(() => { + // changes deadline format to dd/mm.yyyy + const date = new Date(props.project.deadline); + return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`; +}); + /* Composable injections */ const { t } = useI18n(); -console.log(props.project) - -/* Default image thumbnails */ -const images = Object.keys(import.meta.glob('@/assets/img/placeholders/*', { - eager: true -})); - +// TODO fix ewout om mooit te maken \ No newline at end of file diff --git a/frontend/src/router/router.ts b/frontend/src/router/router.ts index 02500cb8..b08936c3 100644 --- a/frontend/src/router/router.ts +++ b/frontend/src/router/router.ts @@ -8,6 +8,7 @@ import CourseView from '@/views/courses/CourseView.vue'; import Dummy from '@/components/Dummy.vue'; import LoginView from '@/views/authentication/LoginView.vue'; import CalendarView from '@/views/calendar/CalendarView.vue'; +import ProjectView from "@/views/projects/ProjectView.vue"; const routes: RouteRecordRaw[] = [ { path: '/', component: DashboardView, name: 'dashboard' }, @@ -26,7 +27,7 @@ const routes: RouteRecordRaw[] = [ { path: 'create', component: Dummy, name: 'project-create' }, // Single project { path: ':projectId', children: [ - { path: '', component: Dummy, name: 'project' }, + { path: '', component: ProjectView, name: 'project' }, { path: 'edit', component: Dummy, name: 'project-edit' }, { path: 'groups', component: Dummy, name: 'project-groups' }, { path: 'submit', component: Dummy, name: 'project-submit' }, diff --git a/frontend/src/types/Projects.ts b/frontend/src/types/Projects.ts index a295808d..47774266 100644 --- a/frontend/src/types/Projects.ts +++ b/frontend/src/types/Projects.ts @@ -27,7 +27,7 @@ export class Project { public structure_checks: Structure_check[] = [], public extra_checks: Extra_check[] = [], public groups: Group[] = [], - public submissions: Submission = new Submission(0,0,new Date(), false), //TODO check + public submissions: Submission[] = [new Submission(0,0,new Date(), false)], //TODO check ) { } diff --git a/frontend/src/views/projects/ProjectView.vue b/frontend/src/views/projects/ProjectView.vue index edf0b271..77a3d623 100644 --- a/frontend/src/views/projects/ProjectView.vue +++ b/frontend/src/views/projects/ProjectView.vue @@ -9,7 +9,7 @@ onMounted(() => { \ No newline at end of file diff --git a/frontend/src/composables/services/groups.service.ts b/frontend/src/composables/services/groups.service.ts index b2cb3d93..01822a7c 100644 --- a/frontend/src/composables/services/groups.service.ts +++ b/frontend/src/composables/services/groups.service.ts @@ -12,12 +12,17 @@ export function useGroup() { async function getGroupByID(id: string, t: ComposerTranslation) { const endpoint = endpoints.groups.retrieve.replace('{id}', id); - get(endpoint, group, Group.fromJSON, toast, t); + await get(endpoint, group, Group.fromJSONFullObject, toast, t); } async function getGroupsByProject(project_id: string, t: ComposerTranslation) { const endpoint = endpoints.groups.byProject.replace('{project_id}', project_id); - getList(endpoint, groups, Group.fromJSON, toast, t); + await getList(endpoint, groups, Group.fromJSON, toast, t); + } + + async function getGroupsByStudent(student_id: string, t: ComposerTranslation) { + const endpoint = endpoints.groups.byStudent.replace('{student_id}', student_id); + await getList(endpoint, groups, Group.fromJSON, toast, t); } async function createGroup(group_data: any, group_id: string, t: ComposerTranslation) { @@ -35,6 +40,7 @@ export function useGroup() { group, getGroupByID, getGroupsByProject, + getGroupsByStudent, createGroup, deleteGroup diff --git a/frontend/src/composables/services/project.service.ts b/frontend/src/composables/services/project.service.ts index 74c72f23..256da136 100644 --- a/frontend/src/composables/services/project.service.ts +++ b/frontend/src/composables/services/project.service.ts @@ -15,7 +15,7 @@ export function useProject() { async function getProjectByID(id: string, t: ComposerTranslation) { const endpoint = endpoints.projects.retrieve.replace('{id}', id); - get(endpoint, project, Project.fromJSON, toast, t); + await get(endpoint, project, Project.fromJSON, toast, t); } async function getProjectsByCourse(course_id: string, t: ComposerTranslation) { diff --git a/frontend/src/composables/services/students.service.ts b/frontend/src/composables/services/students.service.ts index dbc85720..c8571fd8 100644 --- a/frontend/src/composables/services/students.service.ts +++ b/frontend/src/composables/services/students.service.ts @@ -22,14 +22,14 @@ export function useStudents() { getList(endpoint, students, Student.fromJSON, toast, t); } - async function getStudentsbyCourse(course_id: string, t: ComposerTranslation) { + async function getStudentsByCourse(course_id: string, t: ComposerTranslation) { const endpoint = endpoints.students.byCourse.replace('{course_id}', course_id); getList(endpoint, students, Student.fromJSON, toast, t); } - async function getStudentsbyGroup(group_id: string, t: ComposerTranslation) { + async function getStudentsByGroup(group_id: string, t: ComposerTranslation) { const endpoint = endpoints.students.byGroup.replace('{group_id}', group_id); - getList(endpoint, students, Student.fromJSON, toast, t); + await getList(endpoint, students, Student.fromJSON, toast, t); } async function studentJoinCourse(course_id: string, student_id: string, t: ComposerTranslation) { @@ -70,8 +70,8 @@ export function useStudents() { getStudentByID, getStudents, - getStudentsbyCourse, - getStudentsbyGroup, + getStudentsByCourse, + getStudentsByGroup, createStudent, deleteStudent, diff --git a/frontend/src/config/endpoints.ts b/frontend/src/config/endpoints.ts index 08706931..f7f26cf1 100644 --- a/frontend/src/config/endpoints.ts +++ b/frontend/src/config/endpoints.ts @@ -41,7 +41,8 @@ export const endpoints = { }, groups: { retrieve: '/api/groups/{id}/', - byProject: '/api/projects/{project_id}/groups/' + byProject: '/api/projects/{project_id}/groups/', + byStudent: '/api/students/{student_id}/groups/' }, projects: { retrieve: '/api/projects/{id}', diff --git a/frontend/src/types/Group.ts b/frontend/src/types/Group.ts index 883446c3..ba50509f 100644 --- a/frontend/src/types/Group.ts +++ b/frontend/src/types/Group.ts @@ -1,6 +1,6 @@ -import { Project } from "./Projects"; -import { Student } from "./Student"; -import { Submission } from "./Submission"; +import {Project} from "./Projects"; +import {Student} from "./Student"; +import {Submission} from "./Submission"; export class Group { constructor( @@ -17,10 +17,20 @@ export class Group { * * @param group */ - static fromJSON(group: Group): Group { - return new Group( - group.id, - group.score - ); - } + static fromJSON(group: Group): Group { + return new Group( + group.id, + group.score + ); + } + + static fromJSONFullObject(group: Group): Group { + return new Group( + group.id, + group.score, + group.projects, + group.students, + group.submissions + ); + } } \ No newline at end of file diff --git a/frontend/src/views/projects/ProjectView.vue b/frontend/src/views/projects/ProjectView.vue index 52e506fc..99b16038 100644 --- a/frontend/src/views/projects/ProjectView.vue +++ b/frontend/src/views/projects/ProjectView.vue @@ -1,30 +1,46 @@ @@ -32,7 +48,7 @@ onMounted(async () => {