[ADF-2242] Search on custom sources is not working. (#2904)

* [ADF-2242] Search on custom sources is not working.

fix search on custom sources

* [ADF-2242] added unit tests

* [ADF-2242] reverted change

* [ADF-2242] simplify code on search method and make extra call only when having custom dropdown defined
This commit is contained in:
suzanadirla
2018-02-02 17:22:33 +02:00
committed by Eugenio Romano
parent 5ee9b09a21
commit 78c6a68e51
5 changed files with 204 additions and 37 deletions

View File

@@ -220,8 +220,19 @@ export class ContentNodeSelectorPanelComponent implements OnInit {
private querySearch(): void {
this.loadingSearchResults = true;
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.skipCount, this.pageSize)
.subscribe(this.showSearchResults.bind(this));
if (this.dropdownSiteList) {
this.documentList.getCorrespondingNodeIds(this.siteId)
.then(nodeIds => {
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.skipCount, this.pageSize, nodeIds)
.subscribe(this.showSearchResults.bind(this));
})
.catch(() => {
this.showSearchResults({list: {entries: []}});
});
} else {
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.skipCount, this.pageSize)
.subscribe(this.showSearchResults.bind(this));
}
}
/**