[ADF-3362][ADF-3361] Search on document picker with custom site list - fix (#3592)

* [ADF-3362] Search on document picker with custom site list - fix

* refactor & fix ADF-3361 & ADF-3362

* [ADF-3361][ADF-3362] set spy on the right method

* [ADF-3361][ADF-3362] fix tests

* [ADF-3361][ADF-3362] set constant

* [ADF-3361][ADF-3362] remove unused method

* [ADF-3361][ADF-3362] more relevant tests related to the fix

* [ADF-3362] refactor method

* [ADF-3362] fix tslint errors

* remove pagination override
This commit is contained in:
Suzana Dirla
2018-08-13 16:36:12 +03:00
committed by Eugenio Romano
parent cacf93ad2f
commit cc9548b25a
4 changed files with 81 additions and 53 deletions

View File

@@ -28,6 +28,7 @@ import { ImageResolver } from '../document-list/data/image-resolver.model';
import { ContentNodeSelectorService } from './content-node-selector.service';
import { debounceTime } from 'rxjs/operators';
import { BehaviorSubject } from 'rxjs';
import { CustomResourcesService } from '../document-list/services/custom-resources.service';
export type ValidationFunction = (entry: MinimalNodeEntryEntity) => boolean;
@@ -120,6 +121,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, PaginatedCompo
constructor(private contentNodeSelectorService: ContentNodeSelectorService,
private apiService: AlfrescoApiService,
private customResourcesService: CustomResourcesService,
private preferences: UserPreferencesService) {
this.searchInput.valueChanges
.pipe(
@@ -255,8 +257,8 @@ export class ContentNodeSelectorPanelComponent implements OnInit, PaginatedCompo
private querySearch(): void {
this.loadingSearchResults = true;
if (this.dropdownSiteList) {
this.documentList.getCorrespondingNodeIds(this.siteId)
if (this.customResourcesService.hasCorrespondingNodeIds(this.siteId)) {
this.customResourcesService.getCorrespondingNodeIds(this.siteId)
.subscribe(nodeIds => {
this.contentNodeSelectorService.search(this.searchTerm, this.siteId, this.skipCount, this.pageSize, nodeIds)
.subscribe(this.showSearchResults.bind(this));