feat: enhance condition handling with enum value options and metadata in workflow components

This commit is contained in:
mlogclub
2026-06-27 12:50:29 +08:00
parent d4ff0980c4
commit f85fb6d406
12 changed files with 497 additions and 41 deletions
@@ -108,11 +108,20 @@ export type WorkflowVariableSelector = {
field: string
}
export type WorkflowVariableValueOption = {
value: unknown
label: string
description?: string
}
export type WorkflowVariableSpec = {
name: string
label?: string
type: WorkflowVariableType
required?: boolean
description?: string
operators?: string[]
valueOptions?: WorkflowVariableValueOption[]
}
export type WorkflowNodeSpec = {
@@ -128,8 +137,11 @@ export type WorkflowVariableRef = {
nodeId: string
nodeName: string
field: string
label?: string
type: string
description: string
operators?: string[]
valueOptions?: WorkflowVariableValueOption[]
}
export type WorkflowDraftValidation = {
@@ -647,8 +659,11 @@ export function getAvailableVariables(
nodeId: sourceNode.id,
nodeName: sourceNode.data?.name ?? spec?.title ?? sourceNode.id,
field: output.name,
label: output.label,
type: output.type,
description: output.description ?? "",
operators: output.operators,
valueOptions: output.valueOptions,
})
}
}