mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 13:00:56 +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:
@@ -4,8 +4,9 @@ import { useEffect } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
// Material
|
||||
import { Dialog, DialogContent, DialogTitle } from '@mui/material'
|
||||
import { Button, Dialog, DialogContent, DialogTitle } from '@mui/material'
|
||||
import { TableViewOnly } from '@/ui-component/table/Table'
|
||||
import { IconBook2 } from '@tabler/icons-react'
|
||||
|
||||
// Store
|
||||
import { HIDE_CANVAS_DIALOG, SHOW_CANVAS_DIALOG } from '@/store/actions'
|
||||
@@ -163,6 +164,20 @@ const NodeInfoDialog = ({ show, dialogProps, onCancel }) => {
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ flex: 1 }}></div>
|
||||
{dialogProps.data.documentation && (
|
||||
<Button
|
||||
variant='outlined'
|
||||
color='primary'
|
||||
title='Open Documentation'
|
||||
onClick={() => {
|
||||
window.open(dialogProps.data.documentation, '_blank', 'noopener,noreferrer')
|
||||
}}
|
||||
startIcon={<IconBook2 />}
|
||||
>
|
||||
Documentation
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</DialogTitle>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
})
|
||||
|
||||
@@ -178,6 +178,7 @@ const AddNodes = ({ nodesData, node, isAgentCanvas }) => {
|
||||
setNodes(filteredResult)
|
||||
accordianCategories['Multi Agents'] = true
|
||||
accordianCategories['Sequential Agents'] = true
|
||||
accordianCategories['Memory'] = true
|
||||
setCategoryExpanded(accordianCategories)
|
||||
} else {
|
||||
const taggedNodes = groupByTags(nodes, newTabValue)
|
||||
|
||||
Reference in New Issue
Block a user