By default, some columns are hidden.

This commit is contained in:
Jean-Baptiste Bellet
2022-10-20 14:46:07 +02:00
parent 02787e668f
commit edc667a336
2 changed files with 3 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ module Admin
# Initialize data
params[:display_summary_row] = true if request.get?
@params_fields_to_show = if request.get?
@report.columns.keys
@report.columns.keys - @report.fields_to_hide
else
params[:fields_to_show]
end

View File

@@ -251,6 +251,7 @@ describe Admin::ReportsController, type: :controller do
allow(report).to receive(:table_headers).and_return []
allow(report).to receive(:table_rows).and_return []
allow(report).to receive(:columns).and_return({})
allow(report).to receive(:fields_to_hide).and_return([])
spree_get :show, report_type: :products_and_inventory, test: "foo"
expect(assigns(:report)).to eq(report)
end
@@ -302,6 +303,7 @@ describe Admin::ReportsController, type: :controller do
allow(report).to receive(:table_headers).and_return []
allow(report).to receive(:table_rows).and_return []
allow(report).to receive(:columns).and_return({})
allow(report).to receive(:fields_to_hide).and_return([])
spree_get :show, report_type: :customers, test: "foo"
expect(assigns(:report)).to eq(report)
end