plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Attach file not working correctly on research notes

Open Zengirl2 opened this issue 9 years ago • 9 comments

If I attach the file, it shows up in edit as code, but the file does not appear when published. The code shows publiclab/photos, and I think that may be the problem, as I'm not uploading a photo but a word doc.

Relevant URLs

https://publiclab.org/notes/Zengirl2/08-01-2017/how-cafos-factory-farms-are-plaguing-north-carolina-communities-of-color#c17140

PublicLab.org username

@zengirl2 (to help reproduce the issue)

Browser, version, and operating system

Chrome on Windows 8.1

For bug reports, fill out the above template; for feature requests, you can delete the template.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

Zengirl2 avatar Aug 02 '17 15:08 Zengirl2

OK I have a fix! The legacy editor does it correctly, so someone just needs to compare that code to the Rich editor to repair it.

Zengirl2 avatar Aug 02 '17 15:08 Zengirl2

Thank you so much for documenting this. The Rich Editor uses the woofmark rich text library, and I see that (when i drag in a PDF) it generates the markdown:

  [attachment-1]: /system/images/photos/000/000/001/original/Thumbnail_Agenda_Draft_June_29.pdf "Thumbnail_Agenda_Draft_June_29.pdf"

But there's no equivalent way to display that in the "Rich" mode, and upon switching it just disappears. We ought to display a "file" icon and the filename.

Looking through woofmark documentation.

jywarren avatar Aug 07 '17 15:08 jywarren

OK, these lines generate the attachment markdown syntax:

https://github.com/bevacqua/woofmark/blob/master/src/markdown/linkOrImageOrAttachment.js#L122-L125

I am guessing that we could add a method to parse that into HTML and back, and it would preserve the upload properly. I'll try this.

jywarren avatar Aug 07 '17 15:08 jywarren

I think I've got this! #1574... fingers X.

jywarren avatar Aug 09 '17 01:08 jywarren

Still working on this one. Got stuck on publishing to the live site but should have an update on this in a day or two, thanks for your patience!

jywarren avatar Aug 10 '17 01:08 jywarren

Now waiting on https://github.com/publiclab/PublicLab.Editor/issues/103 -- some issue intervened and blocked this for a bit... thanks for your patience!

jywarren avatar Aug 10 '17 15:08 jywarren

Cool--if it doesn't work we can always use the older editor.

Zengirl2 avatar Sep 17 '17 19:09 Zengirl2

I believe this is fixed, if you can try it out!

On Sep 17, 2017 3:21 PM, "Leslie Birch" [email protected] wrote:

Cool--if it doesn't work we can always use the older editor.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/1561#issuecomment-330076093, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ6jSiUe8FOdPKN4qX5655zCnyTV7ks5sjXEhgaJpZM4OrRVn .

jywarren avatar Sep 17 '17 19:09 jywarren

OK, I tried it by creating a test note, which I can delete later. Issues:

  • You need floating text or paperclip icon so people know that you can add docs (right now it only talks about adding images). You could consider copying the text line that appears in the "comments" block. "Drag & drop to add an image or file, or choose one"

  • Right now if you drag a doc into the main block (like a PDF), it appears as text, but it is not obvious that it is a file unless you hover over it. I couldn't just click on it to open. I had to do a right click to open in a new tab.

Zengirl2 avatar Sep 18 '17 01:09 Zengirl2