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

[stable31] Adjust saving annotations in public pages to changes in Nextcloud 31 #1150

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/files_pdfviewer-main.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions js/files_pdfviewer-main.js.license
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/event-bus
- version: 3.3.1
- license: GPL-3.0-or-later
- @nextcloud/initial-state
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- license: GPL-3.0-or-later
Expand All @@ -53,6 +56,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/router
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue
- version: 8.23.1
- license: AGPL-3.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion js/files_pdfviewer-main.js.map

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/event-bus
- version: 3.3.1
- license: GPL-3.0-or-later
- @nextcloud/initial-state
- version: 2.2.0
- license: GPL-3.0-or-later
- @nextcloud/l10n
- version: 3.2.0
- license: GPL-3.0-or-later
Expand All @@ -85,6 +88,9 @@ This file is generated from multiple sources. Included packages:
- @nextcloud/router
- version: 3.0.1
- license: GPL-3.0-or-later
- @nextcloud/sharing
- version: 0.2.4
- license: GPL-3.0-or-later
- @nextcloud/vue-select
- version: 3.25.1
- license: MIT
Expand Down

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@nextcloud/l10n": "^3.1.0",
"@nextcloud/logger": "^3.0.2",
"@nextcloud/router": "^3.0.1",
"@nextcloud/sharing": "^0.2.4",
"pdfjs-dist": "^4.0.189"
},
"browserslist": [
Expand Down
7 changes: 4 additions & 3 deletions src/services/uploadPdfFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import { getRequestToken } from '@nextcloud/auth'
import axios from '@nextcloud/axios'

import { getRootPath, getToken } from '../utils/davUtils.js'
import { getRootPath } from '../utils/davUtils.js'
import { getSharingToken } from '@nextcloud/sharing/public'

/**
* Upload the given contents of a PDF file to the given filename.
Expand Down Expand Up @@ -36,11 +37,11 @@ export default async function(filename, data) {
requesttoken: getRequestToken(),
},
}
if (getToken()) {
if (getSharingToken()) {
requestConfig.auth = {
// Password is not needed due to "public_link_authenticated" being
// set in the session when the share was loaded.
username: getToken(),
username: getSharingToken(),
}
}

Expand Down
8 changes: 0 additions & 8 deletions src/utils/davUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,3 @@ export const getUserRoot = function() {
export const isPublic = function() {
return !getCurrentUser()
}

/**
* Get the current share link token
*/
export const getToken = function() {
const tokenInput = document.getElementById('sharingToken')
return tokenInput && tokenInput.value
}
Loading