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
[RFC] Dynamic filters 2.0 #2268
Milestone
Comments
adrianthedev
added
Front end
Back end
Task
Something to get done
DSL-related
Feature
labels
Dec 20, 2023
Closed
Experiments self.dynamic_filters = {
fields: [:status, :state],
filters: [
# hierarchy
# - database
# - field
# - dynamic_filters
avo_filter(attribute: :name, type: :select),
Avo::Filter.new(attribute: :name, type: :select),
Avo::Filter.new(attribute: :name, type: :select),
Avo::Filter.new(attribute: :name, type: :select),
Avo::Filter.new(attribute: :name, type: :select),
{
attribute: :name,
type: :select,
conditions: [:is, :present, :blank, :nil],
field: {
type: :select,
options: [:one, :two, :three]
},
# fields: [{
# id: :first_name,
# type: :select,
# options: [:one, :two, :three]
# },{
# id: :last_name,
# type: :select,
# options: [:one, :two, :three]
# }]
},
{
attribute: :last_name,
type: :select,
conditions: [:is, :present, :blank, :nil],
field: {
type: :select,
options: [:one, :two, :three]
}
}
]
}
filterable: Avo::Filter.new(attribute: :name, type: :select), |
@adrianthedev do you plan for some lazy loading version? Or even a belongs-to type? |
Yes @jetienne. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The Dynamic filters feature is a powerful and beautiful way of letting users query data.
We'd love to give the developer an API with which they can further customize the filters.
Some of the things we'd like to have customizable:
Let's also change the API in which they are declared. It's clear to me that just calling
filterable
is not enough. It's a good "easy" way to do it, but we need more power.Things to consider with this new API/DSL:
Related issues
Examples
Pseudo-API below. Not final.
The text was updated successfully, but these errors were encountered: