[solidus_admin] Add configurable pagination resource ratios for admin index pages - #6587
Draft
forkata wants to merge 2 commits into
Draft
[solidus_admin] Add configurable pagination resource ratios for admin index pages#6587forkata wants to merge 2 commits into
forkata wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6587 +/- ##
==========================================
+ Coverage 92.16% 92.26% +0.09%
==========================================
Files 1037 1037
Lines 21210 21242 +32
==========================================
+ Hits 19549 19599 +50
+ Misses 1661 1643 -18 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This would allow users of the new admin to configure the number of resources seen on each index route, without having to override the controller actions or the default constant defined in Geared Pagination[^1]. We considered doing this as a hash per resource type, but for now a global config is a good starting point. [^1]: https://github.com/basecamp/geared_pagination/blob/master/lib/geared_pagination/recordset.rb#L3 Co-authored-by: Senem Soy <senem@super.gd>
This passes the new config when paginating orders and products in the Solidus admin. These two controllers explicitly call the `set_and_extract_portion_from` helper so they need to receive this argument explicitly, otherwise the default configuration from the geared pagination will be used. Co-authored-by: Senem Soy <senem@super.gd>
forkata
force-pushed
the
6520/configurable-resource-count-index
branch
from
September 4, 2026 21:53
76d67c8 to
ef99146
Compare
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.
Summary
This change aims to introduce a new config that can be used in the admin to customize the resource count ratios for geared pagination, without having to override the global configuration that gem provides.
In the future we can extend this to a per-model config, by switching the static configuration to a hash keyed by the resource name, but for now a single config for all resource types is used.
This is still a rough draft, but since there is another PR attempting to do a similar thing, we thought it may be good to open it up for early feedback. The next step is to specify this in the base resources controller and also extract a shared partial that can be used throughout all other index views.
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: