fix: Boolean type control is not displayed (#25031)

Co-authored-by: WTW0313 <twwu@dify.ai>
This commit is contained in:
17hz 2025-09-03 15:39:09 +08:00 • committed by GitHub
commit a7627882a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -14,7 +14,7 @@ export enum FormTypeEnum {
secretInput = 'secret-input', secretInput = 'secret-input',
select = 'select', select = 'select',
radio = 'radio', radio = 'radio',
boolean = 'boolean', boolean = 'checkbox',
files = 'files', files = 'files',
file = 'file', file = 'file',
modelSelector = 'model-selector', modelSelector = 'model-selector',

View file

@ -90,8 +90,8 @@ const FormInputItem: FC<Props> = ({
// return VarType.appSelector // return VarType.appSelector
// else if (isModelSelector) // else if (isModelSelector)
// return VarType.modelSelector // return VarType.modelSelector
// else if (isBoolean) else if (isBoolean)
// return VarType.boolean return VarType.boolean
else if (isObject) else if (isObject)
return VarType.object return VarType.object
else if (isArray) else if (isArray)
@ -183,7 +183,7 @@ const FormInputItem: FC<Props> = ({
return ( return (
<div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}> <div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}>
{showTypeSwitch && ( {showTypeSwitch && (
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange}/> <FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange} />
)} )}
{isString && ( {isString && (
<MixedVariableTextInput <MixedVariableTextInput
@ -203,7 +203,7 @@ const FormInputItem: FC<Props> = ({
placeholder={placeholder?.[language] || placeholder?.en_US} placeholder={placeholder?.[language] || placeholder?.en_US}
/> />
)} )}
{isBoolean && ( {isBoolean && isConstant && (
<FormInputBoolean <FormInputBoolean
value={varInput?.value as boolean} value={varInput?.value as boolean}
onChange={handleValueChange} onChange={handleValueChange}