-
Notifications
You must be signed in to change notification settings - Fork 159
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
Fix pagination after increasing items per page #8854
Conversation
0669deb
to
e86f9ec
Compare
@@ -130,6 +148,21 @@ export default defineComponent({ | |||
} | |||
} | |||
|
|||
const setItemsPerPage = (itemsPerPage: string) => { | |||
const resetPagination = itemsPerPage > unref(itemsPerPageQuery) && unref(currentPage) > 1 |
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.
IMO we should go back to page 1 whenever the items per page change. So not only if the items per page increase, but instead on any change
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.
I thought we already had this kind of reset in the past. Don't know if it got lost when we moved the pagination params from the store into the composable+query. 🤔 do you know or did you find any orphaned code fragments regarding the page reset?
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.
IMO we should go back to page 1 whenever the items per page change. So not only if the items per page increase, but instead on any change
Sounds good as well 👍
do you know or did you find any orphaned code fragments regarding the page reset?
I didn't see anything regarding this. Where could such code be located? AFAIK ViewOptions
is the only component where we set items-per-page
.
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.
can't find anything either
@@ -0,0 +1,6 @@ | |||
Bugfix: Pagination after increasing items per page | |||
|
|||
An issue where the file list incorrectly showed no items after paginating and increasing the amount of items per page has been fixed. |
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.
An issue where the file list incorrectly showed no items after paginating and increasing the amount of items per page has been fixed. | |
An issue where the file list incorrectly showed no items after paginating and changing the amount of items per page has been fixed. |
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.
Was about to do the same, but the bug report is still right though, no? The issue only occurred when increasing the amount of items.
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.
yes :D fine by me either way
Kudos, SonarCloud Quality Gate passed! |
Description
Fixes an issue where the file list incorrectly showed no items after paginating and increasing the amount of items per page. This was achieved by resetting the
page
query back to1
if the user is on a page > 1.Related Issue
Types of changes