diff --git a/spaces/app.vue b/spaces/app.vue index 71f3c52..e3607ea 100644 --- a/spaces/app.vue +++ b/spaces/app.vue @@ -2,6 +2,8 @@ +import GlobalSearch from "~/components/GlobalSearch.vue"; + const user = useSupabaseUser() //console.log(user.value) const router = useRouter() @@ -12,11 +14,6 @@ const tenants = (await supabase.from("tenants").select()).data const dataStore = useDataStore() - -const userProfile = (user.value ? dataStore.getProfileById(user.value.id) : {}) -//console.log(userProfile) - - const isLight = computed({ get () { return colorMode.value !== 'dark' @@ -26,6 +23,32 @@ const isLight = computed({ } }) +const userProfile = (user.value ? dataStore.getProfileById(user.value.id) : {}) +//console.log(userProfile) + +const showUserMenu = ref(false) +const userMenuItems = ref([ + { + label: "Profil", + badge: dataStore.notifications.filter(item => item.read).length, + icon: "i-heroicons-user-20-solid" + }, + { + label: "Nummernkreise", + icon: "i-heroicons-cog-8-tooth", + to: "/settings/numberRanges" + }, + { + label: 'Benutzer', + icon: 'i-heroicons-user-group', + to: "/settings/users" + } +]) + + + + + const viewport = useViewport() watch(viewport.breakpoint, (newBreakpoint, oldBreakpoint) => { @@ -56,7 +79,7 @@ const navLinks = [ icon: "i-heroicons-truck" }, { - label: "Kontakte", + label: "Ansprechpartner", to: "/contacts", icon: "i-heroicons-user-group" }, @@ -131,9 +154,14 @@ const navLinks = [ children: [ { label: "Zeiterfassung", - to: "/timetracking", + to: "/employees/timetracking", icon: "i-heroicons-clock" }, + { + label: "Abwesenheiten", + to: "/employees/absenceRequests", + icon: "i-heroicons-document-text" + } ] }, { @@ -141,15 +169,15 @@ const navLinks = [ icon: 'i-heroicons-home', children: [ { - label: "Artikel", - to: "/products", - icon: "i-heroicons-puzzle-piece" - }, - { - label: "Inventar", + label: "Steuerung", to: "/inventory", icon: "i-heroicons-square-3-stack-3d" }, + { + label: "Artikelstamm", + to: "/products", + icon: "i-heroicons-puzzle-piece" + }, { label: "Lagerplätze", to: "/inventory/spaces", @@ -166,37 +194,7 @@ const navLinks = [ const linksForBreadcrumbs = ref([]) -const generateLinks = () => { - let pathSteps = route.fullPath.split("/") - let returnArr = [] - pathSteps.forEach((step,index) => { - - let stepLink = navLinks.find(link => link.link == step) - - if(stepLink) { - returnArr[index] = { - label: stepLink.label, - icon: stepLink.icon, - to: '/' + stepLink.link - } - } - - linksForBreadcrumbs.value = returnArr - - }) - - - -} - -watch( - () => route.path, - () => { - generateLinks() - } -) -generateLinks() @@ -223,6 +221,9 @@ useSeoMeta({ twitterCard: 'summary_large_image' }) + + + const items = [ [{ label: user.value ? user.value.email : "", @@ -250,7 +251,7 @@ const items = [ label: 'Status', icon: 'i-heroicons-signal' }],*/ [{ - label: 'Sign out', + label: 'Ausloggen', icon: 'i-heroicons-arrow-left-on-rectangle', click: async () => { await supabase.auth.signOut() @@ -279,8 +280,12 @@ const items = [ -