- + + + + + + + = new Subject(); @ViewChild(DocumentListComponent) @@ -64,6 +76,9 @@ export abstract class PageComponent implements OnInit, OnDestroy { viewerToolbarActions: Array = []; canUpdateNode = false; canUpload = false; + nodeResult: NodePaging; + pagination: Pagination; + showHeader = ShowHeaderMode.Always; protected subscriptions: Subscription[] = []; @@ -101,6 +116,20 @@ export abstract class PageComponent implements OnInit, OnDestroy { .subscribe(node => { this.canUpload = node && this.content.canUploadContent(node); }); + + if (this.documentList && this.documentList.pagination) { + this.documentList.pagination + .pipe(takeUntil(this.onDestroy$)) + .subscribe((newPagination: Pagination) => { + this.pagination = newPagination; + }); + } + } + + ngOnChanges(changes: SimpleChanges) { + if (changes.nodeResult && changes.nodeResult.currentValue) { + this.nodeResult = changes.nodeResult.currentValue; + } } ngOnDestroy() { @@ -158,4 +187,13 @@ export abstract class PageComponent implements OnInit, OnDestroy { private isOutletPreviewUrl(): boolean { return location.href.includes('viewer:view'); } + + onFilterUpdate(newNodePaging: NodePaging) { + this.nodeResult = newNodePaging; + } + + onAllFilterCleared() { + this.documentList.node = null; + this.store.dispatch(new ReloadDocumentListAction()); + } } diff --git a/src/app/components/search/search-libraries-results/search-libraries-results.component.html b/src/app/components/search/search-libraries-results/search-libraries-results.component.html index 80605bf08..eb7a8e832 100644 --- a/src/app/components/search/search-libraries-results/search-libraries-results.component.html +++ b/src/app/components/search/search-libraries-results/search-libraries-results.component.html @@ -48,7 +48,7 @@ #documentList acaContextActions acaDocumentList - [showHeader]="true" + [showHeader]="showHeader" [selectionMode]="'single'" [sorting]="['name', 'asc']" [node]="data"