fix: list operator bool not show the bool input

This commit is contained in:
Joel 2025-07-28 11:20:22 +08:00
parent 7bfdfe73c2
commit ea2a1b203c
2 changed files with 10 additions and 3 deletions

View File

@ -11,6 +11,7 @@ import SubVariablePicker from './sub-variable-picker'
import Input from '@/app/components/base/input'
import { FILE_TYPE_OPTIONS, TRANSFER_METHOD } from '@/app/components/workflow/nodes/constants'
import { SimpleSelect as Select } from '@/app/components/base/select'
import BoolValue from '../../../panel/chat-variable-panel/components/bool-value'
const optionNameI18NPrefix = 'workflow.nodes.ifElse.optionName'
type Props = {
@ -96,14 +97,20 @@ const FilterCondition: FC<Props> = ({
placeholder='Select value'
/>
)}
{!isSelect && (
{!isSelect && varType !== VarType.boolean && (
<Input
type={((hasSubVariable && condition.key === 'size') || (!hasSubVariable && varType === VarType.number)) ? 'number' : 'text'}
className='grow'
value={condition.value}
value={condition.value as string}
onChange={e => handleChange('value')(e.target.value)}
/>
)}
{!isSelect && varType === VarType.boolean && (
<BoolValue
value={condition.value as boolean}
onChange={handleChange('value')}
/>
)}
</>
)}
</div>

View File

@ -14,7 +14,7 @@ export type Limit = {
export type Condition = {
key: string
comparison_operator: ComparisonOperator
value: string | number | string[]
value: string | number | boolean | string[]
}
export type ListFilterNodeType = CommonNodeType & {