From ca59f8b767d2ef74c4856a2820d3e739e42e09a3 Mon Sep 17 00:00:00 2001 From: Joyelle Ndagijimana Date: Tue, 25 Mar 2025 22:57:20 +0100 Subject: [PATCH] feat: thema's dropdown --- frontend/src/components/MenuBar.vue | 2 +- frontend/src/i18n/locale/de.json | 7 ++- frontend/src/i18n/locale/en.json | 6 ++- frontend/src/i18n/locale/fr.json | 6 ++- frontend/src/i18n/locale/nl.json | 7 ++- frontend/src/router/index.ts | 48 +++++++++++-------- frontend/src/utils/constants.ts | 4 -- .../views/assignments/CreateAssignment.vue | 34 ++++++++++--- 8 files changed, 77 insertions(+), 37 deletions(-) diff --git a/frontend/src/components/MenuBar.vue b/frontend/src/components/MenuBar.vue index ed80d7c2..4ba87211 100644 --- a/frontend/src/components/MenuBar.vue +++ b/frontend/src/components/MenuBar.vue @@ -11,7 +11,7 @@ const role = auth.authState.activeRole; - const name: string = auth.authState.user!.profile.name!; + const name: string = "";//auth.authState.user!.profile.name!; const initials: string = name .split(" ") .map((n) => n[0]) diff --git a/frontend/src/i18n/locale/de.json b/frontend/src/i18n/locale/de.json index 956e8b96..cfeb94a9 100644 --- a/frontend/src/i18n/locale/de.json +++ b/frontend/src/i18n/locale/de.json @@ -39,5 +39,10 @@ "high-school": "16-18 jahre alt", "older": "18 und älter" }, - "read-more": "Mehr lesen" + "read-more": "Mehr lesen", + "new-assignment": "Neue Aufgabe", + "next": "nächste", + "previous": "vorherige", + "groups": "Gruppen", + "learning-path": "Lernpfad" } diff --git a/frontend/src/i18n/locale/en.json b/frontend/src/i18n/locale/en.json index 0d5251f5..5857ff8e 100644 --- a/frontend/src/i18n/locale/en.json +++ b/frontend/src/i18n/locale/en.json @@ -40,5 +40,9 @@ "older": "18 and older" }, "read-more": "Read more", - "new-assignment": "New Assignment" + "new-assignment": "New Assignment", + "next": "next", + "previous": "previous", + "groups": "Groups", + "learning-path": "Learning path" } diff --git a/frontend/src/i18n/locale/fr.json b/frontend/src/i18n/locale/fr.json index 999fe6ff..a4c497cb 100644 --- a/frontend/src/i18n/locale/fr.json +++ b/frontend/src/i18n/locale/fr.json @@ -40,5 +40,9 @@ "older": "18 et plus" }, "read-more": "En savoir plus", - "new-assignment": "Nouveau travail" + "new-assignment": "Nouveau travail", + "next": "suivant", + "previous": "précédent", + "groups": "Groupes", + "learning-path": "Parcours d'apprentissage" } diff --git a/frontend/src/i18n/locale/nl.json b/frontend/src/i18n/locale/nl.json index 9f944a5a..c2367805 100644 --- a/frontend/src/i18n/locale/nl.json +++ b/frontend/src/i18n/locale/nl.json @@ -39,5 +39,10 @@ "high-school": "3e graad secundair", "older": "Hoger onderwijs" }, - "read-more": "Lees meer" + "read-more": "Lees meer", + "new-assignment": "Nieuwe opdracht", + "next": "volgende", + "previous": "vorige", + "groups": "Groepen", + "learning-path": "Leerpad" } diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 0d1b5a0d..b8f023b1 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -1,4 +1,4 @@ -import { createRouter, createWebHistory } from "vue-router"; +import {createRouter, createWebHistory} from "vue-router"; import MenuBar from "@/components/MenuBar.vue"; import SingleAssignment from "@/views/assignments/SingleAssignment.vue"; import SingleClass from "@/views/classes/SingleClass.vue"; @@ -22,24 +22,24 @@ const router = createRouter({ path: "/", name: "home", component: () => import("../views/HomePage.vue"), - meta: { requiresAuth: false }, + meta: {requiresAuth: false}, }, { path: "/login", name: "LoginPage", component: () => import("../views/LoginPage.vue"), - meta: { requiresAuth: false }, + meta: {requiresAuth: false}, }, { path: "/callback", component: CallbackPage, - meta: { requiresAuth: false }, + meta: {requiresAuth: false}, }, { path: "/user", component: MenuBar, - meta: { requiresAuth: true }, + meta: {requiresAuth: true}, children: [ { path: "", @@ -68,49 +68,55 @@ const router = createRouter({ path: "/theme/:id", name: "Theme", component: SingleTheme, - meta: { requiresAuth: true }, + meta: {requiresAuth: true}, }, { - path: "/assignment/create", - name: "CreateAssigment", - component: CreateAssignment, - meta: { requiresAuth: true }, - }, - { - path: "/assignment/:id", - name: "SingleAssigment", - component: SingleAssignment, - meta: { requiresAuth: true }, + path: "/assignment", + component: MenuBar, + meta: {requiresAuth: true}, + children: [ + { + path: "create", + name: "CreateAssigment", + component: CreateAssignment, + }, + { + path: ":id", + name: "SingleAssigment", + component: SingleAssignment, + }, + ] }, + { path: "/class/create", name: "CreateClass", component: CreateClass, - meta: { requiresAuth: true }, + meta: {requiresAuth: true}, }, { path: "/class/:id", name: "SingleClass", component: SingleClass, - meta: { requiresAuth: true }, + meta: {requiresAuth: true}, }, { path: "/discussion/create", name: "CreateDiscussion", component: CreateDiscussion, - meta: { requiresAuth: true }, + meta: {requiresAuth: true}, }, { path: "/discussion/:id", name: "SingleDiscussion", component: SingleDiscussion, - meta: { requiresAuth: true }, + meta: {requiresAuth: true}, }, { path: "/:catchAll(.*)", name: "NotFound", component: NotFound, - meta: { requiresAuth: false }, + meta: {requiresAuth: false}, }, ], }); diff --git a/frontend/src/utils/constants.ts b/frontend/src/utils/constants.ts index e046d9c3..5f256b6e 100644 --- a/frontend/src/utils/constants.ts +++ b/frontend/src/utils/constants.ts @@ -16,10 +16,6 @@ export const THEMESITEMS: Record = { "algorithms": ["math_with_python", "python_programming", "stem", "algorithms", "basics_ai"], }; -export const AGEITEMS = [ - "all", "primary-school", "lower-secondary", "upper-secondary", "high-school", "older" -]; - export const AGE_TO_THEMES: Record = { "all": THEMES_KEYS, "primary-school": ["wegostem", "computational_thinking", "physical_computing"], diff --git a/frontend/src/views/assignments/CreateAssignment.vue b/frontend/src/views/assignments/CreateAssignment.vue index 39593087..1365d464 100644 --- a/frontend/src/views/assignments/CreateAssignment.vue +++ b/frontend/src/views/assignments/CreateAssignment.vue @@ -1,25 +1,43 @@