fix: Metadata filtering with Manual option in Agent mode does not take effect when specifying input variables. (#20362)

This commit is contained in:
suntp
2025-07-15 10:47:20 +08:00
committed by GitHub
parent 8e910d8c59
commit 88537991d6

View File

@@ -9,7 +9,7 @@ import type { VarType } from '@/app/components/workflow/types'
import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development' import { Variable02 } from '@/app/components/base/icons/src/vender/solid/development'
type ConditionCommonVariableSelectorProps = { type ConditionCommonVariableSelectorProps = {
variables?: { name: string; type: string }[] variables?: { name: string; type: string; value: string }[]
value?: string | number value?: string | number
varType?: VarType varType?: VarType
onChange: (v: string) => void onChange: (v: string) => void
@@ -24,7 +24,7 @@ const ConditionCommonVariableSelector = ({
const { t } = useTranslation() const { t } = useTranslation()
const [open, setOpen] = useState(false) const [open, setOpen] = useState(false)
const selected = variables.find(v => v.name === value) const selected = variables.find(v => v.value === value)
const handleChange = useCallback((v: string) => { const handleChange = useCallback((v: string) => {
onChange(v) onChange(v)
setOpen(false) setOpen(false)
@@ -49,7 +49,7 @@ const ConditionCommonVariableSelector = ({
selected && ( selected && (
<div className='system-xs-medium inline-flex h-6 items-center rounded-md border-[0.5px] border-components-panel-border-subtle bg-components-badge-white-to-dark pl-[5px] pr-1.5 text-text-secondary shadow-xs'> <div className='system-xs-medium inline-flex h-6 items-center rounded-md border-[0.5px] border-components-panel-border-subtle bg-components-badge-white-to-dark pl-[5px] pr-1.5 text-text-secondary shadow-xs'>
<Variable02 className='mr-1 h-3.5 w-3.5 text-text-accent' /> <Variable02 className='mr-1 h-3.5 w-3.5 text-text-accent' />
{selected.name} {selected.value}
</div> </div>
) )
} }
@@ -73,12 +73,12 @@ const ConditionCommonVariableSelector = ({
{ {
variables.map(v => ( variables.map(v => (
<div <div
key={v.name} key={v.value}
className='system-xs-medium flex h-6 cursor-pointer items-center rounded-md px-2 text-text-secondary hover:bg-state-base-hover' className='system-xs-medium flex h-6 cursor-pointer items-center rounded-md px-2 text-text-secondary hover:bg-state-base-hover'
onClick={() => handleChange(v.name)} onClick={() => handleChange(v.value)}
> >
<Variable02 className='mr-1 h-4 w-4 text-text-accent' /> <Variable02 className='mr-1 h-4 w-4 text-text-accent' />
{v.name} {v.value}
</div> </div>
)) ))
} }