diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
index 7e5aa44ba..af8cd7d80 100644
--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx
@@ -137,6 +137,12 @@ export const AttachmentList = ({
await uploadAttachmentFile(file, targetableObject);
};
+ const onUploadFiles = async (files: File[]) => {
+ for (const file of files) {
+ await onUploadFile(file);
+ }
+ };
+
const handlePreview = (attachment: Attachment) => {
if (!isAttachmentPreviewEnabled) return;
setPreviewedAttachment(attachment);
@@ -167,7 +173,7 @@ export const AttachmentList = ({
{isDraggingFile ? (
) : (
diff --git a/packages/twenty-front/src/modules/activities/files/components/Attachments.tsx b/packages/twenty-front/src/modules/activities/files/components/Attachments.tsx
index 78c305ee3..67776ae26 100644
--- a/packages/twenty-front/src/modules/activities/files/components/Attachments.tsx
+++ b/packages/twenty-front/src/modules/activities/files/components/Attachments.tsx
@@ -48,18 +48,26 @@ export const Attachments = ({
const [isDraggingFile, setIsDraggingFile] = useState(false);
+ const onUploadFile = async (file: File) => {
+ await uploadAttachmentFile(file, targetableObject);
+ };
+
+ const onUploadFiles = async (files: File[]) => {
+ for (const file of files) {
+ await onUploadFile(file);
+ }
+ };
+
const handleFileChange = (e: ChangeEvent) => {
- if (isDefined(e.target.files)) onUploadFile?.(e.target.files[0]);
+ if (isDefined(e.target.files)) {
+ onUploadFiles(Array.from(e.target.files));
+ }
};
const handleUploadFileClick = () => {
inputFileRef?.current?.click?.();
};
- const onUploadFile = async (file: File) => {
- await uploadAttachmentFile(file, targetableObject);
- };
-
const isAttachmentsEmpty = !attachments || attachments.length === 0;
const { objectMetadataItem } = useObjectMetadataItem({
@@ -82,7 +90,7 @@ export const Attachments = ({
{isDraggingFile ? (
) : (
{hasObjectUpdatePermissions && (
void;
- onUploadFile: (file: File) => void;
+ onUploadFiles: (files: File[]) => void;
};
export const DropZone = ({
setIsDraggingFile,
- onUploadFile,
+ onUploadFiles,
}: DropZoneProps) => {
const theme = useTheme();
const { maxFileSize } = useSpreadsheetImportInternal();
@@ -53,7 +53,7 @@ export const DropZone = ({
const { getRootProps, getInputProps, isDragActive } = useDropzone({
noClick: true,
noKeyboard: true,
- maxFiles: 1,
+ multiple: true,
maxSize: maxFileSize,
onDragEnter: () => {
setIsDraggingFile(true);
@@ -64,8 +64,8 @@ export const DropZone = ({
onDrop: () => {
setIsDraggingFile(false);
},
- onDropAccepted: async ([file]) => {
- onUploadFile(file);
+ onDropAccepted: async (files) => {
+ onUploadFiles(files);
setIsDraggingFile(false);
},
});
@@ -85,7 +85,7 @@ export const DropZone = ({
stroke={theme.icon.stroke.sm}
size={theme.icon.size.lg}
/>
- Upload a file
+ Upload files
Drag and Drop Here
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/AIChatTab.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/AIChatTab.tsx
index ca3d5aac4..398f4a57e 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/AIChatTab.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/AIChatTab.tsx
@@ -85,7 +85,7 @@ export const AIChatTab = ({
{isDraggingFile && (
uploadFiles([files])}
+ onUploadFiles={uploadFiles}
/>
)}
{!isDraggingFile && (