mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-27 09:00:32 +03:00
Feature/Seq Agent Nodes Update (#2942)
update all seg agent nodes to 2.0 for UI UX improvements
This commit is contained in:
@@ -207,6 +207,15 @@ export const updateOutdatedNodeData = (newComponentNodeData, existingComponentNo
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check for tabs
|
||||
const inputParamsWithTabIdentifiers = initNewComponentNodeData.inputParams.filter((param) => param.tabIdentifier) || []
|
||||
|
||||
for (const inputParam of inputParamsWithTabIdentifiers) {
|
||||
const tabIdentifier = `${inputParam.tabIdentifier}_${existingComponentNodeData.id}`
|
||||
let selectedTabValue = existingComponentNodeData.inputs[tabIdentifier] || inputParam.default
|
||||
initNewComponentNodeData.inputs[tabIdentifier] = selectedTabValue
|
||||
initNewComponentNodeData.inputs[selectedTabValue] = existingComponentNodeData.inputs[selectedTabValue]
|
||||
}
|
||||
|
||||
// Update outputs with existing outputs
|
||||
if (existingComponentNodeData.outputs) {
|
||||
@@ -217,6 +226,24 @@ export const updateOutdatedNodeData = (newComponentNodeData, existingComponentNo
|
||||
}
|
||||
}
|
||||
|
||||
// Special case for Condition node to update outputAnchors
|
||||
if (initNewComponentNodeData.name.includes('seqCondition')) {
|
||||
const options = existingComponentNodeData.outputAnchors[0].options || []
|
||||
|
||||
const newOptions = []
|
||||
for (let i = 0; i < options.length; i += 1) {
|
||||
if (options[i].isAnchor) {
|
||||
newOptions.push({
|
||||
...options[i],
|
||||
id: `${initNewComponentNodeData.id}-output-${options[i].name}-Condition`,
|
||||
type: 'Condition'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
initNewComponentNodeData.outputAnchors[0].options = newOptions
|
||||
}
|
||||
|
||||
return initNewComponentNodeData
|
||||
}
|
||||
|
||||
@@ -831,7 +858,7 @@ const createJsonArray = (labels) => {
|
||||
return {
|
||||
label: label,
|
||||
name: toCamelCase(label),
|
||||
baseClasses: ['Agent', 'LLMNode', 'ToolNode'],
|
||||
baseClasses: ['Condition'],
|
||||
isAnchor: true
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user