From 2695720d421bf214b77af64590817c9c47a5da7b Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 1 Aug 2023 10:27:04 +0200 Subject: [PATCH] Use spaces endpoint for search (#9500) * Use new spaces endpoint for search * Bump sdk and ocis commit id * Add spaces check --- .drone.env | 2 +- packages/web-app-files/src/search/sdk/list.ts | 5 ++++- packages/web-app-files/src/search/sdk/preview.ts | 5 ++++- packages/web-runtime/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.drone.env b/.drone.env index 77dd458bc66..9198816e0f0 100644 --- a/.drone.env +++ b/.drone.env @@ -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 diff --git a/packages/web-app-files/src/search/sdk/list.ts b/packages/web-app-files/src/search/sdk/list.ts index 6e467f0b21c..b93aa166194 100644 --- a/packages/web-app-files/src/search/sdk/list.ts +++ b/packages/web-app-files/src/search/sdk/list.ts @@ -37,6 +37,8 @@ export default class List implements SearchList { } async search(term: string): Promise { + const useSpacesEndpoint = this.store.getters.capabilities?.spaces?.enabled === true + if (!term) { return { totalResults: null, @@ -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 { diff --git a/packages/web-app-files/src/search/sdk/preview.ts b/packages/web-app-files/src/search/sdk/preview.ts index bf97b61c284..354f7d0b36c 100644 --- a/packages/web-app-files/src/search/sdk/preview.ts +++ b/packages/web-app-files/src/search/sdk/preview.ts @@ -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]) diff --git a/packages/web-runtime/package.json b/packages/web-runtime/package.json index ec75cfcb42d..a4f1c2cc066 100644 --- a/packages/web-runtime/package.json +++ b/packages/web-runtime/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e9cf8606747..405be0b4688 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1028,8 +1028,8 @@ importers: specifier: ^2.1.0 version: 2.1.0 owncloud-sdk: - specifier: ~3.1.0-alpha.6 - version: 3.1.0-alpha.6(axios@1.4.0)(cross-fetch@3.1.4)(promise@8.1.0)(qs@6.10.3)(utf8@3.0.0)(uuid@9.0.0)(webdav@4.10.0)(xml-js@1.6.11) + specifier: ~3.1.0-alpha.7 + version: 3.1.0-alpha.7(axios@1.4.0)(cross-fetch@3.1.4)(promise@8.1.0)(qs@6.10.3)(utf8@3.0.0)(uuid@9.0.0)(webdav@4.10.0)(xml-js@1.6.11) p-queue: specifier: ^6.6.2 version: 6.6.2 @@ -15958,8 +15958,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /owncloud-sdk@3.1.0-alpha.6(axios@1.4.0)(cross-fetch@3.1.4)(promise@8.1.0)(qs@6.10.3)(utf8@3.0.0)(uuid@9.0.0)(webdav@4.10.0)(xml-js@1.6.11): - resolution: {integrity: sha512-U079L2Bjfx9hi3d1+hapR8Umyoj/hY8QQhqiy+/J7shwPKHFRdzZoyJkTtL+zOwOjqFfBIOZYEvOWPY5+5k3HA==} + /owncloud-sdk@3.1.0-alpha.7(axios@1.4.0)(cross-fetch@3.1.4)(promise@8.1.0)(qs@6.10.3)(utf8@3.0.0)(uuid@9.0.0)(webdav@4.10.0)(xml-js@1.6.11): + resolution: {integrity: sha512-YNZrwY7yesiQBKu+4Z2JWR9r5LwtPHXuozlChOlOCMzw/FUI6e7koh9+WRrEwoRQZAnWVvtVCre+zUeJXXcqZw==} peerDependencies: axios: ^0.27.2 cross-fetch: ^3.0.6