Skip to content

Conversation

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented Sep 10, 2021

@skjnldsv skjnldsv marked this pull request as draft September 10, 2021 14:32
@skjnldsv skjnldsv force-pushed the feat/front-menu-entry branch from 5115c77 to 05568aa Compare September 14, 2021 15:40
Signed-off-by: John Molakvoæ <[email protected]>
@skjnldsv skjnldsv force-pushed the feat/front-menu-entry branch from 05568aa to 32ae1db Compare September 14, 2021 15:45
@skjnldsv skjnldsv marked this pull request as ready for review September 14, 2021 15:45
Copy link
Member

@julien-nc julien-nc left a comment

Choose a reason for hiding this comment

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

Code looks good. Too bad we can't try it because ExternalShareAction is not allowed inside the Actions component.

One question though: Is the DownloadLimitAction displayed even if the limit is disabled?

@@ -1,3 +1,6 @@
module.exports = {
globals: {
appName: true,
Copy link
Member

Choose a reason for hiding this comment

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

After checking the docs https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1 shouldn't this be set to 'readonly'?

@PVince81
Copy link
Member

  • add README with notes about how to set the counter as I couldn't find it

@PVince81
Copy link
Member

or it's a bug... I'm currently on server master 995aa6518357b9f371ced5ba8941dfd2a02b0d97 and this PR.

I can't see any option to set the download limit:

image

also I didn't find any option in the admin's share settings, in case the admin needs to enable it.

so either it's not working or it's well hidden ?

@PVince81
Copy link
Member

Signed-off-by: John Molakvoæ <[email protected]>
$count = $this->config->getAppValue(Application::APP_ID, 'download_count_' . $token, 0) + 1;
$this->config->setAppValue(Application::APP_ID, 'download_count_' . $token, $count);
// Increment this download event
$downloads = $shareLimit->getDownloads() + 1;
Copy link
Member

Choose a reason for hiding this comment

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

potential concurrency concern, I've raised it #8 as it doesn't look that critical and rather unlikely to be triggered by a regular user

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍 code looks fine to me so far

I was not able to test due to dependencies.
Also see comment + ticket about potential concurrency concern.

@PVince81
Copy link
Member

I guess we shouldn't merge until this actually works after resolving the related PRs

@szaimen
Copy link
Contributor

szaimen commented Sep 15, 2021

I can't see any option to set the download limit:

image

also I didn't find any option in the admin's share settings, in case the admin needs to enable it.

so either it's not working or it's well hidden ?

Same for me.

Tested with
docker run -d \
-e SERVER_BRANCH=feat/ExternalShareActions-API \
-e DOWNLOADLIMIT_BRANCH=feat/front-menu-entry \
-p 8443:443 \
-e TRUSTED_DOMAIN=192.168.178.34 \
--name nextcloud-easy-test \
--user=www-data \
ghcr.io/szaimen/nextcloud-easy-test:latest

@julien-nc
Copy link
Member

julien-nc commented Sep 15, 2021

@PVince81 @szaimen Even if my solution probably won't be used, it allows to test this PR. Just use server's feat/ExternalShareActions-API-bis branch and you'll be able to see the sharing entries.

The current problem with the feat/ExternalShareActions-API branch is that the Actions component refuses to contain something else than Action components (ActionLink, ActionCheckbox etc...). So the ExternalShareAction component is not displayed/rendered inside Actions. You should see an error in the browser logs.

@szaimen
Copy link
Contributor

szaimen commented Sep 15, 2021

Just use server's feat/ExternalShareActions-API-bis branch and you'll be able to see the sharing entries.

Can confirm that it shows up with your branch but that has its own problems... So probably we need to decide first which attempt to use and then test it and fix the issues there...

Add limit message on public page
@skjnldsv
Copy link
Member Author

Signed-off-by: John Molakvoæ <[email protected]>
@skjnldsv skjnldsv merged commit 8e79206 into master Sep 16, 2021
@delete-merged-branch delete-merged-branch bot deleted the feat/front-menu-entry branch September 16, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unshare public link after X explicit downloads

7 participants