-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
add params to collection filter #2005
add params to collection filter #2005
Conversation
To filter a collection you can define COLLECTION_FILTER and use them like "filter:". With this PR you can also params to those filter and use them like "filter:param". The COLLECTION_FILTER will be called with the params a second argument. This ideas was already mentioned in the initial PR for COLLECTION_FILTERS, but not implemented. (github.com/thoughtbot/pull/947)
Thank you for your PR @aka47 - I think it's good. Generally I'm inclined not to enhance the search, as I think it should be completely redesigned, but your change is a small increment of what we already have, so I think it's fine. Would you be able to make the following two changes before I merge this?
|
a filter like kind:vip and a terms like order:12 should not get confused.
…/aka47/administrate into add-params-to-collection-filters
@pablobm thanks for your feedback - sure filters and terms should not get confused. It needed a bit more changes then I thought, as the Query class does not have access to the Search Class and the valid_filters from the dashboard. |
FWIW this is great and I would love to see it released. I was running a hacky version of this in my local code to do the same. I get that search needs an overhaul, but until then something small like this would be a great incremental improvement in the meantime. |
Thank you @aka47! |
To filter a collection you can define COLLECTION_FILTER and use them like "filter:".
With this PR you can also params to those filter and use them like "filter:param". The COLLECTION_FILTER will be called with the params a second argument.
This ideas was already mentioned in the initial PR for COLLECTION_FILTERS, but not implemented. (#947)