Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !2096

Make search easier to override and adapt to custom use cases

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Pablo Brasero requested to merge github/fork/pablobm/overridable-search into main Dec 25, 2021
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 3

Seeing https://github.com/thoughtbot/administrate/issues/2063 made me think about quick ways to customise Administrate's search.

I realised that Administrate::ApplicationController#index doesn't make it easy to override the way that search is performed, so this seems like a first "obvious" port of entry.

By factoring out lines 8-10 into their own method, now we can do things like shown in the provided spec. This should be enough for everyone to adapt the search to their own use case.

In the future, we can try rework Administrate::Order into something more configurable and "better". However we all know this is long term future, so this PR should get us going, for a long way, until then.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pablobm/overridable-search