π 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
Fixes in sidebar icons
Smaug6739c0e8ba4ce382
diff --git a/frontend/components/Sidebar/SidebarItem.vue b/frontend/components/Sidebar/SidebarItem.vueindex 22b9d411..6fc0e485 100644--- a/frontend/components/Sidebar/SidebarItem.vue+++ b/frontend/components/Sidebar/SidebarItem.vue@@ -20,12 +20,7 @@ const customClass = ref('');const icon = computed(() => {if ('color' in props.item.data) customClass.value = props.item.data.color ? `item-icon ${getAppColor(props.item.data.color as number)}` : '';if ('icon' in props.item.data && props.item.data.icon) return props.item.data.icon;- if ('icon' in props.item && props.item.icon) return props.item.icon;- if (props.item.data.type === 'category') return 'folder';- if (props.item.data.type === 'document' && props.item.childrens?.length) return 'file_parent';- if (props.item.data.type === 'document' && props.item.data.accessibility == 2) return 'draft';- if (props.item.data.type === 'document' && props.item.data.accessibility == 3) return 'archive';- return 'file';+ return props.item.icon || '';});const draggable = ref<boolean>(true);const isDragOver = ref<boolean>(false);diff --git a/frontend/composables/useSidebarTree.ts b/frontend/composables/useSidebarTree.tsindex fa19536c..6a2e1b08 100644--- a/frontend/composables/useSidebarTree.ts+++ b/frontend/composables/useSidebarTree.ts@@ -18,7 +18,7 @@ export function useSidebarTree() {parent_id: cat.parent_id || '',label: cat.name,route: cat.parent_id ? `/dashboard/categories/${cat.id}` : '',- icon: cat.icon,+ icon: cat.icon || 'folder',data: cat,show: ref(getCollapseState(cat.id)),})),@@ -54,16 +54,17 @@ export function useSidebarTree() {const allItems = computed(() => [...documents.value, ...ressources.value, ...categories.value.filter(cat => (cat as Item<Category>).data.role == 1)]);const structure = computed(() => new TreeStructure(allItems.value));- // Special icons:- for (const i of structure.value.childrenMap.keys()) {+ const tree = computed(() => {+ // Special icons:if (!preferencesStore.get('normalizeFileIcons')) {- const ref = structure.value.itemMap.get(i);- const subs = structure.value.childrenMap.get(i);- if (ref?.data.type === 'document' && subs?.some(c => c.data.type != 'ressource')) structure.value.itemMap.get(i)!.icon = 'file_parent';+ for (const i of structure.value.childrenMap.keys()) {+ const ref = structure.value.itemMap.get(i);+ const subs = structure.value.childrenMap.get(i);+ if (ref?.data.type === 'document' && subs?.some(c => c.data.type != 'ressource')) structure.value.itemMap.get(i)!.icon = 'file_parent';+ }}- }-- const tree = computed(() => structure.value.generateTree());+ return structure.value.generateTree();+ });const filtered = computed(() => {return tree.value.filter(item => {