Skip to content

Commit

Permalink
fix: use fileId for virtual personal space
Browse files Browse the repository at this point in the history
  • Loading branch information
kulmann committed Oct 10, 2022
1 parent e686245 commit d946efe
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default {
return this.$router.push(
createLocationTrash(
'files-trash-generic',
createFileRouteOptions(this.space, { fileId: this.space.id })
createFileRouteOptions(this.space, { fileId: this.space.fileId })
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default {
return this.$router.push(
createLocationSpaces(
'files-spaces-generic',
createFileRouteOptions(this.space, { fileId: this.space.id })
createFileRouteOptions(this.space, { fileId: this.space.fileId })
)
)
}
Expand Down
3 changes: 1 addition & 2 deletions packages/web-app-files/src/views/spaces/DriveRedirect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export default defineComponent({
})
const { params, query } = createFileRouteOptions(unref(personalSpace), {
path: unref(itemPath),
...(['', '/'].includes(unref(itemPath)) && { fileId: unref(personalSpace).id })
path: unref(itemPath)
})
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/views/spaces/GenericSpace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export default defineComponent({
}
let spaceBreadcrumbItem
let { params, query } = createFileRouteOptions(this.space, { fileId: this.space.id })
let { params, query } = createFileRouteOptions(this.space, { fileId: this.space.fileId })
query = { ...this.$route.query, ...query }
if (isPersonalSpaceResource(this.space)) {
spaceBreadcrumbItem = {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-app-files/src/views/spaces/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export default defineComponent({
? '#'
: createLocationSpaces(
'files-spaces-generic',
createFileRouteOptions(space, { path: '', fileId: space.id })
createFileRouteOptions(space, { path: '', fileId: space.fileId })
)
},
Expand Down
1 change: 1 addition & 0 deletions packages/web-client/src/webdav/listFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const ListFilesFactory = ({ sdk }: WebDavOptions) => {
)
const resources = webDavResources.map(buildResource)
if (fileId && fileId !== resources[0].fileId) {
console.log('nono', path, fileId, resources[0].fileId)
return listFilesCorrectedPath()
}
return resources
Expand Down
10 changes: 8 additions & 2 deletions packages/web-runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
isPublicSpaceResource,
Resource
} from 'web-client/src/helpers'
import { WebDAV } from 'web-client/src/webdav'

export const bootstrap = async (configurationPath: string): Promise<void> => {
const runtimeConfiguration = await announceConfiguration(configurationPath)
Expand Down Expand Up @@ -88,13 +89,14 @@ export const renderSuccess = (): void => {
(state, getters) => {
return getters['runtime/auth/isUserContextReady']
},
(userContextReady) => {
async (userContextReady) => {
if (!userContextReady) {
return
}
const clientService = instance.$clientService

// Load spaces to make them available across the application
if (store.getters.capabilities?.spaces?.enabled) {
const clientService = instance.$clientService
const graphClient = clientService.graphAuthenticated(
store.getters.configuration.server,
store.getters['runtime/auth/accessToken']
Expand All @@ -112,6 +114,10 @@ export const renderSuccess = (): void => {
webDavPath: `/files/${user.id}`,
serverUrl: configurationManager.serverUrl
})
const personalHomeInfo = await (clientService.webdav as WebDAV).getFileInfo(space, {
path: ''
})
space.fileId = personalHomeInfo.fileId
store.commit('runtime/spaces/ADD_SPACES', [space])
store.commit('runtime/spaces/SET_SPACES_INITIALIZED', true)
},
Expand Down

0 comments on commit d946efe

Please sign in to comment.