Repository navigation
Send absolute row index in request when "last" pagination button is clicked - #7211
Conversation
This change addresses how the "last" pagination navigation button sends the ending point. The current behavior is that it sends the index of the last row relative to a faceted search, and this change is to send the index of the absolute last row in the project. This also includes a change to omit the `nextPageStart` variable if there are fewer than `limit` elements in the response. This will cause the `next` and `last` pagination buttons to be marked as inactive, as there are no more elements to paginate through.
wetneb
left a comment
There was a problem hiding this comment.
Thanks a lot for tackling this!
I agree that clicking Last should use the total number of rows in the project, regardless of the filtering. Unfortunately, rowModel.total isn't quite that: in records mode, this will be the total number of records in the project. And when paginating through records, we still use the row ids to specify page boundaries, so we'd need to still use the total number of rows in the project in this case.
I can't see anywhere else where rowModel.totalRows is being used, so I think it would make sense to instead fix the backend to make sure this still contains the total number of rows in the project (regardless of the rows/record mode and of filtering options).
Also, it would be nice to have some automated tests covering your changes. Java unit tests are probably sufficient and faster.
|
Ah, I wasn't sure how this would affect records mode, thank you for clarifying that! I'm trying to add a test to make sure faceted search paginates correctly, but I'm having a hard time actually adding a facet within the test. I tried looking at the network tab in my browser tools to get the Edit: I got around this by registering the GREL parser in the test setup, which seems to be a common pattern in other tests. Please let me know if that's not a reasonable addition here. |
This commit changes the behavior of GetRowsCommand to return the total number of rows in a project as the `totalRows` field, rather than returning the filtered row count. This commit also adds two tests to GetRowsCommandTest, to test that pagination still works as expected when facets are applied.
…licked (#7211) * fixes #7207 This change addresses how the "last" pagination navigation button sends the ending point. The current behavior is that it sends the index of the last row relative to a faceted search, and this change is to send the index of the absolute last row in the project. This also includes a change to omit the `nextPageStart` variable if there are fewer than `limit` elements in the response. This will cause the `next` and `last` pagination buttons to be marked as inactive, as there are no more elements to paginate through. * set totalRows to project row length and add tests This commit changes the behavior of GetRowsCommand to return the total number of rows in a project as the `totalRows` field, rather than returning the filtered row count. This commit also adds two tests to GetRowsCommandTest, to test that pagination still works as expected when facets are applied.
Fixes #7207
Changes proposed in this pull request:
nextPageStartvariable if there are fewer thanlimitelements in the response. This will cause thenextandlastpagination buttons to be marked as inactive, as there are no more elements to paginate through.