From 754f9e35ff1a6a800a19e561263eedc85ae96c6f Mon Sep 17 00:00:00 2001 From: prtkjakhar Date: Sun, 13 Oct 2024 16:29:12 +0530 Subject: [PATCH] fix: added search for node labels --- packages/ui/src/views/canvas/AddNodes.jsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/views/canvas/AddNodes.jsx b/packages/ui/src/views/canvas/AddNodes.jsx index 3b8133ca0d4..e7ce0873907 100644 --- a/packages/ui/src/views/canvas/AddNodes.jsx +++ b/packages/ui/src/views/canvas/AddNodes.jsx @@ -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 }