-
Notifications
You must be signed in to change notification settings - Fork 508
[main] Add paginated vocabulary search with 'Show previous/next results' controls in hierarchical browse #4508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…lts’ controls in hierarchical browse
nwoodward
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ZahraaChreim-Atmire. The pagination works very well, except for one small issue. If there are more than 20 nodes and I click "Show next results" and then navigate away from Browsing by Subject Category to any other page of the repository when I come back to Browsing by Subject Category the "Show previous results" button still appears, even though I'm on the first page of subjects. Is there a way to reset the buttons when the user navigates away from this page?
…ix-issue4500-hierarchical-browse-pagination-10_x'
…ubject category page (cherry picked from commit 231da9c)
Thank you for your feedback! I’ve updated the code to reset the pagination observables on component initialization, ensuring the buttons are hidden when returning to the page. |
|
Thanks @ZahraaChreim-Atmire! Now when I navigate away from browsing by subject category the pagination resets. Can you also reset the pagination when the user clicks on the "Reset" button? When I search for "label" in the subject categories and then navigate though the results and then click "Reset" then the bottom of the categories list looks like the screenshot. It's still showing the previous and next buttons, but the search box is empty so it's a bit confusing.
|
(cherry picked from commit 9aacba6)
@nwoodward Fixed! Pagination is also reset when the "Reset" button is clicked. |
nwoodward
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks @ZahraaChreim-Atmire! I tested again this morning, and the pagination works really well in every scenario I could envision.
|
Hi @ZahraaChreim-Atmire, |
…al-browse-pagination-10_x'
|
Temporarily closing & reopening to get an updated test result. Apologies this has taken long to get back to, but I'd like to see if we can merge this soon. |


References
Description
Added paging state management to the vocabulary treeview service, updating after each query based on whether previous or next pages exist; this state is exposed to the component to conditionally render navigation buttons in the hierarchical vocabulary browse.
Instructions for Reviewers
List of changes in this PR:
currentPage,totalPages,showNextPageSubject, andshowPreviousPageSubjectto thevocabulary-treeview.serviceto manage and expose pagination state.searchByQueryAndPage(query, selectedItems, page)to support page-specific vocabulary search requests. The existingsearchByQuerymethod was updated to call this with page1by default.searchByQueryAndPageto extract pagination info from the search response and update theshowNextPageSubjectandshowPreviousPageSubjectbased on whether more pages are available.showNextPage$andshowPreviousPage$in the component, derived fromshowNextPageSubject, andshowPreviousPageSubject, to reactively control the display of pagination buttons.loadNextPageand `loadPreviousPage to trigger paging behavior.To test this PR:
label="label1"throughlabel="label100"and corresponding values like"value test 1"to"value test 100"./browse/srsc).label.Expected behavior after applying this PR:
First page:

Intermediate page:

Last page:

mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.