From a094a89c09840cf121756fc2065e6ed33cf1297b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 20 Jul 2023 15:31:38 +0200 Subject: [PATCH] Mark "Inventory (on hand)" report as deprecated Co-Authored-By: Maikel , @dacook --- app/views/admin/reports/_report_subtype.html.haml | 5 ++++- config/locales/en.yml | 1 + lib/reporting/reports/list.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) 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 624defa10d..872f6cbf26 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1453,6 +1453,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