-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolving external URLs via file ID (#9833)
* fix: resolving external URLs via file ID * test: fix unit tests * improve method naming * fix: redirect after closing external apps
- Loading branch information
1 parent
a26f792
commit b7fddf8
Showing
6 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Bugfix: Resolving external URLs | ||
|
||
Resolving external URLs when only the file ID is given has been fixed. | ||
|
||
https://github.com/owncloud/web/issues/9804 | ||
https://github.com/owncloud/web/pull/9833 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './useLoadFileInfoById' |
38 changes: 38 additions & 0 deletions
38
packages/web-pkg/src/composables/fileInfo/useLoadFileInfoById.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ClientService } from 'web-pkg/src/services' | ||
import { useClientService } from 'web-pkg/src/composables' | ||
import { useTask } from 'vue-concurrency' | ||
import { buildSpace, buildWebDavSpacesPath } from 'web-client/src/helpers' | ||
import { DavProperty } from 'web-client/src/webdav/constants' | ||
|
||
export interface LoadFileInfoByIdOptions { | ||
clientService?: ClientService | ||
davProperties?: DavProperty[] | ||
} | ||
|
||
export const useLoadFileInfoById = (options: LoadFileInfoByIdOptions) => { | ||
const { webdav } = options.clientService || useClientService() | ||
const davProperties = options.davProperties || [ | ||
DavProperty.FileId, | ||
DavProperty.FileParent, | ||
DavProperty.Name, | ||
DavProperty.ResourceType | ||
] | ||
|
||
const loadFileInfoByIdTask = useTask(function* (signal, fileId: string | number) { | ||
const space = buildSpace({ | ||
id: fileId, | ||
webDavPath: buildWebDavSpacesPath(fileId) | ||
}) | ||
return yield webdav.getFileInfo( | ||
space, | ||
{}, | ||
{ | ||
davProperties | ||
} | ||
) | ||
}) | ||
|
||
return { | ||
loadFileInfoByIdTask | ||
} | ||
} |