Refactor navigation structure to enhance language learning features
- Renamed 'vocabtrainer' to 'sprachenlernen' in the navigation structure for better clarity. - Introduced a nested structure under 'sprachenlernen' for 'vocabtrainer' and 'sprachkurse', improving organization of language-related resources. - Updated internationalization files for both German and English to reflect the new naming and structure, ensuring consistency across the application.
This commit is contained in:
@@ -50,10 +50,19 @@ const menuStructure = {
|
||||
visible: ["all"],
|
||||
path: "/socialnetwork/gallery"
|
||||
},
|
||||
vocabtrainer: {
|
||||
sprachenlernen: {
|
||||
visible: ["all"],
|
||||
path: "/socialnetwork/vocab",
|
||||
children: {}
|
||||
children: {
|
||||
vocabtrainer: {
|
||||
visible: ["all"],
|
||||
path: "/socialnetwork/vocab",
|
||||
children: {}
|
||||
},
|
||||
sprachkurse: {
|
||||
visible: ["all"],
|
||||
path: "/socialnetwork/vocab/courses"
|
||||
}
|
||||
}
|
||||
},
|
||||
blockedUsers: {
|
||||
visible: ["all"],
|
||||
@@ -377,9 +386,9 @@ class NavigationController {
|
||||
const rights = userRights.map(ur => ur.rightType?.title).filter(Boolean);
|
||||
const filteredMenu = await this.filterMenu(menuStructure, rights, age, user.id);
|
||||
|
||||
// Dynamisches Submenü: Treffpunkt → Vokabeltrainer → (Neue Sprache + abonnierte/angelegte)
|
||||
// Dynamisches Submenü: Treffpunkt → Sprachen lernen → Vokabeltrainer → (Neue Sprache + abonnierte/angelegte)
|
||||
// Wichtig: "Neue Sprache" soll IMMER sichtbar sein – auch wenn die DB-Abfrage (noch) fehlschlägt.
|
||||
if (filteredMenu?.socialnetwork?.children?.vocabtrainer) {
|
||||
if (filteredMenu?.socialnetwork?.children?.sprachenlernen?.children?.vocabtrainer) {
|
||||
const children = {
|
||||
newLanguage: { path: '/socialnetwork/vocab/new' },
|
||||
};
|
||||
@@ -391,7 +400,7 @@ class NavigationController {
|
||||
} catch (e) {
|
||||
console.warn('[menu] Konnte Vokabeltrainer-Sprachen nicht laden:', e?.message || e);
|
||||
}
|
||||
filteredMenu.socialnetwork.children.vocabtrainer.children = children;
|
||||
filteredMenu.socialnetwork.children.sprachenlernen.children.vocabtrainer.children = children;
|
||||
}
|
||||
|
||||
res.status(200).json(filteredMenu);
|
||||
|
||||
Reference in New Issue
Block a user