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

[Admin] Add dynamic filters to ui/table component #5376

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Introduce new filters for the products index
  • Loading branch information
rainerdema authored and elia committed Oct 10, 2023
commit ca9e9f8cd7895c7b9bdcbd8a308288f27cb0b566
19 changes: 13 additions & 6 deletions admin/app/components/solidus_admin/products/index/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,20 @@ def batch_actions
end

def filters
[
Spree::OptionType.all.map do |option_type|
{
name: 'q[with_discarded]',
value: true,
label: t('.filters.with_deleted'),
},
]
presentation: option_type.presentation,
combinator: 'or',
attribute: "variants_option_values",
predicate: "in",
options: option_type.option_values.map do |option_value|
[
option_value.name,
option_value.id
]
end
}
end
end

def columns
Expand Down