[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

@@ -27,7 +27,7 @@ import {
} from '@alfresco/adf-core';
import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging } from 'alfresco-js-api';
import { Observable, Subject, BehaviorSubject, Subscription, of } from 'rxjs';
import { Subject, BehaviorSubject, Subscription, of } from 'rxjs';
import { ShareDataRow } from './../data/share-data-row.model';
import { ShareDataTableAdapter } from './../data/share-datatable-adapter';
import { presetsDefaultModel } from '../models/preset.model';
@@ -813,22 +813,6 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
this.pagination.value.skipCount = 0;
}
// TODO: remove it from here
getCorrespondingNodeIds(nodeId: string): Observable<string[]> {
if (this.customResourcesService.isCustomSource(nodeId)) {
return this.customResourcesService.getCorrespondingNodeIds(nodeId, this.pagination.getValue());
} else if (nodeId) {
return new Observable(observer => {
this.documentListService.getFolderNode(nodeId, this.includeFields)
.subscribe((node: MinimalNodeEntryEntity) => {
observer.next([node.id]);
observer.complete();
});
});
}
}
ngOnDestroy() {
this.subscriptions.forEach(s => s.unsubscribe());
this.subscriptions = [];