[ADF-2045] Pagination is not working properly on Search Results Page (#2744)

This commit is contained in:
Eugenio Romano
2017-11-28 12:46:01 +00:00
committed by GitHub
parent ee901b6641
commit c763ba45e0
11 changed files with 58 additions and 62 deletions

View File

@@ -23,7 +23,7 @@ import { Component, Input } from '@angular/core';
export class OverlayViewerComponent {
@Input()
showViewer: boolean = false;
showViewer = false;
nodeId: string;

View File

@@ -1,7 +1,7 @@
<adf-search [searchTerm]="searchedWord"
[maxResults]="maxItems"
[skipResults]="skipCount"
(resultLoaded)="showSearchResult($event)"
(resultLoaded)="onSearchResultLoaded($event)"
#search>
</adf-search>
@@ -9,10 +9,11 @@
[currentFolderId]="null"
[nodeResult]="resultNodePageList"
[disableDragArea]="true"
(documentListReady)="refreshResults($event)"
(changedPageSize)="refreshPage($event)"
(changedPageNumber)="refreshPage($event)"
(turnedNextPage)="refreshPage($event)"
(loadNext)="refreshPage($event)"
(turnedPreviousPage)="refreshPage($event)">
[pagination]="pagination"
(documentListReady)="onDocumentListReady($event)"
(changedPageSize)="onRefreshPagination($event)"
(changedPageNumber)="onRefreshPagination($event)"
(turnedNextPage)="onRefreshPagination($event)"
(loadNext)="onRefreshPagination($event)"
(turnedPreviousPage)="onRefreshPagination($event)">
</app-files-component>

View File

@@ -31,15 +31,12 @@ export class SearchResultComponent implements OnInit {
@ViewChild('search')
search: SearchComponent;
fileNodeId: string;
queryParamName = 'q';
searchedWord = '';
fileShowed = false;
navigationMode = 'dblclick';
resultNodePageList: NodePaging;
maxItems: number;
skipCount = 0;
paging: Pagination;
pagination: Pagination;
constructor(public router: Router,
private preferences: UserPreferencesService,
@@ -56,17 +53,17 @@ export class SearchResultComponent implements OnInit {
this.maxItems = this.preferences.paginationSize;
}
showSearchResult(event: NodePaging) {
this.resultNodePageList = event;
this.paging = event.list.pagination;
onSearchResultLoaded(nodePaging: NodePaging) {
this.resultNodePageList = nodePaging;
this.pagination = nodePaging.list.pagination;
}
refreshResults(event: any) {
this.search.reload();
onDocumentListReady() {
// this.search.reload();
}
refreshPage(event: Pagination) {
this.maxItems = event.maxItems;
this.skipCount = event.skipCount;
onRefreshPagination(pagination: Pagination) {
this.maxItems = pagination.maxItems;
this.skipCount = pagination.skipCount;
}
}

View File

@@ -24,8 +24,6 @@ import { LogService } from '@alfresco/adf-core';
})
export class WebscriptComponent {
currentPath = '/';
host = 'http://127.0.0.1:8080';
scriptPath = 'sample/folder/Company%20Home';
contextRoot = 'alfresco';
servicePath = 'service';