fix: Boolean type control is not displayed (#25031)
Co-authored-by: WTW0313 <twwu@dify.ai>
This commit is contained in:
parent
8eae7a95be
commit
a7627882a7
2 changed files with 5 additions and 5 deletions
|
|
@ -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',
|
||||||
|
|
|
||||||
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue