Remove the report Subtype selector in the Rendering Options section

+ add all sub-reports in the index page
all of this is behind a feature toggle
This commit is contained in:
Jean-Baptiste Bellet
2022-05-31 15:51:10 +02:00
parent 78c2f76a3f
commit 214a470896
3 changed files with 16 additions and 9 deletions

View File

@@ -1,8 +1,12 @@
- if @report_subtypes.present? && @report_subtypes.count > 1
.row
.alpha.two.columns= label_tag nil, t(:report_type)
.omega.fourteen.columns
= select_tag(:report_subtype, options_for_select(@report_subtypes, @report_subtype))
- if feature?(:report_inverse_columns_logic, spree_current_user)
%input{type: 'hidden', name: 'report_subtype', value: @report_subtype}
- else
.row
.alpha.two.columns= label_tag nil, t(:report_type)
.omega.fourteen.columns
= select_tag(:report_subtype, options_for_select(@report_subtypes, @report_subtype))
- if @report.header_option? || @report.summary_row_option?
.row

View File

@@ -0,0 +1,5 @@
%ul{style: "margin-left: 12pt"}
- report_subtypes.each do |report_subtype|
%li
- url = main_app.admin_report_url(report_type: report_type, report_subtype: report_subtype[1])
= link_to report_subtype[0], url

View File

@@ -17,9 +17,7 @@
%td
- begin
= I18n.t!(:description, scope: [:admin, :reports, report_type])
- if feature? :report_inverse_columns_logic, spree_current_user
= render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type }
- rescue I18n::MissingTranslationData
%ul{style: "margin-left: 12pt"}
- report_subtypes.each do |report_subtype|
%li
- url = main_app.admin_report_url(report_type: report_type, report_subtype: report_subtype[1])
= link_to report_subtype[0], url
= render partial: "report_subtype", locals: { report_subtypes: report_subtypes, report_type: report_type }