Skip to content

Conversation

@fflorent
Copy link
Contributor

The need

As a user, when I preview a file, I would like to download it easily with few clicks.

Rationales

If a file is easily downloadable from the files action popup:
image

a user not used to Nextcloud may click on a file in order to download it and wouldn't discover this menu.

Hopefully there is an action menu in the top-right corner and I propose to add a download button there:
image

Technical considerations

I just add a button… Still it opens few questions to me :) :

  • my mother tongue is French, do you expect me to add a translation for this button or are there other localization tools for that?
  • I saw there is the OCA.Files.Files.handleDownload method, but it requires a callback I don't need. Also I am not sure of its benefits here compared to a simple location.href = '…' for this case. Seems like it cookies are used, it's for knowing when the download starts.
  • I could not make cypress run, but it seems it is already broken in the CI, I may attempt a fix later although I will need a bit of time :)
  • Still I am not sure how to test my code with cypress: will there be a download dialog? And how to test the content of the downloaded file with cypress?

Cheers!

@skjnldsv skjnldsv added 2. developing Work in progress enhancement New feature or request labels Nov 22, 2020
@skjnldsv skjnldsv linked an issue Nov 22, 2020 that may be closed by this pull request
Signed-off-by: Florent Fayolle <[email protected]>
@fflorent fflorent force-pushed the add-download-button branch from 2983947 to 95a1ed7 Compare December 3, 2020 20:46
Copy link
Member

@skjnldsv skjnldsv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting close.
Still a few comments :)

Comment on lines +60 to +65
<ActionButton
icon="icon-download"
:close-after-click="true"
@click="onDownload">
{{ t('viewer', 'Download') }}
</ActionButton>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an ActionLink

* @param {object} fileInfo The fileInfo
* @returns {string}
*/
function genDavPath(fileInfo) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More suitable: getDavPath

Suggested change
function genDavPath(fileInfo) {
function getDavPath(fileInfo) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please keep the same function declaration format

Suggested change
function genDavPath(fileInfo) {
const getDavPath = function(fileInfo) {

@jospoortvliet

This comment has been minimized.

@skjnldsv
Copy link
Member

skjnldsv commented Jan 7, 2021

Hey @fflorent, do you have any news? Do you need anything? :)
Feel free to ask! 🚀

@ChildLearningClub
Copy link

ChildLearningClub commented Mar 11, 2021

One click download button would be ideal I believe. On mobile even gallery view is to small to really see the photo well and with many photos a two click action menu might be cumbersome... As illustrated:
nextcloud/spreed#4614 (comment)
Or similarly Unsplash implementation would be the best option. I personally would even put it in place of the play button which I would only use if creating a digital picture frame.

I don’t know what it would take to implement on mobile, but swipe gestures would be really great. swipe down to download to mobile device, swipe up to save it to your Nextcloud or go to where you have it saved.

If I could code I would even add customizable swipe to make the whole planet happy.

beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 13, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702
@beardhatcode beardhatcode mentioned this pull request Mar 13, 2021
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 13, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 13, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
@beardhatcode
Copy link
Contributor

I addressed the comments in #814

@skjnldsv
Copy link
Member

See #814

@skjnldsv skjnldsv closed this Mar 25, 2021
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 25, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 25, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 27, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 27, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 27, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 30, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 30, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 31, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
beardhatcode added a commit to beardhatcode/viewer that referenced this pull request Mar 31, 2021
This addition is work of @fflorent , I finished his work from nextcloud#702

Signed-off-by: Robbert Gurdeep Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: Download button missing for logged in users

5 participants