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>
|
<h2>{{'home.top-level-communities.head' | translate}}</h2>
|
||||||
<p class="lead">{{'home.top-level-communities.help' | translate}}</p>
|
<p class="lead">{{'home.top-level-communities.help' | translate}}</p>
|
||||||
<ds-object-list [config]="config" [sortConfig]="sortConfig"
|
<ds-object-list [config]="config" [sortConfig]="sortConfig"
|
||||||
[objects]="topLevelCommunities" [hideGear]="false"
|
[objects]="topLevelCommunities" [hideGear]="true"
|
||||||
(pageChange)="onPageChange($event)"
|
(pageChange)="onPageChange($event)"
|
||||||
(pageSizeChange)="onPageSizeChange($event)"
|
(pageSizeChange)="onPageSizeChange($event)"
|
||||||
(sortDirectionChange)="onSortDirectionChange($event)"
|
(sortDirectionChange)="onSortDirectionChange($event)"
|
||||||
|
@@ -57,6 +57,7 @@ export class TopLevelCommunityListComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateResults() {
|
updateResults() {
|
||||||
|
this.topLevelCommunities = undefined;
|
||||||
this.topLevelCommunities = this.cds.findAll({ currentPage: this.config.currentPage, elementsPerPage: this.config.pageSize, sort: this.sortConfig });
|
this.topLevelCommunities = this.cds.findAll({ currentPage: this.config.currentPage, elementsPerPage: this.config.pageSize, sort: this.sortConfig });
|
||||||
this.ref.detectChanges();
|
this.ref.detectChanges();
|
||||||
}
|
}
|
||||||
|
@@ -305,15 +305,18 @@ export class PaginationComponent implements OnDestroy, OnInit {
|
|||||||
private validateParams(page: any, pageSize: any, sortDirection: any, sortField: any) {
|
private validateParams(page: any, pageSize: any, sortDirection: any, sortField: any) {
|
||||||
let filteredPageSize = this.pageSizeOptions.find(x => x == pageSize);
|
let filteredPageSize = this.pageSizeOptions.find(x => x == pageSize);
|
||||||
if (!isNumeric(page) || !filteredPageSize) {
|
if (!isNumeric(page) || !filteredPageSize) {
|
||||||
let filteredPage = isNumeric(page) ? page : this.currentPage;
|
let filteredPage = isNumeric(page) ? page : this.currentPage;
|
||||||
filteredPageSize = (filteredPageSize) ? filteredPageSize : this.pageSize;
|
filteredPageSize = (filteredPageSize) ? filteredPageSize : this.pageSize;
|
||||||
this.router.navigate([{
|
this.router.navigate([], {
|
||||||
|
queryParams: {
|
||||||
pageId: this.id,
|
pageId: this.id,
|
||||||
page: filteredPage,
|
page: filteredPage,
|
||||||
pageSize: filteredPageSize,
|
pageSize: filteredPageSize,
|
||||||
sortDirection: sortDirection,
|
sortDirection: sortDirection,
|
||||||
sortField: sortField
|
sortField: sortField
|
||||||
}]);
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
// (+) converts string to a number
|
// (+) converts string to a number
|
||||||
this.currentPage = +page;
|
this.currentPage = +page;
|
||||||
|
Reference in New Issue
Block a user