+
mdi-alert-circle
Error loading: {{ error.message }}
diff --git a/frontend/src/components/MenuBar.vue b/frontend/src/components/MenuBar.vue
index b098ba38..e1d27905 100644
--- a/frontend/src/components/MenuBar.vue
+++ b/frontend/src/components/MenuBar.vue
@@ -22,7 +22,7 @@
{ name: "English", code: "en" },
{ name: "Nederlands", code: "nl" },
{ name: "Français", code: "fr" },
- { name: "Deutsch", code: "de" }
+ { name: "Deutsch", code: "de" },
]);
// Logic to change the language of the website to the selected language
diff --git a/frontend/src/components/ThemeCard.vue b/frontend/src/components/ThemeCard.vue
index ac9b3904..7064b63c 100644
--- a/frontend/src/components/ThemeCard.vue
+++ b/frontend/src/components/ThemeCard.vue
@@ -1,14 +1,14 @@
@@ -31,7 +31,10 @@ defineProps<{
{{ description }}
-
+
{{ t("read-more") }}
@@ -39,36 +42,36 @@ defineProps<{
diff --git a/frontend/src/controllers/base-controller.ts b/frontend/src/controllers/base-controller.ts
index adc0c8c0..5456c9e8 100644
--- a/frontend/src/controllers/base-controller.ts
+++ b/frontend/src/controllers/base-controller.ts
@@ -1,4 +1,4 @@
-import {apiConfig} from "@/config.ts";
+import { apiConfig } from "@/config.ts";
export class BaseController {
protected baseUrl: string;
@@ -7,7 +7,7 @@ export class BaseController {
this.baseUrl = `${apiConfig.baseUrl}/${basePath}`;
}
- protected async get
(path: string, queryParams?: Record): Promise {
+ protected async get(path: string, queryParams?: Record): Promise {
let url = `${this.baseUrl}${path}`;
if (queryParams) {
const query = new URLSearchParams();
diff --git a/frontend/src/controllers/controllers.ts b/frontend/src/controllers/controllers.ts
index b3bbeb61..639a8f1c 100644
--- a/frontend/src/controllers/controllers.ts
+++ b/frontend/src/controllers/controllers.ts
@@ -1,11 +1,11 @@
-import {ThemeController} from "@/controllers/themes.ts";
+import { ThemeController } from "@/controllers/themes.ts";
-export function controllerGetter(Factory: new () => T): () => T {
+export function controllerGetter(factory: new () => T): () => T {
let instance: T | undefined;
return (): T => {
if (!instance) {
- instance = new Factory();
+ instance = new factory();
}
return instance;
};
diff --git a/frontend/src/controllers/themes.ts b/frontend/src/controllers/themes.ts
index 447c9248..d6c8be98 100644
--- a/frontend/src/controllers/themes.ts
+++ b/frontend/src/controllers/themes.ts
@@ -1,16 +1,16 @@
-import {BaseController} from "@/controllers/base-controller.ts";
+import { BaseController } from "@/controllers/base-controller.ts";
export class ThemeController extends BaseController {
constructor() {
super("theme");
}
- getAll(language: string | null = null) {
+ async getAll(language: string | null = null): Promise {
const query = language ? { language } : undefined;
- return this.get("/", query);
+ return this.get("/", query);
}
- getHruidsByKey(themeKey: string) {
+ async getHruidsByKey(themeKey: string): Promise {
return this.get(`/${encodeURIComponent(themeKey)}`);
}
}
diff --git a/frontend/src/main.ts b/frontend/src/main.ts
index fc531957..5945a2ab 100644
--- a/frontend/src/main.ts
+++ b/frontend/src/main.ts
@@ -10,7 +10,7 @@ import i18n from "./i18n/i18n.ts";
// Components
import App from "./App.vue";
import router from "./router";
-import { VueQueryPlugin, QueryClient } from '@tanstack/vue-query';
+import { VueQueryPlugin, QueryClient } from "@tanstack/vue-query";
const app = createApp(App);
diff --git a/frontend/src/queries/themes.ts b/frontend/src/queries/themes.ts
index 9892c141..f7ecaf45 100644
--- a/frontend/src/queries/themes.ts
+++ b/frontend/src/queries/themes.ts
@@ -1,25 +1,24 @@
-import { useQuery } from '@tanstack/vue-query';
-import { getThemeController } from '@/controllers/controllers';
-import {type MaybeRefOrGetter, toValue} from "vue";
+import { useQuery, UseQueryReturnType } from "@tanstack/vue-query";
+import { getThemeController } from "@/controllers/controllers";
+import { type MaybeRefOrGetter, toValue } from "vue";
const themeController = getThemeController();
-export const useThemeQuery = (language: MaybeRefOrGetter) => {
+export function useThemeQuery(language: MaybeRefOrGetter): UseQueryReturnType {
return useQuery({
- queryKey: ['themes', language],
- queryFn: () => {
+ queryKey: ["themes", language],
+ queryFn: async () => {
const lang = toValue(language);
return themeController.getAll(lang);
},
- enabled: () => !!toValue(language),
+ enabled: () => Boolean(toValue(language)),
});
-};
+}
-export const useThemeHruidsQuery = (themeKey: string | null) => {
+export function useThemeHruidsQuery(themeKey: string | null): UseQueryReturnType {
return useQuery({
- queryKey: ['theme-hruids', themeKey],
- queryFn: () => themeController.getHruidsByKey(themeKey!),
- enabled: !!themeKey,
+ queryKey: ["theme-hruids", themeKey],
+ queryFn: async () => themeController.getHruidsByKey(themeKey!),
+ enabled: Boolean(themeKey),
});
-};
-
+}
diff --git a/frontend/src/utils/constants.ts b/frontend/src/utils/constants.ts
index e046d9c3..b56437d7 100644
--- a/frontend/src/utils/constants.ts
+++ b/frontend/src/utils/constants.ts
@@ -1,37 +1,64 @@
export const THEMES_KEYS = [
- "kiks", "art", "socialrobot", "agriculture", "wegostem",
- "computational_thinking", "math_with_python", "python_programming",
- "stem", "care", "chatbot", "physical_computing", "algorithms", "basics_ai"
+ "kiks",
+ "art",
+ "socialrobot",
+ "agriculture",
+ "wegostem",
+ "computational_thinking",
+ "math_with_python",
+ "python_programming",
+ "stem",
+ "care",
+ "chatbot",
+ "physical_computing",
+ "algorithms",
+ "basics_ai",
];
export const THEMESITEMS: Record = {
- "all": THEMES_KEYS,
- "culture": ["art", "wegostem", "chatbot"],
+ all: THEMES_KEYS,
+ culture: ["art", "wegostem", "chatbot"],
"electricity-and-mechanics": ["socialrobot", "wegostem", "stem", "physical_computing"],
"nature-and-climate": ["kiks", "agriculture"],
- "agriculture": ["agriculture"],
- "society": ["kiks", "socialrobot", "care", "chatbot"],
- "math": ["kiks", "math_with_python", "python_programming", "stem", "care", "basics_ai"],
- "technology": ["socialrobot", "wegostem", "computational_thinking", "stem", "physical_computing", "basics_ai"],
- "algorithms": ["math_with_python", "python_programming", "stem", "algorithms", "basics_ai"],
+ agriculture: ["agriculture"],
+ society: ["kiks", "socialrobot", "care", "chatbot"],
+ math: ["kiks", "math_with_python", "python_programming", "stem", "care", "basics_ai"],
+ technology: ["socialrobot", "wegostem", "computational_thinking", "stem", "physical_computing", "basics_ai"],
+ 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 AGEITEMS = ["all", "primary-school", "lower-secondary", "upper-secondary", "high-school", "older"];
export const AGE_TO_THEMES: Record = {
- "all": THEMES_KEYS,
+ all: THEMES_KEYS,
"primary-school": ["wegostem", "computational_thinking", "physical_computing"],
"lower-secondary": ["socialrobot", "art", "wegostem", "computational_thinking", "physical_computing"],
- "upper-secondary": ["kiks", "art", "socialrobot", "agriculture",
- "computational_thinking", "math_with_python", "python_programming",
- "stem", "care", "chatbot", "algorithms", "basics_ai"],
- "high-school": [
- "kiks", "art", "agriculture", "computational_thinking", "math_with_python", "python_programming",
- "stem", "care", "chatbot", "algorithms", "basics_ai"
+ "upper-secondary": [
+ "kiks",
+ "art",
+ "socialrobot",
+ "agriculture",
+ "computational_thinking",
+ "math_with_python",
+ "python_programming",
+ "stem",
+ "care",
+ "chatbot",
+ "algorithms",
+ "basics_ai",
],
- "older": [
- "kiks", "computational_thinking", "algorithms", "basics_ai"
- ]
+ "high-school": [
+ "kiks",
+ "art",
+ "agriculture",
+ "computational_thinking",
+ "math_with_python",
+ "python_programming",
+ "stem",
+ "care",
+ "chatbot",
+ "algorithms",
+ "basics_ai",
+ ],
+ older: ["kiks", "computational_thinking", "algorithms", "basics_ai"],
};
diff --git a/frontend/src/views/SingleTheme.vue b/frontend/src/views/SingleTheme.vue
index 73336fa3..1a35a59f 100644
--- a/frontend/src/views/SingleTheme.vue
+++ b/frontend/src/views/SingleTheme.vue
@@ -1,11 +1,7 @@
-
+
-
+
-
+
diff --git a/frontend/src/views/homepage/UserHomePage.vue b/frontend/src/views/homepage/UserHomePage.vue
index b6cdea17..c4f933a5 100644
--- a/frontend/src/views/homepage/UserHomePage.vue
+++ b/frontend/src/views/homepage/UserHomePage.vue
@@ -1,13 +1,13 @@
{{ t("themes") }}
-
-
-
+