mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2045] Pagination is not working properly on Search Results Page (#2744)
This commit is contained in:
@@ -23,7 +23,7 @@ import { Component, Input } from '@angular/core';
|
||||
export class OverlayViewerComponent {
|
||||
|
||||
@Input()
|
||||
showViewer: boolean = false;
|
||||
showViewer = false;
|
||||
|
||||
nodeId: string;
|
||||
|
||||
|
@@ -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>
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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';
|
||||
|
Reference in New Issue
Block a user