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 7a8e872
Showing 1 changed file with 42 additions and 3 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

0 comments on commit 7a8e872

Please sign in to comment.