Skip to content

Commit

Permalink
Use spaces endpoint for search (#9500)
Browse files Browse the repository at this point in the history
* Use new spaces endpoint for search

* Bump sdk and ocis commit id

* Add spaces check
  • Loading branch information
Jan authored Aug 1, 2023
1 parent ff5f387 commit 2695720
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .drone.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# The version of OCIS to use in pipelines that test against OCIS
OCIS_COMMITID=309b59a665c57e226cd065f3c23721e17edbac1a
OCIS_COMMITID=526583e9bbe7f2e09527df8dad02ba2ec4068f1d
OCIS_BRANCH=master
5 changes: 4 additions & 1 deletion packages/web-app-files/src/search/sdk/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default class List implements SearchList {
}

async search(term: string): Promise<SearchResult> {
const useSpacesEndpoint = this.store.getters.capabilities?.spaces?.enabled === true

if (!term) {
return {
totalResults: null,
Expand All @@ -47,7 +49,8 @@ export default class List implements SearchList {
const { range, results } = await this.clientService.owncloudSdk.files.search(
term,
searchLimit,
DavProperties.Default
DavProperties.Default,
useSpacesEndpoint
)

return {
Expand Down
5 changes: 4 additions & 1 deletion packages/web-app-files/src/search/sdk/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ export default class Preview implements SearchPreview {
}

const areHiddenFilesShown = this.store.state.Files?.areHiddenFilesShown
const useSpacesEndpoint = this.store.getters.capabilities?.spaces?.enabled === true

const { range, results } = await this.clientService.owncloudSdk.files.search(
term,
previewSearchLimit, // todo: add configuration option, other places need that too... needs consolidation
DavProperties.Default
DavProperties.Default,
useSpacesEndpoint
)
const resources = results.reduce((acc, result) => {
const matchingSpace = this.getMatchingSpace(result.fileInfo[DavProperty.FileParent])
Expand Down
2 changes: 1 addition & 1 deletion packages/web-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"luxon": "^2.4.0",
"marked": "^4.0.12",
"oidc-client-ts": "^2.1.0",
"owncloud-sdk": "~3.1.0-alpha.6",
"owncloud-sdk": "~3.1.0-alpha.7",
"p-queue": "^6.6.2",
"pinia": "^2.1.3",
"portal-vue": "3.0.0",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2695720

Please sign in to comment.