Skip to content

Commit 8a67dfe

Browse files
milanmajchrakclaude
andcommitted
UoE/Address Copilot review on statistics pagination (DSpace#726)
- Make the ds-pagination id unique per scope (use report.id, i.e. `<dso-uuid>_<reportType>`) so navigating between scopes that share a report type (e.g. TotalVisits) no longer reuses a stale page from the URL. - Hide the page-size gear so pageSize behaves as a fixed, input-driven size. - Hide the pagination detail/bar for single-page reports, so the pagination UI only appears when there are more points than fit on one page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3ce9b29 commit 8a67dfe

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/app/statistics-page/statistics-table/statistics-table.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ <h2 class="m-1">
77

88
<ds-pagination [paginationOptions]="paginationOptions"
99
[collectionSize]="report.points.length"
10+
[hideGear]="true"
11+
[hidePaginationDetail]="report.points.length <= pageSize"
1012
[hideSortOptions]="true"
1113
[retainScrollPosition]="true">
1214

src/app/statistics-page/statistics-table/statistics-table.component.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import { StatisticsTableComponent } from './statistics-table.component';
3232
class MockPaginationComponent {
3333
@Input() paginationOptions: PaginationComponentOptions;
3434
@Input() collectionSize: number;
35+
@Input() hideGear: boolean;
36+
@Input() hidePaginationDetail: boolean;
3537
@Input() hideSortOptions: boolean;
3638
@Input() retainScrollPosition: boolean;
3739
}

src/app/statistics-page/statistics-table/statistics-table.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,9 @@ export class StatisticsTableComponent implements OnInit {
9393
}
9494

9595
this.paginationOptions = Object.assign(new PaginationComponentOptions(), {
96-
// Unique per report so multiple tables on one statistics page paginate independently
97-
id: `stats-${this.report.reportType}`,
96+
// Unique per report AND scope so multiple tables paginate independently and a report doesn't pick up
97+
// another scope's page from the URL. report.id is `<dso-uuid>_<reportType>`, e.g. `<uuid>_TotalVisits`.
98+
id: `stats-${this.report.id}`,
9899
pageSize: this.pageSize,
99100
currentPage: 1,
100101
});

0 commit comments

Comments
 (0)