feat: implement media cleanup on entity deletion and enhance Dropzone logging

Added functionality to clean up media files associated with entities upon deletion, ensuring proper resource management. Enhanced logging in the Dropzone component to provide better feedback on file type validation and user interactions, improving overall user experience.
This commit is contained in:
dswbx
2025-09-29 16:47:44 +02:00
parent d1ba638cd5
commit 5e71fc8947
3 changed files with 33 additions and 2 deletions

View File

@@ -173,9 +173,14 @@ export function Dropzone({
return specs.every((spec) => {
if (spec.kind !== "file") {
console.log("not a file", spec.kind);
return false;
}
return !(allowedMimeTypes && !allowedMimeTypes.includes(spec.type));
if (allowedMimeTypes && allowedMimeTypes.length > 0) {
console.log("not allowed mimetype", spec.type);
return allowedMimeTypes.includes(spec.type);
}
return true;
});
}
@@ -432,6 +437,7 @@ export function Dropzone({
type: "file",
multiple: !maxItems || maxItems > 1,
onChange: handleFileInputChange,
accept: allowedMimeTypes?.join(","),
},
showPlaceholder,
actions: {

View File

@@ -67,7 +67,7 @@ export const DropzoneInner = ({
)}
>
<div className="hidden">
<input {...inputProps} accept={allowedMimeTypes?.join(",")} />
<input {...inputProps} />
</div>
<div className="flex flex-1 flex-col">
<div className="flex flex-row flex-wrap gap-2 md:gap-3">