Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File attachments for cards #488

Merged
merged 35 commits into from
Jun 20, 2018
Merged

File attachments for cards #488

merged 35 commits into from
Jun 20, 2018

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Jun 11, 2018

This PR implements uploading file attachments to cards. The files are stored in AppData and can be downloaded by every user with read access to the board.

Screenshots

List of attachments

image

Dragging files to the board

bildschirmfoto vom 2018-06-14 11-34-29

Insert attachments into description

image

ToDo

  • Backend
  • Frontend
    • File listing in card details
    • Use mime type icons
    • File deletion
    • Upload using a button
    • Add drop-zone to the card details view
    • Improve storing data in CardService
    • Filename collision handling
    • Move file list to tabbed view
    • Add drop-zone for upload to the board view
    • Add indicator about file attachments to board view
    • Insert attachment into card description
  • Unit tests
    • Adjust Entity tests
    • DeleteCron
    • AttachmentMapper
    • AttachmentService
    • FileService
    • AttachmentController

@codecov
Copy link

codecov bot commented Jun 12, 2018

Codecov Report

Merging #488 into master will increase coverage by 3.5%.
The diff coverage is 95.89%.

@@            Coverage Diff            @@
##           master     #488     +/-   ##
=========================================
+ Coverage   76.85%   80.36%   +3.5%     
=========================================
  Files          38       44      +6     
  Lines        1175     1441    +266     
=========================================
+ Hits          903     1158    +255     
- Misses        272      283     +11

@juliusknorr juliusknorr mentioned this pull request Jun 13, 2018
1 task
@juliusknorr juliusknorr force-pushed the feature/109/file-attachments branch 5 times, most recently from 62e3cb7 to 5d62ce2 Compare June 18, 2018 08:29
@juliusknorr
Copy link
Member Author

juliusknorr commented Jun 18, 2018

@nextcloud/designers Some feedback on the UI would be great. I've updated the screenshots above with the current state.

cc @nextcloud/deck for review/testing

@jancborchardt
Copy link
Member

Oh wow, that seems really nice! :) Have only small pieces of feedback:

  • A bit more vertical whitespace between the rows of the attachments, both in the sidebar and in the popup
  • Will file thumbnails be shown?
  • Instead of tabbed interface, why not show the attachments directly below the description?
  • Also, then we could simply show them bigger, not only as a thumbnail

@juliusknorr
Copy link
Member Author

A bit more vertical whitespace between the rows of the attachments, both in the sidebar and in the popup

👍

Will file thumbnails be shown?

This is out of scope for now, since previews are not available for files stored in the AppData. I've discussed some possible implementation ideas with @rullzer but this is something for later.

Instead of tabbed interface, why not show the attachments directly below the description?

I had that in the beginning, but in most cases, the description will contain the most important content of the card and links to attachments/images can also be embedded there, in case users want direct access to it. Also for mobile devices it makes sense to limit the amount of shown information to the description while providing a list of attachments in a separate tab. Otherwise we'll quickly end up with the notification being not visible since it has moved down outside of the visible area.

Also, then we could simply show them bigger, not only as a thumbnail

@jancborchardt What do you mean by displaying them bigger?

As for the embedding of attachments into the description, this is how it looks like for images/regular files:

Markdown

image

Rendering

image

…load

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@jancborchardt
Copy link
Member

Yeah, so the thing is that simply displaying the images below the description is much simpler. No one needs to manually embed stuff then.

With them showing bigger, I basically mean how they are shown when embedded. Maybe we can limit the height a bit when there's many attachments though.

Otherwise we'll quickly end up with the notification being not visible since it has moved down outside of the visible area.

What do you mean by that? No important stuff should be displayed below the images.

@juliusknorr
Copy link
Member Author

Yeah, so the thing is that simply displaying the images below the description is much simpler. No one needs to manually embed stuff then.

I'd say it should be up to the user which images are shown directly and wich are not that important. Also the attachments might in a lot of cases have some relation to sections of the description, so I think embedding is a better way then just listing them.

With them showing bigger, I basically mean how they are shown when embedded. Maybe we can limit the height a bit when there's many attachments though.

Good point. Width is limited, but i'll also add a limit for the height.

Otherwise we'll quickly end up with the notification being not visible since it has moved down outside of the visible area.

What do you mean by that? No important stuff should be displayed below the images.

I mean description not notification 🙈

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliusknorr
Copy link
Member Author

Height limit for image and additional spacing is added. Let's merge this and iterate over it for further adjustments 😉

@juliusknorr juliusknorr merged commit c938fdd into master Jun 20, 2018
@juliusknorr juliusknorr deleted the feature/109/file-attachments branch June 20, 2018 06:35
@pixelipo
Copy link
Contributor

Awesome work @juliushaertl !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants