π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Fix shared icons dissapear and remove old "root" prop
Smaug6739b5e981e56280
diff --git a/frontend/app/components/Sidebar/CollapseItem.vue b/frontend/app/components/Sidebar/CollapseItem.vueindex e4a7e616..d04e3b5d 100644--- a/frontend/app/components/Sidebar/CollapseItem.vue+++ b/frontend/app/components/Sidebar/CollapseItem.vue@@ -1,23 +1,23 @@<template><div v-if="item.childrens?.length">- <SidebarItem :item="item" class="collapse-header doc">+ <SidebarItem :level="level" :item="item" class="collapse-header doc"><svg :class="{ rotated: !props.item.show.value }" xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" @click="toggleShow"><path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z" /></svg></SidebarItem><template v-if="getCollapseState(item.id)"><div v-for="child in item.childrens" :key="child.id" class="collapse-body" style="margin-left: 15px">- <CollapseItem v-if="child.childrens?.length" :item="child" :root="child.data.role === 3" />- <SidebarItem v-else :item="child" />+ <CollapseItem v-if="child.childrens?.length" :item="child" :level="level + 1" />+ <SidebarItem v-else :level="level + 1" :item="child" /></div></template></div><!-- Filter hidden "navigation items" -->- <SidebarItem v-else-if="item.data.role !== -1 || item.show.value" :item="item" />+ <SidebarItem v-else-if="item.data.role !== -1 || item.show.value" :item="item" :level="level" /></template><script setup lang="ts">import type { DefaultItem } from './helpers';-const props = defineProps<{ item: Item | DefaultItem; root?: boolean }>();+const props = withDefaults(defineProps<{ item: Item | DefaultItem; level?: number }>(), { level: 0 });const toggleShow = () => {setCollapseState(props.item.id, !props.item.show.value);diff --git a/frontend/app/components/Sidebar/SidebarItem.vue b/frontend/app/components/Sidebar/SidebarItem.vueindex 9b7a1ab3..b029a3be 100644--- a/frontend/app/components/Sidebar/SidebarItem.vue+++ b/frontend/app/components/Sidebar/SidebarItem.vue@@ -15,7 +15,7 @@<NuxtLink v-if="item.onClick" style="flex: 1" class="close" @click="item.onClick">{{ item.label }}</NuxtLink><NuxtLink v-else :to="item.route" style="flex: 1" class="close">{{ item.label }}</NuxtLink>- <Icon v-if="item.data.shared && !item.parent_id" name="users" fill="var(--font-color-light)" />+ <Icon v-if="item.data.shared && level === 0" name="users" fill="var(--font-color-light)" /><NuxtLink v-if="item.data.role === 2 && nodesStore.hasPermissions(item.data as Node, 2)" :to="`/dashboard/categories/${item.id}/edit`" class="nav close"><Icon name="settings" />@@ -35,7 +35,7 @@ import type { Node } from '~/stores';const nodesStore = useNodesStore();const { isOpened, workspaceId } = useSidebar();-const props = defineProps<{ item: Item | DefaultItem }>();+const props = defineProps<{ item: Item | DefaultItem; level: number }>();const isDragOver = ref<boolean>(false);const customClass = computed(() => {