diff --git a/app/views/admin/reports/_report_subtype.html.haml b/app/views/admin/reports/_report_subtype.html.haml index c043c68e61..216300d5d3 100644 --- a/app/views/admin/reports/_report_subtype.html.haml +++ b/app/views/admin/reports/_report_subtype.html.haml @@ -2,4 +2,7 @@ - report_subtypes.each do |report_subtype| %li - url = main_app.admin_report_path(report_type: report_type, report_subtype: report_subtype[1]) - = link_to report_subtype[0], url + - if report_subtype.dig(2, :deprecated) + %strike= link_to report_subtype[0], url, title: t('admin.reports.deprecated') + - else + = link_to report_subtype[0], url diff --git a/config/locales/en.yml b/config/locales/en.yml index 8ca1b63541..576ee71bd4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1458,6 +1458,7 @@ en: email_confirmation: "Email confirmation is pending. We've sent a confirmation email to %{email}." not_visible: "%{enterprise} is not visible and so cannot be found on the map or in searches" reports: + deprecated: "This report is deprecated and will be removed in a future release." hidden: HIDDEN unitsize: UNITSIZE total: TOTAL diff --git a/lib/reporting/reports/list.rb b/lib/reporting/reports/list.rb index 23489baf00..84e3a1ed41 100644 --- a/lib/reporting/reports/list.rb +++ b/lib/reporting/reports/list.rb @@ -40,7 +40,7 @@ module Reporting def products_and_inventory_report_types [ [i18n_translate("all_products"), :all_products], - [i18n_translate("inventory"), :inventory], + [i18n_translate("inventory"), :inventory, { deprecated: true }], [i18n_translate("lettuce_share"), :lettuce_share] ] end diff --git a/lib/reporting/reports/products_and_inventory/all_products.rb b/lib/reporting/reports/products_and_inventory/all_products.rb index 8ec06fded7..2471e4c673 100644 --- a/lib/reporting/reports/products_and_inventory/all_products.rb +++ b/lib/reporting/reports/products_and_inventory/all_products.rb @@ -4,10 +4,6 @@ module Reporting module Reports module ProductsAndInventory class AllProducts < Base - def default_params - { fields_to_hide: [:on_demand, :on_hand] } - end - def message I18n.t("spree.admin.reports.products_and_inventory.all_products.message") end diff --git a/spec/system/admin/reports_spec.rb b/spec/system/admin/reports_spec.rb index c11eb5ee69..6264aaee39 100644 --- a/spec/system/admin/reports_spec.rb +++ b/spec/system/admin/reports_spec.rb @@ -423,22 +423,23 @@ describe ' expect(page).to have_content "Supplier" expect(page).to have_table_row ["Supplier", "Producer Suburb", "Product", "Product Properties", "Taxons", "Variant Value", "Price", - "Group Buy Unit Quantity", "Amount", "SKU"].map(&:upcase) + "Group Buy Unit Quantity", "Amount", "SKU", + "On demand?", "On hand"].map(&:upcase) expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), product1.primary_taxon.name, "1g", "100.0", - "none", "", "sku1"] + "none", "", "sku1", "No", "10"] expect(page).to have_table_row [product1.supplier.name, product1.supplier.address.city, "Product Name", product1.properties.map(&:presentation).join(", "), product1.primary_taxon.name, "1g", "80.0", - "none", "", "sku2"] + "none", "", "sku2", "No", "20"] expect(page).to have_table_row [product2.supplier.name, product1.supplier.address.city, "Product 2", product1.properties.map(&:presentation).join(", "), product2.primary_taxon.name, "100g", "99.0", - "none", "", "product_sku"] + "none", "", "product_sku", "No", "9"] end it "shows the LettuceShare report" do