template usage to modules

This commit is contained in:
Julian Krauser 2024-12-23 14:00:32 +01:00
parent 600bb47260
commit 2853835d31
9 changed files with 221 additions and 7 deletions

View file

@ -77,8 +77,10 @@ export const useNavigationStore = defineStore("navigation", {
]
: []),
];
if (this.topLevel.findIndex((e) => e.key == this.activeNavigation) == -1 && !first)
if (this.topLevel.findIndex((e) => e.key == this.activeNavigation) == -1) {
this.activeNavigation = this.topLevel[0]?.key ?? "club";
router.push({ name: `admin-${this.topLevel[0]?.key ?? "club"}-default` });
}
},
updateNavigation(first: boolean = false) {
const abilityStore = useAbilityStore();
@ -113,7 +115,10 @@ export const useNavigationStore = defineStore("navigation", {
? [{ key: "calendar_type", title: "Terminarten" }]
: []),
...(abilityStore.can("read", "settings", "query") ? [{ key: "query_store", title: "Query Store" }] : []),
...(true ? [{ key: "template", title: "Templates" }] : []),
...(abilityStore.can("read", "settings", "template") ? [{ key: "template", title: "Templates" }] : []),
...(abilityStore.can("read", "settings", "template_usage")
? [{ key: "template_usage", title: "Template-Verwendung" }]
: []),
],
},
user: {
@ -124,8 +129,9 @@ export const useNavigationStore = defineStore("navigation", {
],
},
} as navigationModel;
if (this.activeNavigationObject.main.findIndex((e) => e.key == this.activeLink) == -1 && !first)
if (this.activeNavigationObject.main.findIndex((e) => e.key == this.activeLink) == -1) {
router.push({ name: `admin-${this.activeNavigation}-default` });
}
},
},
});