mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
fixed an issue where the matrix URL pagination params would still be used
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<h2>{{'home.top-level-communities.head' | translate}}</h2>
|
||||
<p class="lead">{{'home.top-level-communities.help' | translate}}</p>
|
||||
<ds-object-list [config]="config" [sortConfig]="sortConfig"
|
||||
[objects]="topLevelCommunities" [hideGear]="false"
|
||||
[objects]="topLevelCommunities" [hideGear]="true"
|
||||
(pageChange)="onPageChange($event)"
|
||||
(pageSizeChange)="onPageSizeChange($event)"
|
||||
(sortDirectionChange)="onSortDirectionChange($event)"
|
||||
|
@@ -57,6 +57,7 @@ export class TopLevelCommunityListComponent implements OnInit {
|
||||
}
|
||||
|
||||
updateResults() {
|
||||
this.topLevelCommunities = undefined;
|
||||
this.topLevelCommunities = this.cds.findAll({ currentPage: this.config.currentPage, elementsPerPage: this.config.pageSize, sort: this.sortConfig });
|
||||
this.ref.detectChanges();
|
||||
}
|
||||
|
@@ -305,15 +305,18 @@ export class PaginationComponent implements OnDestroy, OnInit {
|
||||
private validateParams(page: any, pageSize: any, sortDirection: any, sortField: any) {
|
||||
let filteredPageSize = this.pageSizeOptions.find(x => x == pageSize);
|
||||
if (!isNumeric(page) || !filteredPageSize) {
|
||||
let filteredPage = isNumeric(page) ? page : this.currentPage;
|
||||
filteredPageSize = (filteredPageSize) ? filteredPageSize : this.pageSize;
|
||||
this.router.navigate([{
|
||||
let filteredPage = isNumeric(page) ? page : this.currentPage;
|
||||
filteredPageSize = (filteredPageSize) ? filteredPageSize : this.pageSize;
|
||||
this.router.navigate([], {
|
||||
queryParams: {
|
||||
pageId: this.id,
|
||||
page: filteredPage,
|
||||
pageSize: filteredPageSize,
|
||||
sortDirection: sortDirection,
|
||||
sortField: sortField
|
||||
}]);
|
||||
}
|
||||
}
|
||||
);
|
||||
} else {
|
||||
// (+) converts string to a number
|
||||
this.currentPage = +page;
|
||||
|
Reference in New Issue
Block a user