mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Delete on an attachment used to remove the document and its file at once. It is now the 'attachments.softDelete' method (History.md section 12): the document gets deletedAt/deletedBy/deleteBatchId with the same helpers lists use, the file is kept, and the card's cover is unset if this was it. Every card-facing read - the opened card's gallery and "Attachments (N)" count, the minicard paperclip badge, the slideshow, the cover, the board-background picker, My Attachments, the API list endpoints and the exporters - filters to live attachments with liveAttachments(); the publications keep sending the deleted ones so the card history can reach them. The card history records who deleted it and when, with the filename in the row. Restore - the table's selection + Restore, or the row's own Restore button, both through changeHistory.restore and applyAttachmentContent - clears the mark, so the card, its count and the minicard badge include the attachment again; the cover is never re-set. An attachment row previews with the existing attachmentViewer slideshow and downloads with the same link the gallery draws, and never offers cover or background. Uploads and renames are recorded through the existing history hooks. There is no per-attachment hard delete any more: api.attachment.delete, DELETE /api/attachment/delete/:id and removeBoardBackground soft-delete, permanentlyDeleteAttachmentFromFilesReport and the Files report's delete button are gone, Attachments.allow remove and onBeforeRemove refuse every client remove and log the attempt under Admin Panel / Problems. The one hard delete is Admin Panel / Problems / Delete enabled, board archived, board deleted from the archive: boardRemover now removes every attachment of the board, live and soft-deleted, with its file. One new i18n key, attachment-soft-delete-pop, replaces the "permanent, no undo" confirmation text; it is inserted in English into every locale at the same position for translation. Thanks to xet7 !