This is an automated email from the ASF dual-hosted git repository.

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git


The following commit(s) were added to refs/heads/main by this push:
     new 44d11cbf [Bugfix] fix the theme error while the search mode (#429)
44d11cbf is described below

commit 44d11cbf883a9966a8e187bfacf19e95730e55c7
Author: xiaomo <[email protected]>
AuthorDate: Wed Jun 19 01:30:59 2024 +0800

    [Bugfix] fix the theme error while the search mode (#429)
---
 .../views/metadata/components/menu-tree/index.tsx   | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx 
b/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
index 1c6615cb..baa055e9 100644
--- a/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
@@ -80,16 +80,6 @@ export default defineComponent({
 
     onUnmounted(catalogStore.resetCurrentTable)
 
-    watch(
-      () => filterValue.value,
-      async (newValue) => {
-        if (!newValue && isSearch.value) {
-          isSearch.value = false
-          await catalogStore.getAllCatalogs(true)
-        }
-      },
-    )
-
     const onLoadMenu = async (node: TreeOption) => {
       if (node.type === 'catalog') {
         node.children = await catalogStore.getDatabasesById(node.key as number)
@@ -258,10 +248,12 @@ export default defineComponent({
 
     const onSearch = async (e: KeyboardEvent) => {
       if (e.code === 'Enter') {
-        isSearch.value = true
-        await catalogStore.getTablesByDataBaseId({
-          name: filterValue.value,
-        })
+        isSearch.value = Boolean(filterValue.value)
+        filterValue.value
+          ? await catalogStore.getTablesByDataBaseId({
+            name: filterValue.value,
+          })
+          : await catalogStore.getAllCatalogs(true)
       }
     }
 
@@ -318,7 +310,6 @@ export default defineComponent({
                     block-line
                     expand-on-click
                     data={this.menuList}
-                    defaultExpandAll={this.isSearch}
                     nodeProps={this.nodeProps}
                     renderSuffix={this.renderSuffix}
                     renderSwitcherIcon={this.renderPrefix}

Reply via email to