diff --git a/admin/app/components/solidus_admin/orders/index/component.rb b/admin/app/components/solidus_admin/orders/index/component.rb index 456f2d64e44..3414e18d508 100644 --- a/admin/app/components/solidus_admin/orders/index/component.rb +++ b/admin/app/components/solidus_admin/orders/index/component.rb @@ -28,9 +28,65 @@ def batch_actions def filters [ { - name: 'q[completed_at_not_null]', - value: 1, - label: t('.filters.only_show_complete_orders'), + presentation: t('.filters.status'), + combinator: 'or', + attribute: "state", + predicate: "eq", + options: Spree::Order.state_machines[:state].states.map do |state| + [ + state.value.titleize, + state.value + ] + end + }, + + { + presentation: t('.filters.shipment_state'), + combinator: 'or', + attribute: "shipment_state", + predicate: "eq", + options: %i[backorder canceled partial pending ready shipped].map do |option| + [ + option.to_s.capitalize, + option + ] + end + }, + { + presentation: t('.filters.payment_state'), + combinator: 'or', + attribute: "payment_state", + predicate: "eq", + options: %i[balance_due checkout completed credit_owed invalid paid pending processing void].map do |option| + [ + option.to_s.titleize, + option + ] + end + }, + { + presentation: t('.filters.variants'), + combinator: 'or', + attribute: "line_items_variant_id", + predicate: "in", + options: Spree::Variant.all.map do |variant| + [ + variant.descriptive_name, + variant.id + ] + end + }, + { + presentation: t('.filters.promotions'), + combinator: 'or', + attribute: "promotions_id", + predicate: "in", + options: Spree::Promotion.all.map do |promotion| + [ + promotion.name, + promotion.id + ] + end }, ] end diff --git a/admin/app/components/solidus_admin/orders/index/component.yml b/admin/app/components/solidus_admin/orders/index/component.yml index 370e0d25504..a94a884aa5e 100644 --- a/admin/app/components/solidus_admin/orders/index/component.yml +++ b/admin/app/components/solidus_admin/orders/index/component.yml @@ -7,7 +7,11 @@ en: one: 1 Item other: '%{count} Items' filters: - only_show_complete_orders: Only show complete orders + status: Status + shipment_state: Shipment State + payment_state: Payment State + variants: Variants + promotions: Promotions date: formats: short: '%d %b %y'