nextcloud / forms

📝 Simple form & survey app for Nextcloud
https://apps.nextcloud.com/apps/forms
GNU Affero General Public License v3.0
316 stars 97 forks source link

Use text editor for editing question description #2164

Closed Koc closed 3 months ago

Koc commented 4 months ago

Currently it is hard to write rich question descriptions for non-tech people. Would be nice add UI editor for that. Here some draft of this functionality. If text app isn't installed we fallback to simple textarea like it was before.

https://github.com/nextcloud/forms/assets/191082/3df8edcf-3e7d-483d-aab4-d72966f48724

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 44.89%. Comparing base (0c4be14) to head (2b19e93).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2164 +/- ## ============================================ - Coverage 45.02% 44.89% -0.13% - Complexity 720 725 +5 ============================================ Files 61 62 +1 Lines 2776 2784 +8 ============================================ Hits 1250 1250 - Misses 1526 1534 +8 ```
Koc commented 4 months ago

does anybody know why it is not possible upload attachments into markdown?

here what we hare in current PR image this button does nothing. What do I wrong?

here same editor from Collectives image

Chartman123 commented 4 months ago

does anybody know why it is not possible upload attachments into markdown?

@Koc sorry, I can't help you much with this...

Regarding your questions:

Koc commented 4 months ago

@mejo- any idea? As far I can see you have experience with Collective + Text integration

mejo- commented 4 months ago

@mejo- any idea? As far I can see you have experience with Collective + Text integration

So regarding the attachment support: you'll have to provide your own implementation here, because you use the editor which is not file-based and instead gets the markdown content as a property via the API. The attachments support as you know it from Text and Collectives works because there the editor is file-based and attachments can be uploaded to a related attachments folder.

As far as I know the content-based editor (different than the file-based editor) so far doesn't support adding attachments and images. The deck app has support to upload attachments via the button you referenced, but these attachments don't show up in the text document either, they just get listed as attachments. See here for the implementation.

Regarding the bottom padding of the editor, that's the standard CSS of the editor and it needs to be overwritten. Again see the deck app how it's done there.

Koc commented 4 months ago

I've achieved some progress with styling. You can see it on attached video in PR description. Next goal - make image upload work.

Koc commented 3 months ago

Implementation of the images uploading functionality requires much more effort than I expected :crying_cat_face: . At the same time for me it has no sense to provide UI editor without this functionality (as it was the root cause why I've started work on this task).

We can return to this later