From e5196b798d244401584e7d05a05cc6de72a49c2b Mon Sep 17 00:00:00 2001 From: fnecas Date: Fri, 2 Aug 2024 14:01:52 +0200 Subject: [PATCH 01/24] feat: implement first step of modular --- src/header.ce.vue | 125 ++++++++++++++++------------------------------ src/i18n.ts | 2 +- src/menu.json | 67 +++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 83 deletions(-) create mode 100644 src/menu.json diff --git a/src/header.ce.vue b/src/header.ce.vue index e23024d..95790a0 100644 --- a/src/header.ce.vue +++ b/src/header.ce.vue @@ -10,6 +10,7 @@ import ChartPieIcon from '@/ui/ChartPieIcon.vue' import UsersIcon from '@/ui/UsersIcon.vue' import ChevronDownIcon from '@/ui/ChevronDownIcon.vue' import { LANG_2_TO_3_MAPPER, t } from '@/i18n' +import menu from '@/menu.json' const props = defineProps<{ hideLogin?: string @@ -47,6 +48,10 @@ function toggleMenu(): void { state.mobileMenuOpen = !state.mobileMenuOpen } +function checkCondition(condition: string): boolean { + return !condition || (condition && state.user?.adminRoles?.[condition]) +} + onMounted(() => { state.lang3 = LANG_2_TO_3_MAPPER[props.lang || navigator.language.substring(0, 2)] || @@ -97,90 +102,46 @@ onMounted(() => { >