Removed non available Entries
This commit is contained in:
@@ -18,6 +18,7 @@ const showMemberRelationsNav = computed(() => {
|
||||
const isAdmin = computed(() => Boolean(auth.user?.is_admin))
|
||||
const tenantFeatures = computed(() => auth.activeTenantData?.features || {})
|
||||
const featureEnabled = (key) => tenantFeatures.value?.[key] !== false
|
||||
const visibleItems = (items) => items.filter(item => item && !item.disabled)
|
||||
|
||||
const links = computed(() => {
|
||||
const organisationChildren = [
|
||||
@@ -36,7 +37,7 @@ const links = computed(() => {
|
||||
to: "/wiki",
|
||||
icon: "i-heroicons-book-open"
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const documentChildren = [
|
||||
featureEnabled("files") ? {
|
||||
@@ -56,7 +57,7 @@ const links = computed(() => {
|
||||
icon: "i-heroicons-archive-box",
|
||||
disabled: true
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const communicationChildren = [
|
||||
featureEnabled("helpdesk") ? {
|
||||
@@ -71,7 +72,7 @@ const links = computed(() => {
|
||||
icon: "i-heroicons-envelope",
|
||||
disabled: true
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const contactsChildren = [
|
||||
showMembersNav.value && featureEnabled("members") ? {
|
||||
@@ -94,7 +95,7 @@ const links = computed(() => {
|
||||
to: "/standardEntity/contacts",
|
||||
icon: "i-heroicons-user-group"
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const staffChildren = [
|
||||
featureEnabled("staffTime") ? {
|
||||
@@ -102,7 +103,7 @@ const links = computed(() => {
|
||||
to: "/staff/time",
|
||||
icon: "i-heroicons-clock",
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const accountingChildren = [
|
||||
featureEnabled("createDocument") ? {
|
||||
@@ -120,6 +121,11 @@ const links = computed(() => {
|
||||
to: "/incomingInvoices",
|
||||
icon: "i-heroicons-document-text",
|
||||
} : null,
|
||||
(featureEnabled("createDocument") || featureEnabled("incomingInvoices")) ? {
|
||||
label: "USt-Auswertung",
|
||||
to: "/accounting/tax",
|
||||
icon: "i-heroicons-calculator",
|
||||
} : null,
|
||||
featureEnabled("costcentres") ? {
|
||||
label: "Kostenstellen",
|
||||
to: "/standardEntity/costcentres",
|
||||
@@ -140,7 +146,7 @@ const links = computed(() => {
|
||||
to: "/banking",
|
||||
icon: "i-heroicons-document-text",
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const inventoryChildren = [
|
||||
has("spaces") && featureEnabled("spaces") ? {
|
||||
@@ -168,7 +174,7 @@ const links = computed(() => {
|
||||
to: "/standardEntity/inventoryitemgroups",
|
||||
icon: "i-heroicons-puzzle-piece"
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const masterDataChildren = [
|
||||
has("products") && featureEnabled("products") ? {
|
||||
@@ -221,7 +227,7 @@ const links = computed(() => {
|
||||
to: "/standardEntity/vehicles",
|
||||
icon: "i-heroicons-truck"
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
const settingsChildren = [
|
||||
featureEnabled("settingsNumberRanges") ? {
|
||||
@@ -259,9 +265,19 @@ const links = computed(() => {
|
||||
to: "/export",
|
||||
icon: "i-heroicons-clipboard-document-list"
|
||||
} : null,
|
||||
].filter(Boolean)
|
||||
]
|
||||
|
||||
return [
|
||||
const visibleOrganisationChildren = visibleItems(organisationChildren)
|
||||
const visibleDocumentChildren = visibleItems(documentChildren)
|
||||
const visibleCommunicationChildren = visibleItems(communicationChildren)
|
||||
const visibleContactsChildren = visibleItems(contactsChildren)
|
||||
const visibleStaffChildren = visibleItems(staffChildren)
|
||||
const visibleAccountingChildren = visibleItems(accountingChildren)
|
||||
const visibleInventoryChildren = visibleItems(inventoryChildren)
|
||||
const visibleMasterDataChildren = visibleItems(masterDataChildren)
|
||||
const visibleSettingsChildren = visibleItems(settingsChildren)
|
||||
|
||||
return visibleItems([
|
||||
...(auth.profile?.pinned_on_navigation || []).map(pin => {
|
||||
if (pin.type === "external") {
|
||||
return {
|
||||
@@ -293,53 +309,53 @@ const links = computed(() => {
|
||||
to: "/historyitems",
|
||||
icon: "i-heroicons-book-open"
|
||||
} : null,
|
||||
...(organisationChildren.length > 0 ? [{
|
||||
...(visibleOrganisationChildren.length > 0 ? [{
|
||||
label: "Organisation",
|
||||
icon: "i-heroicons-rectangle-stack",
|
||||
defaultOpen: false,
|
||||
children: organisationChildren
|
||||
children: visibleOrganisationChildren
|
||||
}] : []),
|
||||
...(documentChildren.length > 0 ? [{
|
||||
...(visibleDocumentChildren.length > 0 ? [{
|
||||
label: "Dokumente",
|
||||
icon: "i-heroicons-rectangle-stack",
|
||||
defaultOpen: false,
|
||||
children: documentChildren
|
||||
children: visibleDocumentChildren
|
||||
}] : []),
|
||||
...(communicationChildren.length > 0 ? [{
|
||||
...(visibleCommunicationChildren.length > 0 ? [{
|
||||
label: "Kommunikation",
|
||||
icon: "i-heroicons-megaphone",
|
||||
defaultOpen: false,
|
||||
children: communicationChildren
|
||||
children: visibleCommunicationChildren
|
||||
}] : []),
|
||||
...(contactsChildren.length > 0 ? [{
|
||||
...(visibleContactsChildren.length > 0 ? [{
|
||||
label: "Kontakte",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-user-group",
|
||||
children: contactsChildren
|
||||
children: visibleContactsChildren
|
||||
}] : []),
|
||||
...(staffChildren.length > 0 ? [{
|
||||
...(visibleStaffChildren.length > 0 ? [{
|
||||
label: "Mitarbeiter",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-user-group",
|
||||
children: staffChildren
|
||||
children: visibleStaffChildren
|
||||
}] : []),
|
||||
...(accountingChildren.length > 0 ? [{
|
||||
...(visibleAccountingChildren.length > 0 ? [{
|
||||
label: "Buchhaltung",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-chart-bar-square",
|
||||
children: accountingChildren
|
||||
children: visibleAccountingChildren
|
||||
}] : []),
|
||||
...(inventoryChildren.length > 0 ? [{
|
||||
...(visibleInventoryChildren.length > 0 ? [{
|
||||
label: "Lager",
|
||||
icon: "i-heroicons-puzzle-piece",
|
||||
defaultOpen: false,
|
||||
children: inventoryChildren
|
||||
children: visibleInventoryChildren
|
||||
}] : []),
|
||||
...(masterDataChildren.length > 0 ? [{
|
||||
...(visibleMasterDataChildren.length > 0 ? [{
|
||||
label: "Stammdaten",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-clipboard-document",
|
||||
children: masterDataChildren
|
||||
children: visibleMasterDataChildren
|
||||
}] : []),
|
||||
|
||||
...(has("projects") && featureEnabled("projects")) ? [{
|
||||
@@ -357,13 +373,13 @@ const links = computed(() => {
|
||||
to: "/standardEntity/plants",
|
||||
icon: "i-heroicons-clipboard-document"
|
||||
}] : [],
|
||||
...(settingsChildren.length > 0 ? [{
|
||||
...(visibleSettingsChildren.length > 0 ? [{
|
||||
label: "Einstellungen",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-cog-8-tooth",
|
||||
children: settingsChildren
|
||||
children: visibleSettingsChildren
|
||||
}] : []),
|
||||
].filter(Boolean)
|
||||
])
|
||||
})
|
||||
|
||||
const accordionItems = computed(() =>
|
||||
|
||||
Reference in New Issue
Block a user