Skip to content
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
172 changes: 147 additions & 25 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@nextcloud/capabilities": "^1.2.1",
"@nextcloud/dialogs": "^6.4.1",
"@nextcloud/event-bus": "^3.3.3",
"@nextcloud/files": "^3.12.0",
"@nextcloud/files": "^4.0.0-beta.8",
"@nextcloud/initial-state": "^2.2.0",
"@nextcloud/l10n": "^3.4.1",
"@nextcloud/logger": "^3.0.2",
Expand Down
16 changes: 7 additions & 9 deletions src/actions/openInLibreSignAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { registerFileAction, FileAction } from '@nextcloud/files'
import { registerFileAction, FileAction, getSidebar } from '@nextcloud/files'
import { getCapabilities } from '@nextcloud/capabilities'
import { loadState } from '@nextcloud/initial-state'
import { translate as t } from '@nextcloud/l10n'
Expand Down Expand Up @@ -71,10 +71,9 @@ export const action = new FileAction({
* Single file: open in sidebar
*/
async exec({ nodes }) {
window.OCA.Files.Sidebar.close()
const node = nodes[0]
await window.OCA.Files.Sidebar.open(node.path)
window.OCA.Files.Sidebar.setActiveTab('libresign')
await sidebar.open(node, 'libresign')
sidebar.setActiveTab('libresign')
return null
},

Expand Down Expand Up @@ -103,16 +102,15 @@ export const action = new FileAction({
settings: {
path: envelopePath,
},
}).then((response) => {
}).then(async (response) => {
const envelopeData = response.data?.ocs?.data

window.OCA.Libresign.pendingEnvelope = envelopeData

window.OCA.Files.Sidebar.close()

window.OCA.Files.Sidebar.setActiveTab('libresign')
const sidebar = getSidebar()
const firstNode = nodes[0]
window.OCA.Files.Sidebar.open(firstNode.path)
await sidebar.open(firstNode, 'libresign')
sidebar.setActiveTab('libresign')

return new Array(nodes.length).fill(null)
}).catch((error) => {
Expand Down
8 changes: 4 additions & 4 deletions src/actions/showStatusInlineAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { FileAction, registerFileAction } from '@nextcloud/files'
import { FileAction, registerFileAction, getSidebar } from '@nextcloud/files'
import { loadState } from '@nextcloud/initial-state'
import { t } from '@nextcloud/l10n'

Expand All @@ -26,8 +26,8 @@ const action = new FileAction({
},
exec: async ({ nodes }) => {
const node = nodes[0]
await window.OCA.Files.Sidebar.open(node.path)
window.OCA.Files.Sidebar.setActiveTab('libresign')
sidebar.open(node, 'libresign')
sidebar.setActiveTab('libresign')
return null
},
iconSvgInline: ({ nodes }) => {
Expand All @@ -48,7 +48,7 @@ const action = new FileAction({
const certificateOk = loadState('libresign', 'certificate_ok')
const allPdf = nodes?.length > 0 && nodes.every(node => node.mime === 'application/pdf')
const allHaveStatus = nodes?.every(node => node.attributes['libresign-signature-status'])

return certificateOk && allPdf && allHaveStatus
},
order: -1,
Expand Down
9 changes: 5 additions & 4 deletions src/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import Vue from 'vue'

import axios from '@nextcloud/axios'
import { addNewFileMenuEntry, Permission } from '@nextcloud/files'
import { addNewFileMenuEntry, Permission, getSidebar } from '@nextcloud/files'
import { registerDavProperty } from '@nextcloud/files/dav'
import { translate, translatePlural } from '@nextcloud/l10n'
import { generateOcsUrl } from '@nextcloud/router'
Expand Down Expand Up @@ -34,7 +34,7 @@ addNewFileMenuEntry({
enabled() {
return Permission.CREATE !== 0
},
async handler(context, content) {
async handler(context, content) {s
const input = document.createElement('input')
input.accept = 'application/pdf'
input.type = 'file'
Expand All @@ -54,9 +54,10 @@ addNewFileMenuEntry({
name: upload.file.name,
})
.then(async ({ data }) => {
await window.OCA.Files.Sidebar.open(path)
OCA.Files.Sidebar.setActiveTab('libresign')
sidebar.open({ path }, 'libresign')
sidebar.setActiveTab('libresign')
})
.catch((error) => logger.error('Error uploading file:', error))
})
this.uploadManager
.upload(file.name, file)
Expand Down
Loading