Skip to content

Commit

Permalink
Load newly created files/folders via personal space
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed May 6, 2022
1 parent bc7a917 commit ed92383
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 4 deletions.
45 changes: 42 additions & 3 deletions packages/web-app-files/src/components/AppBar/CreateAndUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,20 @@ export default defineComponent({
let resource
if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
if (this.hasShareJail) {
const graphClient = clientService.graphAuthenticated(
this.configuration.server,
this.getToken
)
const userResponse = await graphClient.users.getMe()
if (!userResponse.data) {
console.error('graph.user.getMe() has no data')
return
}
path = buildWebDavSpacesPath(userResponse.data.id, path || '')
} else {
path = buildWebDavFilesPath(this.user.id, path)
}
await this.$client.files.createFolder(path)
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
Expand Down Expand Up @@ -492,7 +505,20 @@ export default defineComponent({
let path = pathUtil.join(this.currentPath, fileName)
if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
if (this.hasShareJail) {
const graphClient = clientService.graphAuthenticated(
this.configuration.server,
this.getToken
)
const userResponse = await graphClient.users.getMe()
if (!userResponse.data) {
console.error('graph.user.getMe() has no data')
return
}
path = buildWebDavSpacesPath(userResponse.data.id, path || '')
} else {
path = buildWebDavFilesPath(this.user.id, path)
}
await this.$client.files.putFileContents(path, '')
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
Expand Down Expand Up @@ -570,7 +596,20 @@ export default defineComponent({
let resource
let path = pathUtil.join(this.currentPath, fileName)
if (this.isPersonalLocation) {
path = buildWebDavFilesPath(this.user.id, path)
if (this.hasShareJail) {
const graphClient = clientService.graphAuthenticated(
this.configuration.server,
this.getToken
)
const userResponse = await graphClient.users.getMe()
if (!userResponse.data) {
console.error('graph.user.getMe() has no data')
return
}
path = buildWebDavSpacesPath(userResponse.data.id, path || '')
} else {
path = buildWebDavFilesPath(this.user.id, path)
}
resource = await this.$client.files.fileInfo(path, DavProperties.Default)
} else if (this.isSpacesProjectLocation) {
path = buildWebDavSpacesPath(this.$route.params.storageId, path)
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/features/webUIFilesCopy/copy.feature
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Feature: copy files and folders
And file "data.zip" should be listed on the webUI
And as "Alice" file "simple-folder/simple-empty-folder/data.zip" should exist in the server
And as "Alice" file "simple-folder/data.zip" should exist in the server
w

@issue-6892
Scenario: copy a file into another folder with no change permission
Given user "Alice" has created file "lorem.txt" in the server
Expand Down

0 comments on commit ed92383

Please sign in to comment.