Packing Report: Refactor view to be reusable by other reports

For now this view is used only in the context of packing, but later we would move all existing rpeort to use same view
This commit is contained in:
Sebastian Castro
2022-03-23 09:01:29 +00:00
committed by Jean-Baptiste Bellet
parent 1ff98a1d8a
commit d53d38906a
7 changed files with 48 additions and 42 deletions

View File

@@ -30,7 +30,7 @@ module Admin
assign_view_data
load_form_options
render report_type
render "show"
end
def assign_view_data
@@ -39,6 +39,9 @@ module Admin
@report_subtypes = report_class.report_subtypes.map do |subtype|
[t("packing.#{subtype}_report", scope: i18n_scope), subtype]
end
if @report_type == "packing"
@report_message = I18n.t("spree.admin.reports.customer_names_message.customer_names_tip")
end
end
def load_form_options