From 3be3caa72a11fa20ba0fa0f7f51ea268d735279c Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Thu, 17 Feb 2022 10:28:08 +0100 Subject: [PATCH 1/3] Fix app provider file creation --- packages/web-app-files/src/components/AppBar/AppBar.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/web-app-files/src/components/AppBar/AppBar.vue b/packages/web-app-files/src/components/AppBar/AppBar.vue index 8ebf1f4c36e..cf5e258fa83 100644 --- a/packages/web-app-files/src/components/AppBar/AppBar.vue +++ b/packages/web-app-files/src/components/AppBar/AppBar.vue @@ -601,15 +601,20 @@ export default { throw new Error(`An error has occurred: ${response.status}`) } - const path = pathUtil.join(this.currentPath, fileName) let resource + let path = pathUtil.join(this.currentPath, fileName) + if (this.isPersonalLocation) { + path = buildWebDavFilesPath(this.user.id, path) + resource = await this.$client.files.fileInfo(path, DavProperties.Default) + } else if (this.isSpacesProjectLocation) { + path = buildWebDavSpacesPath(this.$route.params.spaceId, path) resource = await this.$client.files.fileInfo(path, DavProperties.Default) } else { resource = await this.$client.publicFiles.getFileInfo( path, this.publicLinkPassword, - DavProperties.PublicLink + DavProperties.Default ) } resource = buildResource(resource) From d2f45cb1c4107811ee6d7a3a500772c0bf8dca76 Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Thu, 17 Feb 2022 14:53:28 +0100 Subject: [PATCH 2/3] Create normal files in public links --- packages/web-app-files/src/components/AppBar/AppBar.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/web-app-files/src/components/AppBar/AppBar.vue b/packages/web-app-files/src/components/AppBar/AppBar.vue index cf5e258fa83..a83b6d51597 100644 --- a/packages/web-app-files/src/components/AppBar/AppBar.vue +++ b/packages/web-app-files/src/components/AppBar/AppBar.vue @@ -521,6 +521,13 @@ export default { path = buildWebDavSpacesPath(this.$route.params.spaceId, path) await this.$client.files.putFileContents(path, '') resource = await this.$client.files.fileInfo(path, DavProperties.Default) + } else { + await this.$client.publicFiles.putFileContents('', path, this.publicLinkPassword, '') + resource = await this.$client.publicFiles.getFileInfo( + path, + this.publicLinkPassword, + DavProperties.Default + ) } if (this.newFileAction) { From 45c8a7e60583aa93cc3192ec5f005a8a3d0547a5 Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Thu, 17 Feb 2022 15:05:41 +0100 Subject: [PATCH 3/3] Request public links dav properties when on public links --- packages/web-app-files/src/components/AppBar/AppBar.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web-app-files/src/components/AppBar/AppBar.vue b/packages/web-app-files/src/components/AppBar/AppBar.vue index a83b6d51597..e20f3b023db 100644 --- a/packages/web-app-files/src/components/AppBar/AppBar.vue +++ b/packages/web-app-files/src/components/AppBar/AppBar.vue @@ -437,7 +437,7 @@ export default { resource = await this.$client.publicFiles.getFileInfo( path, this.publicLinkPassword, - DavProperties.Default + DavProperties.PublicLink ) } resource = buildResource(resource) @@ -526,7 +526,7 @@ export default { resource = await this.$client.publicFiles.getFileInfo( path, this.publicLinkPassword, - DavProperties.Default + DavProperties.PublicLink ) } @@ -621,7 +621,7 @@ export default { resource = await this.$client.publicFiles.getFileInfo( path, this.publicLinkPassword, - DavProperties.Default + DavProperties.PublicLink ) } resource = buildResource(resource) @@ -699,7 +699,7 @@ export default { resource = await this.$client.publicFiles.getFileInfo( path, this.publicLinkPassword, - DavProperties.Default + DavProperties.PublicLink ) }