Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make search easier to override and adapt to custom use cases #2096

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

pablobm
Copy link
Collaborator

@pablobm pablobm commented Dec 25, 2021

Seeing #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.

@pablobm pablobm force-pushed the overridable-search branch from 699b4b7 to 43d909b Compare January 11, 2022 17:35
Copy link
Member

@nickcharlton nickcharlton left a comment

Choose a reason for hiding this comment

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

This looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants