fix: update formData construction in convertToInputFieldFormData for improved handling of optional fields

fix: adjust z-index value in DialogWrapper for proper stacking context
This commit is contained in:
twwu 2025-06-13 18:32:36 +08:00
parent 55906c8375
commit 6622ce6ad8
2 changed files with 20 additions and 9 deletions

View File

@ -25,23 +25,34 @@ export const convertToInputFieldFormData = (data?: InputVar): FormData => {
allowed_file_extensions,
} = data || getNewInputVarInRagPipeline()
return {
const formData: FormData = {
type,
label,
variable,
maxLength: max_length,
default: default_value,
required,
tooltips,
options,
placeholder,
unit,
allowedFileUploadMethods: allowed_file_upload_methods,
allowedTypesAndExtensions: {
allowedTypesAndExtensions: {},
}
if (default_value !== undefined && default_value !== null)
formData.default = default_value
if (tooltips !== undefined && tooltips !== null)
formData.tooltips = tooltips
if (placeholder !== undefined && placeholder !== null)
formData.placeholder = placeholder
if (unit !== undefined && unit !== null)
formData.unit = unit
if (allowed_file_upload_methods)
formData.allowedFileUploadMethods = allowed_file_upload_methods
if (allowed_file_types && allowed_file_extensions) {
formData.allowedTypesAndExtensions = {
allowedFileTypes: allowed_file_types,
allowedFileExtensions: allowed_file_extensions,
},
}
}
return formData
}
export const convertFormDataToINputField = (data: FormData): InputVar => {

View File

@ -21,7 +21,7 @@ const DialogWrapper = ({
const close = useCallback(() => onClose?.(), [onClose])
return (
<Transition appear show={show} as={Fragment}>
<Dialog as='div' className='relative z-40' onClose={close}>
<Dialog as='div' className='relative z-[1000001]' onClose={close}>
<TransitionChild>
<div className={cn(
'fixed inset-0 bg-black/25',