Skip to content

Commit

Permalink
fix: added search for node labels (#3348)
Browse files Browse the repository at this point in the history
  • Loading branch information
prtkjakhar authored Oct 13, 2024
1 parent 82da25d commit 6c35419
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/ui/src/views/canvas/AddNodes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,19 @@ const AddNodes = ({ nodesData, node, isAgentCanvas }) => {
const nodes = nodesData.filter((nd) => !blacklistCategoriesForAgentCanvas.includes(nd.category))
nodes.push(...addException())
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())
return passesQuery || passesCategory
return passesName || passesCategory || passesLabel
})
return passed
}
const nodes = nodesData.filter((nd) => nd.category !== 'Multi Agents' && nd.category !== 'Sequential Agents')
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())
return passesQuery || passesCategory
return passesName || passesCategory || passesLabel
})
return passed
}
Expand Down

0 comments on commit 6c35419

Please sign in to comment.