Skip to content

Make resources per page configurable on admin index pages (#6520) - #6543

Open
PriteshTrivedi wants to merge 1 commit into
solidusio:mainfrom
PriteshTrivedi:configurable-admin-per-page
Open

Make resources per page configurable on admin index pages (#6520)#6543
PriteshTrivedi wants to merge 1 commit into
solidusio:mainfrom
PriteshTrivedi:configurable-admin-per-page

Conversation

@PriteshTrivedi

@PriteshTrivedi PriteshTrivedi commented Aug 20, 2026

Copy link
Copy Markdown

Summary

Closes #6520.

Makes the number of resources per page on admin index pages globally and locally configurable:

  • Adds SolidusAdmin::Config.per_page preference (defaults to 20).
  • Updates SolidusAdmin::BaseController#set_page_and_extract_portion_from to pass per_page: self.per_page by default.
  • Allows per-controller overrides by overriding def per_page or passing per_page:.
  • Removes hardcoded DEFAULT_PER_PAGE from SolidusAdmin::ResourcesController.

Checklist

  • I agree that my PR will be published under the same license as Solidus.
  • I have written a thorough PR description.
  • I have kept my commits small and atomic.
  • I have localized any and all user-facing strings that I added to the source code.
  • I have used clear, explanatory commit messages.
  • I have updated documentation (admin/docs/index_pages.md).
  • I have added automated tests to cover my changes.

@PriteshTrivedi
PriteshTrivedi requested a review from a team as a code owner August 20, 2026 15:43
Copilot AI lite review requested due to automatic review settings August 20, 2026 15:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request makes the number of resources shown per page on Solidus Admin index pages configurable via SolidusAdmin::Config.per_page, replacing the previously hard-coded default of 20 in ResourcesController.

Changes:

  • Adds a per_page preference to SolidusAdmin::Configuration (default: 20) and tests for it.
  • Routes pagination defaults through SolidusAdmin::BaseController#per_page and forwards that into set_page_and_extract_portion_from.
  • Documents how to configure the global per-page value and how to override it per controller.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
admin/lib/solidus_admin/configuration.rb Introduces per_page preference (default 20) for admin index pagination.
admin/app/controllers/solidus_admin/base_controller.rb Applies SolidusAdmin::Config.per_page as the default per_page: for geared pagination.
admin/app/controllers/solidus_admin/resources_controller.rb Removes controller-local default per-page constant/method (now uses the base/controller config behavior).
admin/spec/solidus_admin/configuration_spec.rb Adds specs asserting default and configurable per_page.
admin/spec/controllers/solidus_admin/base_controller_spec.rb Adds specs asserting per_page comes from config and is passed into geared pagination.
admin/docs/index_pages.md Documents the new global setting and per-controller overrides.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread admin/docs/index_pages.md
Comment on lines +43 to +48
class SolidusAdmin::UsersController < SolidusAdmin::BaseController
# ...
def per_page
10
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Admin][UI][Pagination] Make the number of resources per page configurable on index pages

3 participants