mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
Merge remote-tracking branch 'origin/main' into feat/queue-based-graph-engine
Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
@ -589,7 +589,7 @@ const formatItem = (
|
||||
return false
|
||||
|
||||
const obj = findExceptVarInObject(isFile ? { ...v, children } : v, filterVar, selector, isFile)
|
||||
return obj?.children && ((obj?.children as Var[]).length > 0 || Object.keys((obj?.children as StructuredOutput)?.schema?.properties || {}).length > 0)
|
||||
return hasValidChildren(obj?.children)
|
||||
}).map((v) => {
|
||||
const isFile = v.type === VarType.file
|
||||
|
||||
@ -813,7 +813,7 @@ export const getVarType = ({
|
||||
if (isIterationInnerVar) {
|
||||
if (valueSelector[1] === 'item') {
|
||||
const itemType = getIterationItemType({
|
||||
valueSelector: (parentNode?.data as any).iterator_selector || [],
|
||||
valueSelector: (parentNode?.data as any)?.iterator_selector || [],
|
||||
beforeNodesOutputVars,
|
||||
})
|
||||
return itemType
|
||||
@ -832,7 +832,7 @@ export const getVarType = ({
|
||||
if (isLoopInnerVar) {
|
||||
if (valueSelector[1] === 'item') {
|
||||
const itemType = getLoopItemType({
|
||||
valueSelector: (parentNode?.data as any).iterator_selector || [],
|
||||
valueSelector: (parentNode?.data as any)?.iterator_selector || [],
|
||||
beforeNodesOutputVars,
|
||||
})
|
||||
return itemType
|
||||
|
||||
@ -45,7 +45,7 @@ const InputItem: FC<Props> = ({
|
||||
filterVar: (varPayload: Var) => {
|
||||
const supportVarTypes = [VarType.string, VarType.number, VarType.secret]
|
||||
if (isSupportFile)
|
||||
supportVarTypes.push(...[VarType.file, VarType.arrayFile])
|
||||
supportVarTypes.push(VarType.file, VarType.arrayFile)
|
||||
|
||||
return supportVarTypes.includes(varPayload.type)
|
||||
},
|
||||
|
||||
@ -97,6 +97,7 @@ export const getOperators = (type?: VarType, file?: { key: string }) => {
|
||||
ComparisonOperator.notEmpty,
|
||||
]
|
||||
case VarType.number:
|
||||
case VarType.integer:
|
||||
return [
|
||||
ComparisonOperator.equal,
|
||||
ComparisonOperator.notEqual,
|
||||
|
||||
@ -229,7 +229,7 @@ export const useSchemaNodeOperations = (props: VisualEditorProps) => {
|
||||
const schema = findPropertyWithPath(draft, path) as Field
|
||||
if (schema.type === Type.object) {
|
||||
schema.properties = {
|
||||
...(schema.properties || {}),
|
||||
...schema.properties,
|
||||
'': {
|
||||
type: Type.string,
|
||||
},
|
||||
@ -238,7 +238,7 @@ export const useSchemaNodeOperations = (props: VisualEditorProps) => {
|
||||
}
|
||||
if (schema.type === Type.array && schema.items && schema.items.type === Type.object) {
|
||||
schema.items.properties = {
|
||||
...(schema.items.properties || {}),
|
||||
...schema.items.properties,
|
||||
'': {
|
||||
type: Type.string,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user