Step 7 - attachments, covers, and file drop
1 min czytania
Add attachments. Storage path convention: workspaces/{workspaceId}/kanban-{projectId}/{randomId}.{ext}. In the task panel: a multi-file picker, drag-and-drop onto the panel, and Ctrl/Cmd+V pasting a screenshot from the clipboard. Store attachments on the task as {url, path, name}[]. Images: thumbnail strip, click opens a simple lightbox, a "Set as cover" action (the cover image renders on the card face; default cover = last image attached), and remove. When the panel is cancelled, delete any uploads that were made but not saved (orphan cleanup); when an attachment is removed and saved, delete the Storage object.
On the board itself: dropping files onto a card attaches them (show a drop highlight and an uploading state), and dropping a file onto a column's "Add card" button creates a new card named after the file with the file attached. Gotcha: distinguish native file drags from CDK card drags by checking dataTransfer.types includes 'Files' before showing drop hints. Card face shows a paperclip chip with the attachment count.
Dyskusja
Komentarze: 0Brak komentarzy. Rozpocznij dyskusję.