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

Adjust saving annotations in public pages to changes in Nextcloud 31 #1149

Conversation

danxuliu
Copy link
Member

In Nextcloud 31 the sharingToken element that was used to know the token of the share was removed and replaced with data provided by the initial state API. However, rather than directly getting the value using the initial state API, the token is now got using the @nextcloud/sharing library, which is expected to handle any future change.

How to test (scenario 1)

  • Open the Files app
  • Upload a PDF file
  • Share the PDF file with a public link
  • Customize the share and add edit permissions
  • In a private window, open the link
  • Add an annotation
  • Save the file

Expected result

The file is saved

Actual result

The browser shows an authentication dialog

How to test (scenario 2)

  • Open the Files app
  • Create a new folder
  • Share the folder with a public link
  • Customize the share and add create, edit and delete permissions (for some reason that I have not been able to figure out yet sometimes edit permissions are not enough (and sometimes are... I wasted a lot of time with this 😅); however this is unrelated to the changes here, as it could be reproduced already in Nextcloud 28 and seems to be a behaviour from server, not the PDF viewer)
  • Enter in the folder
  • Upload a PDF file
  • In a private window, open the link
  • Open the PDF file
  • Add an annotation
  • Save the file

Expected result

The file is saved

Actual result

The browser shows an authentication dialog

@nextcloud/sharing  was already an implicit dependency, but now it is
made explicit to use the functions it provides in the PDF viewer code.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
In Nextcloud 31 the "sharingToken" element that was used to know the
token of the share was removed and replaced with data provided by the
initial state API. However, rather than directly getting the value using
the initial state API, the token is now got using the @nextcloud/sharing
library, which is expected to handle any future change.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@danxuliu danxuliu force-pushed the adjust-saving-annotations-in-public-pages-to-changes-in-nextcloud-31 branch from abc16d0 to 673f4a3 Compare February 20, 2025 08:51
@danxuliu
Copy link
Member Author

/compile /

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu danxuliu merged commit 2d7978e into master Feb 20, 2025
36 checks passed
@AndyScherzinger AndyScherzinger deleted the adjust-saving-annotations-in-public-pages-to-changes-in-nextcloud-31 branch February 20, 2025 09:22
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