From 38fa085f08ab3614075ad6d618bb4e2310bd3426 Mon Sep 17 00:00:00 2001 From: mertmit Date: Fri, 2 Dec 2022 20:37:46 +0300 Subject: [PATCH] feat: expand all bases while searching Signed-off-by: mertmit --- packages/nc-gui/components/dashboard/TreeView.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/dashboard/TreeView.vue b/packages/nc-gui/components/dashboard/TreeView.vue index bd7fbb1ffc..45947b5a76 100644 --- a/packages/nc-gui/components/dashboard/TreeView.vue +++ b/packages/nc-gui/components/dashboard/TreeView.vue @@ -240,9 +240,18 @@ function openTableCreateDialog(baseId?: string) { const searchInputRef: VNodeRef = (vnode: typeof Input) => vnode?.$el?.focus() +const beforeSearch = ref([]) + const onSearchCloseIconClick = () => { filterQuery = '' toggleSearchActive(false) + activeKey.value = beforeSearch.value +} + +const onSearchIconClick = () => { + beforeSearch.value = activeKey.value + toggleSearchActive(true) + activeKey.value = bases.value.filter((el) => el.enabled).map((el) => `collapse-${el.id}`) } const isCreateTableAllowed = computed( @@ -348,7 +357,7 @@ watch( - + @@ -611,7 +620,7 @@ watch( :class="[{ hidden: searchActive && !!filterQuery && !filteredTables?.find((el) => el.base_id === base.id) }]" expand-icon-position="right" :bordered="false" - accordion + :accordion="!searchActive" ghost >