Developer sidebar: Support search in metadata value and config (#1876)

Improves developer sidebar search to even search within the metadata values and config object.

This e.g. allows you to search for all pattern settings in the `stateDescription` metadata.

Signed-off-by: Stefan Höhn <mail@stefanhoehn.com>
pull/1878/head
stefan-hoehn 2023-05-07 13:49:14 +02:00 committed by GitHub
parent fa371993f1
commit 54aa3ab4e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -453,10 +453,7 @@ export default {
query = query.toLowerCase()
if (i.name.toLowerCase().indexOf(query) >= 0) return true
if (i.label && i.label.toLowerCase().indexOf(query) >= 0) return true
if (i.metadata) {
const namespaces = Object.keys(i.metadata).map(n => n.toLowerCase())
if (namespaces.includes(query)) return true
}
if (i.metadata && JSON.stringify(i.metadata).toLowerCase().indexOf(query) >= 0) return true
if (i.tags && i.tags.map(t => t.toLowerCase()).includes(query)) return true
return false
},