[REF] SearchKit - display code refactor + pager options #21049
Merged
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.
Overview
Code refactor to improve code reusability in SearchKit displays, plus a couple new options for configuring the pager:
Technical Details
My goal is to merge two divergent chunks of code: SearchKit has 2 results tables, one is the table shown when an admin is composing a search, and the other is a SearchDisplay of type table. They are very similar in appearance, but were written for different use-cases. Notably, the table on the admin screen lets you add, remove and move columns. I also wrote it first. Had I written the SearchDisplay code first, I would have adapted it for use on the admin screen instead of writing the other from scratch.
I'm trying to fix that design error and adapt the table display for use on the admin screen and ditch all that single-use code, but it's turned into a massive undertaking so here's a preliminary PR with the refactoring I've done so far. It's mostly just moving code around, the only visible change is to improve the pager on SearchDisplays to have feature-parity with the one on the admin screen ("adjustable page size" and "show count").