mirror of https://github.com/langgenius/dify.git
refactor(form-input-item): enhance type switch logic to include select input handling
This commit is contained in:
parent
313069a63e
commit
ebeb17ec96
|
|
@ -68,7 +68,7 @@ const FormInputItem: FC<Props> = ({
|
|||
const isSelect = type === FormTypeEnum.select || type === FormTypeEnum.dynamicSelect
|
||||
const isAppSelector = type === FormTypeEnum.appSelector
|
||||
const isModelSelector = type === FormTypeEnum.modelSelector
|
||||
const showTypeSwitch = isNumber || isBoolean || isObject || isArray
|
||||
const showTypeSwitch = isNumber || isBoolean || isObject || isArray || isSelect
|
||||
const isConstant = varInput?.type === VarKindType.constant || !varInput?.type
|
||||
const showVariableSelector = isFile || varInput?.type === VarKindType.variable
|
||||
|
||||
|
|
@ -88,8 +88,8 @@ const FormInputItem: FC<Props> = ({
|
|||
return VarType.arrayFile
|
||||
else if (type === FormTypeEnum.file)
|
||||
return VarType.file
|
||||
// else if (isSelect)
|
||||
// return VarType.select
|
||||
else if (isSelect)
|
||||
return VarType.string
|
||||
// else if (isAppSelector)
|
||||
// return VarType.appSelector
|
||||
// else if (isModelSelector)
|
||||
|
|
@ -215,7 +215,7 @@ const FormInputItem: FC<Props> = ({
|
|||
onChange={handleValueChange}
|
||||
/>
|
||||
)}
|
||||
{isSelect && (
|
||||
{isSelect && isConstant && (
|
||||
<SimpleSelect
|
||||
wrapperClassName='h-8 grow'
|
||||
disabled={readOnly}
|
||||
|
|
|
|||
Loading…
Reference in New Issue