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

wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-banyandb.git


The following commit(s) were added to refs/heads/main by this push:
     new 73f463a7 ui: name search improvement on the measure page (#352)
73f463a7 is described below

commit 73f463a79fbc679fc5d86f337957d9b43918b43c
Author: Rick <1450685+linuxsu...@users.noreply.github.com>
AuthorDate: Thu Nov 9 18:04:13 2023 +0800

    ui: name search improvement on the measure page (#352)
---
 ui/src/components/Aside/index.vue | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ui/src/components/Aside/index.vue 
b/ui/src/components/Aside/index.vue
index afd3c9e8..92fe5409 100644
--- a/ui/src/components/Aside/index.vue
+++ b/ui/src/components/Aside/index.vue
@@ -248,14 +248,21 @@ function searchGroup() {
     let groupLists = []
     data.groupListsCopy.forEach(item => {
         let itemCache = JSON.parse(JSON.stringify(item))
+        let matched = false
         if (Array.isArray(itemCache.children)) {
             itemCache.children = itemCache.children.filter(child => {
                 return child.metadata.name.indexOf(data.search) > -1
             })
             if (itemCache.children.length > 0) {
                 groupLists.push(itemCache)
+                matched = true
             }
         }
+
+        // check the group name if no child items matched
+        if (!matched && itemCache.metadata.name.indexOf(data.search) > -1) {
+            groupLists.push(itemCache)
+        }
     })
     data.groupLists = JSON.parse(JSON.stringify(groupLists))
 }

Reply via email to