New Backend changes
This commit is contained in:
@@ -7,7 +7,7 @@ const {has} = usePermission()
|
||||
|
||||
const links = computed(() => {
|
||||
return [
|
||||
...auth.profile.pinned_on_navigation.map(pin => {
|
||||
...(auth.profile?.pinned_on_navigation || []).map(pin => {
|
||||
if(pin.type === "external") {
|
||||
return {
|
||||
label: pin.label,
|
||||
@@ -92,7 +92,7 @@ const links = computed(() => {
|
||||
label: "E-Mail",
|
||||
to: "/email/new",
|
||||
icon: "i-heroicons-envelope"
|
||||
}, {
|
||||
}/*, {
|
||||
label: "Logbücher",
|
||||
to: "/communication/historyItems",
|
||||
icon: "i-heroicons-book-open"
|
||||
@@ -100,7 +100,7 @@ const links = computed(() => {
|
||||
label: "Chats",
|
||||
to: "/chats",
|
||||
icon: "i-heroicons-chat-bubble-left"
|
||||
}
|
||||
}*/
|
||||
]
|
||||
},
|
||||
... (has("customers") || has("vendors") || has("contacts")) ? [{
|
||||
@@ -152,7 +152,7 @@ const links = computed(() => {
|
||||
},
|
||||
]
|
||||
},
|
||||
... true ? [{
|
||||
... [{
|
||||
label: "Buchhaltung",
|
||||
defaultOpen: false,
|
||||
icon: "i-heroicons-chart-bar-square",
|
||||
@@ -188,7 +188,7 @@ const links = computed(() => {
|
||||
icon: "i-heroicons-document-text"
|
||||
},
|
||||
]
|
||||
},] : [],
|
||||
}],
|
||||
... has("inventory") ? [{
|
||||
label: "Lager",
|
||||
icon: "i-heroicons-puzzle-piece",
|
||||
@@ -345,11 +345,14 @@ const links = computed(() => {
|
||||
<UButton
|
||||
:variant="item.pinned ? 'ghost' : 'ghost'"
|
||||
:color="(item.to && route.path === item.to) || (item.children?.some(c => route.path.includes(c.to))) ? 'primary' : (item.pinned ? 'amber' : 'gray')"
|
||||
:icon="item.icon"
|
||||
:icon="item.pinned ? 'i-heroicons-star' : item.icon"
|
||||
class="w-full"
|
||||
:to="item.to"
|
||||
:target="item.target"
|
||||
>
|
||||
<UIcon
|
||||
v-if="item.pinned"
|
||||
:name="item.icon" class="w-5 h-5 me-2" />
|
||||
{{ item.label }}
|
||||
|
||||
<template v-if="item.children" #trailing>
|
||||
@@ -363,7 +366,7 @@ const links = computed(() => {
|
||||
</template>
|
||||
|
||||
<template #item="{ item }">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col" v-if="item.children?.length > 0">
|
||||
<UButton
|
||||
v-for="child in item.children"
|
||||
:key="child.label"
|
||||
@@ -379,55 +382,5 @@ const links = computed(() => {
|
||||
</div>
|
||||
</template>
|
||||
</UAccordion>
|
||||
<!-- <div
|
||||
v-for="item in links"
|
||||
>
|
||||
<UAccordion
|
||||
v-if="item.children"
|
||||
:items="[item]"
|
||||
>
|
||||
<template #default="{item,index,open}">
|
||||
<UButton
|
||||
variant="ghost"
|
||||
:color="item.children.find(i => route.path.includes(i.to)) ? 'primary' : 'gray'"
|
||||
:icon="item.icon"
|
||||
>
|
||||
{{item.label}}
|
||||
|
||||
<template #trailing>
|
||||
<UIcon
|
||||
name="i-heroicons-chevron-right-20-solid"
|
||||
class="w-5 h-5 ms-auto transform transition-transform duration-200"
|
||||
:class="[open && 'rotate-90']"
|
||||
/>
|
||||
</template>
|
||||
</UButton>
|
||||
</template>
|
||||
<template #item="{item, open}">
|
||||
<div class="flex flex-col">
|
||||
<UButton
|
||||
variant="ghost"
|
||||
:color="child.to === route.path ? 'primary' : 'gray'"
|
||||
:icon="child.icon"
|
||||
v-for="child in item.children"
|
||||
class="ml-4"
|
||||
:to="child.to"
|
||||
:target="child.target"
|
||||
>
|
||||
{{child.label}}
|
||||
</UButton>
|
||||
</div>
|
||||
</template>
|
||||
</UAccordion>
|
||||
<UButton
|
||||
v-else
|
||||
variant="ghost"
|
||||
:color="item.to === route.path ? 'primary' : 'gray'"
|
||||
class="w-full"
|
||||
:icon="item.icon"
|
||||
:to="item.to"
|
||||
>
|
||||
{{item.label}}
|
||||
</UButton>
|
||||
</div>-->
|
||||
</template>
|
||||
Reference in New Issue
Block a user