avo
avo copied to clipboard
Is it possible to send parameters to filters and actions?
Context
I'd like to have a way to send parameters to filters and actions, so I can work on generic actions and filters. Sometimes, when dealing with a lot of tables, building a filter/action for every table becomes way too time consuming and hurts DRY.
For example, something like this:
action ExportToCsv, fields: [:name, :id]
filter LikeFilter, fields: [:name, :description]
System configuration
Avo version: 2.15.3
Rails version: 7.0.3.1
Ruby version: 3.1.2
License type:
- [ ] Community
- [x] Pro
No, it's not currently possible, but that's a great feature to have. Similar to what you can do with cards right now. I'll add it to the roadmap.
Thanks for the recommendation.
Is it possible to have a rough estimate on when we going to have this?
Probably in a few weeks (6-8 weeks). We're trying to finish some work we already started working on.
We are open to receiving PRs with this feature if you want to take a shot. I'm happy to help you navigate the codebase.
Nice! I'd be very happy to help, but I've been quite busy lately. I will definitely try.
This issue has been marked as stale because there was no activity for the past 15 days.
sonuds good to me, in my case, I would like to tell a model class to filter, with that, I can populate options with some constant, eg:
class Model
STATUSES = {pending: "pending", done: "done"}
end
class StatusFilter < Avo::Filters::SelectFilter
def apply
....
end
def options
# get options
end
end
filter StatusFilter, options: Model::STATUSES
it's good because each resource can modify the list of options when add a filter