fix: added search for node labels (#3348)

This commit is contained in:
Prateek Jakhar 2024-10-13 19:13:22 +05:30 committed by GitHub
parent 82da25d763
commit 6c3541915b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -101,17 +101,19 @@ const AddNodes = ({ nodesData, node, isAgentCanvas }) => {
const nodes = nodesData.filter((nd) => !blacklistCategoriesForAgentCanvas.includes(nd.category)) const nodes = nodesData.filter((nd) => !blacklistCategoriesForAgentCanvas.includes(nd.category))
nodes.push(...addException()) nodes.push(...addException())
const passed = nodes.filter((nd) => { const passed = nodes.filter((nd) => {
const passesQuery = nd.name.toLowerCase().includes(value.toLowerCase()) const passesName = nd.name.toLowerCase().includes(value.toLowerCase())
const passesLabel = nd.label.toLowerCase().includes(value.toLowerCase())
const passesCategory = nd.category.toLowerCase().includes(value.toLowerCase()) const passesCategory = nd.category.toLowerCase().includes(value.toLowerCase())
return passesQuery || passesCategory return passesName || passesCategory || passesLabel
}) })
return passed return passed
} }
const nodes = nodesData.filter((nd) => nd.category !== 'Multi Agents' && nd.category !== 'Sequential Agents') const nodes = nodesData.filter((nd) => nd.category !== 'Multi Agents' && nd.category !== 'Sequential Agents')
const passed = nodes.filter((nd) => { const passed = nodes.filter((nd) => {
const passesQuery = nd.name.toLowerCase().includes(value.toLowerCase()) const passesName = nd.name.toLowerCase().includes(value.toLowerCase())
const passesLabel = nd.label.toLowerCase().includes(value.toLowerCase())
const passesCategory = nd.category.toLowerCase().includes(value.toLowerCase()) const passesCategory = nd.category.toLowerCase().includes(value.toLowerCase())
return passesQuery || passesCategory return passesName || passesCategory || passesLabel
}) })
return passed return passed
} }