From 7bd7f382597812d63e62e7482d66b9fd6d24086b Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 4 Nov 2020 14:11:46 +0100 Subject: [PATCH] 74199: AuthorizedCollectionSelectorComponent current dso query fix --- .../authorized-collection-selector.component.ts | 7 +++++++ .../dso-selector/dso-selector/dso-selector.component.ts | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts index 1e58289c3a..0a19da54c8 100644 --- a/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/authorized-collection-selector/authorized-collection-selector.component.ts @@ -24,6 +24,13 @@ export class AuthorizedCollectionSelectorComponent extends DSOSelectorComponent super(searchService); } + /** + * Get a query to send for retrieving the current DSO + */ + getCurrentDSOQuery(): string { + return this.currentDSOId; + } + /** * Perform a search for authorized collections with the current query and page * @param query Query to search objects for diff --git a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts index 931599c333..5bbcec4262 100644 --- a/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts +++ b/src/app/shared/dso-selector/dso-selector/dso-selector.component.ts @@ -131,7 +131,7 @@ export class DSOSelectorComponent implements OnInit, OnDestroy { // Create an observable searching for the current DSO (return empty list if there's no current DSO) let currentDSOResult$; if (isNotEmpty(this.currentDSOId)) { - currentDSOResult$ = this.search(`search.resourceid:${this.currentDSOId}`, 1); + currentDSOResult$ = this.search(this.getCurrentDSOQuery(), 1); } else { currentDSOResult$ = observableOf(new PaginatedList(undefined, [])); } @@ -175,6 +175,13 @@ export class DSOSelectorComponent implements OnInit, OnDestroy { })); } + /** + * Get a query to send for retrieving the current DSO + */ + getCurrentDSOQuery(): string { + return `search.resourceid:${this.currentDSOId}`; + } + /** * Perform a search for the current query and page * @param query Query to search objects for