From b811c27ab5955413667bc48f9283403e6b792e99 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 31 Jan 2025 06:33:12 +0530 Subject: [PATCH] feat: Hide empty folders from sidebar (#10786) This PR updates the sidebar to hide empty folders. So, in case the user has not created any folders, or teams, the section in the sidebar will be hidden --- .../sidebar/SidebarSubGroup.vue | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue b/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue index a938a202e..8e3c3009e 100644 --- a/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue +++ b/app/javascript/dashboard/components-next/sidebar/SidebarSubGroup.vue @@ -2,7 +2,6 @@ import { computed, ref } from 'vue'; import SidebarGroupLeaf from './SidebarGroupLeaf.vue'; import SidebarGroupSeparator from './SidebarGroupSeparator.vue'; -import SidebarGroupEmptyLeaf from './SidebarGroupEmptyLeaf.vue'; import { useSidebarContext } from './provider'; import { useEventListener } from '@vueuse/core'; @@ -26,11 +25,6 @@ const accessibleItems = computed(() => ); const hasAccessibleItems = computed(() => { - if (props.children.length === 0) { - // cases like segment, folder and labels where users can create new items - return true; - } - return accessibleItems.value.length > 0; }); @@ -55,7 +49,7 @@ useEventListener(scrollableContainer, 'scroll', () => { :icon class="my-1" /> -