From c3e90b86c84acff7025c9670fb56facf8e40fea8 Mon Sep 17 00:00:00 2001 From: Rainer Dema Date: Wed, 2 Aug 2023 17:46:13 +0200 Subject: [PATCH] Add filter for discarded products Changes include: - Addition of new filter in `filters` method in the products index component, now includes an additional filter for 'with_discarded' products. Please note that this is a special case of filters in the context of transitioning from the old to the new products index page. This change ensures that the feature set between the old and new product index page remains consistent. Co-Authored-By: Elia Schito --- .../components/solidus_admin/products/index/component.rb | 8 +++++++- .../components/solidus_admin/products/index/component.yml | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/admin/app/components/solidus_admin/products/index/component.rb b/admin/app/components/solidus_admin/products/index/component.rb index b3c489aa4cd..b087e9d562f 100644 --- a/admin/app/components/solidus_admin/products/index/component.rb +++ b/admin/app/components/solidus_admin/products/index/component.rb @@ -48,7 +48,13 @@ def batch_actions end def filters - [] + [ + { + name: 'q[with_discarded]', + value: true, + label: t('.filters.with_deleted'), + }, + ] end def columns diff --git a/admin/app/components/solidus_admin/products/index/component.yml b/admin/app/components/solidus_admin/products/index/component.yml index 68d285282ae..8e7beaac206 100644 --- a/admin/app/components/solidus_admin/products/index/component.yml +++ b/admin/app/components/solidus_admin/products/index/component.yml @@ -12,3 +12,5 @@ en: delete: 'Delete' discontinue: 'Discontinue' activate: 'Activate' + filters: + with_deleted: Include deleted