Skip to content

Conversation

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Apr 8, 2022

  • Reset the counter when setting a new limit
  • Display a message and hide the button when limit is reached and share disabled
    Capture d’écran_2022-04-08_15-29-47
  • Display a warning when clicking the download button more than once
    image
  • Prevent mouse events on shared images
  • Adding loading state
    Peek 12-04-2022 10-26

Fix #43
Fix #8

cc @TSI-yogeshshejwadkar

@skjnldsv skjnldsv requested review from a team, PVince81, szaimen and vanpertsch and removed request for a team April 8, 2022 13:51
@skjnldsv skjnldsv self-assigned this Apr 8, 2022
@skjnldsv skjnldsv added enhancement New feature or request 3. to review Waiting for reviews labels Apr 8, 2022
@szaimen
Copy link
Contributor

szaimen commented Apr 8, 2022

@skjnldsv Maybe it would make sense to prevent all right-click options when the counter is at null?
See nextcloud/server#31372 as inspiration

@skjnldsv
Copy link
Member Author

skjnldsv commented Apr 8, 2022

@skjnldsv Maybe it would make sense to prevent all right-click options when the counter is at null? See nextcloud/server#31372 as inspiration

I would even do that even if the counter is not null as there is the download button already.
Thanks for the idea! 👍

@szaimen
Copy link
Contributor

szaimen commented Apr 8, 2022

I would even do that even if the counter is not null as there is the download button already.
Thanks for the idea! 👍

sounds good! you are welcome :)

Signed-off-by: John Molakvoæ <[email protected]>
@skjnldsv
Copy link
Member Author

skjnldsv commented Apr 8, 2022

Done, please review 🙏

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

apart from that looks good to me but didn't test it

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

Testing reveals that saving the limit does not close the popup which feels strange:
image


Also Using this button does not update the download count on top of the page automatically:
image

@szaimen

This comment was marked as resolved.

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

another thing: when reaching the download limit, the download button on the bottom should probably removed as well:
image

@skjnldsv
Copy link
Member Author

skjnldsv commented Apr 12, 2022

Testing reveals that saving the limit does not close the popup which feels strange:
image

Same for all the other options i the sharing menu, this would have to be in https://github.com/nextcloud/server/blob/da435b1e67930e85fc30fd1b94c6214caa086f4f/apps/files_sharing/src/components/SharingEntryLink.vue#L128-L132

@skjnldsv skjnldsv requested a review from szaimen April 12, 2022 08:24
@skjnldsv
Copy link
Member Author

All other issues addressed, please review @szaimen :)

@szaimen
Copy link
Contributor

szaimen commented Apr 12, 2022

All other issues addressed, please review @szaimen :)

on it

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

async saving is already a bit better than no saving feedback.
But this leads to a problem when deleting the already set value:
image

@szaimen
Copy link
Contributor

szaimen commented Apr 12, 2022

I can confirm that all other issues are fixed :)

@skjnldsv
Copy link
Member Author

But this leads to a problem when deleting the already set value:

Will be fixed in followup then, to support null and 0 values (see #69, wwhich I will re-adapt)

@szaimen
Copy link
Contributor

szaimen commented Apr 12, 2022

Will be fixed in followup then, to support null and 0 values (see #69, wwhich I will re-adapt)

okay

Copy link
Contributor

@szaimen szaimen left a comment

Choose a reason for hiding this comment

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

good to go from my side then :)

@skjnldsv skjnldsv merged commit ae1b76a into master Apr 12, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/public-handling branch April 12, 2022 08:56
@skjnldsv
Copy link
Member Author

But this leads to a problem when deleting the already set value:

Will be fixed in followup then, to support null and 0 values (see #69, wwhich I will re-adapt)

#82

let count = limit - downloads
let clicks = 0

const updateCounter = function(span) {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing count parameter no?


span.style = 'color: var(--color-primary-text); padding: 0 10px;'
span.innerText = n('files_downloadlimit', '1 remaining download allowed', '{count} remaining downloads allowed', count, { count })
updateCounter(span, count)
Copy link
Contributor

Choose a reason for hiding this comment

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

or extra count parameter here, not clear, it seems count is actually global

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's cleaner, you're right, let me fix in a pr :)

Copy link
Member Author

Choose a reason for hiding this comment

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

#83

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

Labels

3. to review Waiting for reviews enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Counter is not working while clicking on download button Clicking download fast might give extra downloads

5 participants