diff --git a/web/src/components/file-uploader.tsx b/web/src/components/file-uploader.tsx index 0f6318e25..2cf3bcfc6 100644 --- a/web/src/components/file-uploader.tsx +++ b/web/src/components/file-uploader.tsx @@ -158,6 +158,14 @@ interface FileUploaderProps extends Omit< hideDropzoneOnMaxFileCount?: boolean; + /** + * Whether the folder tab should be shown in the uploader. + * @type boolean + * @default true + * @example showFolderTab={false} + */ + showFolderTab?: boolean; + /** * Whether the uploader should accept multiple files. * @type boolean @@ -192,6 +200,7 @@ export function FileUploader(props: FileUploaderProps) { multiple = false, disabled = false, hideDropzoneOnMaxFileCount = false, + showFolderTab = true, className, title, description, @@ -387,28 +396,32 @@ export function FileUploader(props: FileUploaderProps) { {t('fileManager.files', 'Files')} - - - {t('fileManager.folder', 'Folder')} - + {showFolderTab && ( + + + {t('fileManager.folder', 'Folder')} + + )} {renderDropzone(false)} - - {renderDropzone(true)} - - + {showFolderTab && ( + + {renderDropzone(true)} + + + )} )} diff --git a/web/src/pages/agents/upload-agent-dialog/upload-agent-form.tsx b/web/src/pages/agents/upload-agent-dialog/upload-agent-form.tsx index 48a54616d..ebbbe0c76 100644 --- a/web/src/pages/agents/upload-agent-dialog/upload-agent-form.tsx +++ b/web/src/pages/agents/upload-agent-dialog/upload-agent-form.tsx @@ -58,6 +58,7 @@ export function UploadAgentForm({ hideModal, onOk }: IModalProps) { value={field.value} onValueChange={field.onChange} maxFileCount={1} + showFolderTab={false} accept={{ '*.json': [FileMimeType.Json] }} />