feat: Attachment of Files to Documents using S3. - #603
Conversation
tommoor
left a comment
There was a problem hiding this comment.
Apart from the placeholder issue outlined in this review I think really the question is whether a plain text link is good enough – and I'm tempted to say no.
We really want to maintain a semantic link to the fact that it's a file upload within the document structure by creating a file node type that stores the attachmentId etc, this will allow us to do much more interesting things in the future.
cc @thenanyu
| for (const file of files) { | ||
|
|
||
| // Insert a placeholder link | ||
| var placeholder = `[${file.name} uploading...]` |
There was a problem hiding this comment.
This type of placeholder isn't sufficient as the text document can change while the file is uploading – in that case the text will be replaced incorrectly. Instead it should work like the image placeholder with a widget decoration that is then searched for again to find it's current position once the file upload is complete
| // const phref = `#uploading_${file.name}`; | ||
| view.dispatch( | ||
| view.state.tr | ||
| .insertText(placeholder, from, to-1) |
| { | ||
| name: "file", | ||
| title: dictionary.file, | ||
| icon: NotepadIcon, |
There was a problem hiding this comment.
I'd use the DocumentIcon for now, it looks like a file
|
Sorry about interrupt you guys. I really look forward to including this feature. If file upload using just link that I'm wondering that how to remove the file from storage. |
This is an extension of #280 including the original commit there, rebased and extended on current master.
For further details see the original PR.
I've added support for a basic placeholder during upload, added a suitable menu icon and fixed compatibility issues during during rebasing
The matching support in outline server can be found in outline/outline#2859