From f338b51afd41ed0c56d7ec3467eaa9c7992cb8c3 Mon Sep 17 00:00:00 2001 From: jZonG Date: Thu, 29 May 2025 16:27:36 +0800 Subject: [PATCH] file value --- .../file-uploader-in-attachment/index.tsx | 16 +++++++++++----- .../workflow/variable-inspect/value-content.tsx | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/web/app/components/base/file-uploader/file-uploader-in-attachment/index.tsx b/web/app/components/base/file-uploader/file-uploader-in-attachment/index.tsx index ab4e2aaa42..02bb3ad673 100644 --- a/web/app/components/base/file-uploader/file-uploader-in-attachment/index.tsx +++ b/web/app/components/base/file-uploader/file-uploader-in-attachment/index.tsx @@ -26,9 +26,11 @@ type Option = { icon: React.JSX.Element } type FileUploaderInAttachmentProps = { + isDisabled?: boolean fileConfig: FileUpload } const FileUploaderInAttachment = ({ + isDisabled, fileConfig, }: FileUploaderInAttachmentProps) => { const { t } = useTranslation() @@ -89,16 +91,18 @@ const FileUploaderInAttachment = ({ return (
-
- {options.map(renderOption)} -
+ {!isDisabled && ( +
+ {options.map(renderOption)} +
+ )}
{ files.map(file => ( handleRemoveFile(file.id)} onReUpload={() => handleReUploadFile(file.id)} @@ -114,18 +118,20 @@ type FileUploaderInAttachmentWrapperProps = { value?: FileEntity[] onChange: (files: FileEntity[]) => void fileConfig: FileUpload + isDisabled?: boolean } const FileUploaderInAttachmentWrapper = ({ value, onChange, fileConfig, + isDisabled, }: FileUploaderInAttachmentWrapperProps) => { return ( - + ) } diff --git a/web/app/components/workflow/variable-inspect/value-content.tsx b/web/app/components/workflow/variable-inspect/value-content.tsx index a70c318c35..3987d348c4 100644 --- a/web/app/components/workflow/variable-inspect/value-content.tsx +++ b/web/app/components/workflow/variable-inspect/value-content.tsx @@ -207,6 +207,7 @@ const ValueContent = ({ number_limits: currentVar.value_type === 'file' ? 1 : (fileFeature as any).fileUploadConfig?.workflow_file_upload_limit || 5, fileUploadConfig: (fileFeature as any).fileUploadConfig, }} + isDisabled={textEditorDisabled} />
)}