From 728305ef6baba7eee95d1b109905545e182fcea4 Mon Sep 17 00:00:00 2001 From: Bram Meir Date: Mon, 1 Apr 2024 21:05:08 +0200 Subject: [PATCH 1/8] chore: init project creation from dashboard --- frontend/src/assets/lang/en.json | 3 +- frontend/src/assets/lang/nl.json | 3 + frontend/src/router/router.ts | 144 ++++++------------ .../src/views/projects/CreateProjectView.vue | 90 +++++++++++ 4 files changed, 140 insertions(+), 100 deletions(-) create mode 100644 frontend/src/views/projects/CreateProjectView.vue diff --git a/frontend/src/assets/lang/en.json b/frontend/src/assets/lang/en.json index 4eead9da..0a42aeaa 100644 --- a/frontend/src/assets/lang/en.json +++ b/frontend/src/assets/lang/en.json @@ -22,7 +22,8 @@ "courses": "My courses", "projects": "Current projects", "no_projects": "No projects available for this academic year.", - "no_courses": "No courses available for this academic year." + "no_courses": "No courses available for this academic year.", + "select_course": "Select the course for which you want to create a project:" }, "login": { "title": "Login", diff --git a/frontend/src/assets/lang/nl.json b/frontend/src/assets/lang/nl.json index 31ec1044..0a64e710 100644 --- a/frontend/src/assets/lang/nl.json +++ b/frontend/src/assets/lang/nl.json @@ -23,6 +23,9 @@ "projects": "Lopende projecten", "no_projects": "Geen projecten gevonden.", "no_courses": "Geen vakken gevonden." + "no_projects": "Geen projecten beschikbaar voor dit academiejaar.", + "no_courses": "Geen vakken beschikbaar voor dit academiejaar.", + "select_course": "Selecteer het vak waarvoor je een project wil maken:" }, "login": { "title": "Inloggen", diff --git a/frontend/src/router/router.ts b/frontend/src/router/router.ts index d0d87a26..9924d02f 100644 --- a/frontend/src/router/router.ts +++ b/frontend/src/router/router.ts @@ -1,9 +1,7 @@ -// import { useUserStore } from '@/stores/userStore'; -// TODO: after pinia setup is done - import DashboardView from '@/views/dashboard/DashboardView.vue'; import CourseView from '@/views/courses/CourseView.vue'; import CreateCourseView from '@/views/courses/CreateCourseView.vue'; +import CreateProjectView from '@/views/projects/CreateProjectView.vue'; import Dummy from '@/components/Dummy.vue'; import LoginView from '@/views/authentication/LoginView.vue'; import CalendarView from '@/views/calendar/CalendarView.vue'; @@ -32,102 +30,51 @@ const routes: RouteRecordRaw[] = [ { path: '/', component: DashboardView, name: 'dashboard' }, // Courses - { - path: '/courses', - children: [ - { path: '', component: SearchCourseView, name: 'courses' }, - { - path: 'create', - component: CreateCourseView, - name: 'course-create', - }, - // Single course - { - path: ':courseId', - children: [ - { path: '', component: CourseView, name: 'course' }, - { path: 'edit', component: Dummy, name: 'course-edit' }, - // Projects - { - path: 'projects', - children: [ - { path: '', component: Dummy, name: 'projects' }, - { - path: 'create', - component: Dummy, - name: 'project-create', - }, - // Single project - { - path: ':projectId', - children: [ - { - 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', - }, - ], - }, - ], - }, - ], - }, - ], - }, + { path: '/courses', children: [ + { path: '', component: SearchCourseView, name: 'courses' }, + { path: 'create', component: CreateCourseView, name: 'course-create' }, + // Single course + { path: ':courseId', children: [ + { path: '', component: CourseView, name: 'course' }, + { path: 'edit', component: Dummy, name: 'course-edit' }, + // Projects + { path: 'projects', children: [ + { path: '', component: Dummy, name: 'projects' }, + { path: 'create', component: CreateProjectView, name: 'project-create' }, + // Single project + { path: ':projectId', children: [ + { 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' }, + ]} + ]}, + ]}, + ]}, // Calendar { path: '/calendar', component: CalendarView, name: 'calendar' }, // Users - { - path: '/users', - children: [ - { path: ':id', component: Dummy, name: 'user' }, - { - path: 'students', - children: [ - { path: '', component: Dummy, name: 'students' }, - { path: ':id', component: Dummy, name: 'student' }, - ], - }, - { - path: 'admins', - children: [ - { path: '', component: Dummy, name: 'admins' }, - { path: ':id', component: Dummy, name: 'admin' }, - ], - }, - { - path: 'teachers', - children: [ - { path: '', component: Dummy, name: 'teachers' }, - { path: ':id', component: Dummy, name: 'teacher' }, - ], - }, - { - path: 'assistants', - children: [ - { path: '', component: Dummy, name: 'assistants' }, - { path: ':id', component: Dummy, name: 'assistant' }, - ], - }, - ], - }, + { path: '/users', children: [ + { path: ':id', component: Dummy, name: 'user' }, + { path: 'students', children: [ + { path: '', component: Dummy, name: 'students' }, + { path: ':id', component: Dummy, name: 'student' }, + ]}, + { path: 'admins', children: [ + { path: '', component: Dummy, name: 'admins' }, + { path: ':id', component: Dummy, name: 'admin' }, + ]}, + { path: 'teachers', children: [ + { path: '', component: Dummy, name: 'teachers' }, + { path: ':id', component: Dummy, name: 'teacher' }, + ]}, + { path: 'assistants', children: [ + { path: '', component: Dummy, name: 'assistants' }, + { path: ':id', component: Dummy, name: 'assistant' }, + ]}, + ]}, // Faculties { path: '/faculties', component: Dummy, name: 'faculties' }, @@ -138,13 +85,12 @@ const routes: RouteRecordRaw[] = [ { path: '/notifications/:id', component: Dummy, name: 'notification' }, // Authentication - { - path: '/auth/', - children: [{ path: 'login', component: LoginView, name: 'login' }], - }, + { path: '/auth/', children: [ + { path: 'login', component: LoginView, name: 'login' }, + ]}, // Page not found: redirect to dashboard - { path: '/:pathMatch(.*)*', redirect: { name: 'dashboard' } }, + { path: '/:pathMatch(.*)*', redirect: { name: 'dashboard' } } ]; const router = createRouter({ diff --git a/frontend/src/views/projects/CreateProjectView.vue b/frontend/src/views/projects/CreateProjectView.vue new file mode 100644 index 00000000..a73886ba --- /dev/null +++ b/frontend/src/views/projects/CreateProjectView.vue @@ -0,0 +1,90 @@ + + +