Reset pagination on search term change#113
Open
amadulhaxxani wants to merge 1 commit intoclarin-v7from
Open
Conversation
Reset pagination on search term change
There was a problem hiding this comment.
Pull request overview
This PR fixes pagination/search state desynchronization on the License Administration page by ensuring the route-backed pagination is reset to page 1 whenever the search term changes, so the UI pager and “Showing X–Y of Z” range match the loaded results.
Changes:
- Added a dedicated
searchLicenses()handler that detects search-term changes and callsPaginationService.resetPage(...). - Simplified
loadAllLicenses()by removing the in-pipelinescan-based page override logic and relying on shared pagination state (with an optional one-time page override). - Updated unit tests and the template click binding to exercise/trigger the new search behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/app/clarin-licenses/clarin-license-table/clarin-license-table.component.ts |
Introduces search handler + removes RxJS scan page-reset workaround; fetch now uses route-backed pagination with optional override. |
src/app/clarin-licenses/clarin-license-table/clarin-license-table.component.spec.ts |
Adds test coverage for “reset on new term” and “no reset on same term”. |
src/app/clarin-licenses/clarin-license-table/clarin-license-table.component.html |
Wires the search button click to searchLicenses() instead of directly calling loadAllLicenses(). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem description
After searching on the License Administration page from a non-first page, the request and UI pagination state were out of sync. The search request loaded first-page results, while the highlighted pagination button and the Showing X - Y of Z range still reflected the previous page.
Analysis
Copilot review