mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
By default, some columns are hidden.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user