Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2021-02-23 14:18:12 +0300
committerJulius Härtl <jus@bitgrid.net>2021-02-23 14:21:24 +0300
commit39bae46094734f0498d41338122814de37bd2e85 (patch)
treeb19127e69138da3dee27315606c5d7fafc81f348
parentd87f50381e9a66930f13f8c394b5b62c6d794cab (diff)
Temporary workaround to provide collabora with the fileid for the new template creation flow
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--src/files.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/files.js b/src/files.js
index 04a2b6d2..00852e86 100644
--- a/src/files.js
+++ b/src/files.js
@@ -38,9 +38,25 @@ const odfViewer = {
OC.PERMISSION_READ,
OC.imagePath('core', 'actions/rename'),
(fileName, context) => {
+ if (context?.fileId) {
+ OCA.Files.App.fileList.filesClient.getFileInfo(context.dir + '/' + fileName).then((status, fileInfo) => {
+ const fileModel = context.fileList.findFile(fileName)
+ const shareOwnerId = fileModel?.shareOwnerId || fileInfo?.shareOwnerId
+ context.fileId = fileInfo.id
+ return this.onEdit(fileName, {
+ ...context,
+ shareOwnerId
+ })
+ })
+ return
+ }
+
const fileModel = context.fileList.findFile(fileName)
const shareOwnerId = fileModel?.shareOwnerId
- return this.onEdit(fileName, { ...context, shareOwnerId })
+ return this.onEdit(fileName, {
+ ...context,
+ shareOwnerId
+ })
},
t('richdocuments', 'Edit with {productName}', { productName: OC.getCapabilities().richdocuments.productName }, undefined, { escape: false })
)