mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-17 12:35:52 +08:00
fix: update placeholder format and enhance enum value handling in advanced options
This commit is contained in:
parent
11994eac1a
commit
8a4a6720d1
@ -55,7 +55,7 @@ const AdvancedOptions: FC<AdvancedOptionsProps> = ({
|
||||
value={enumValue}
|
||||
onChange={handleEnumChange}
|
||||
onBlur={handleEnumBlur}
|
||||
placeholder={'\'abcd\', 1, 1.5, \'etc\''}
|
||||
placeholder={'abcd, 1, 1.5, etc.'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -144,7 +144,9 @@ const EditCard: FC<EditCardProps> = ({
|
||||
}, [isAdvancedEditing, emitPropertyOptionsChange, currentFields])
|
||||
|
||||
const handleAdvancedOptionsChange = useCallback((options: AdvancedOptionsType) => {
|
||||
const enumValue = options.enum.replace(/\s/g, '').split(',')
|
||||
let enumValue: SchemaEnumType = options.enum.replace(/\s/g, '').split(',')
|
||||
if (currentFields.type === Type.number)
|
||||
enumValue = enumValue.map(value => Number(value)).filter(num => !Number.isNaN(num))
|
||||
setCurrentFields(prev => ({ ...prev, enum: enumValue }))
|
||||
if (isAdvancedEditing) return
|
||||
emitPropertyOptionsChange({ description: currentFields.description, enum: enumValue })
|
||||
|
Loading…
x
Reference in New Issue
Block a user