Skip to content

Commit

Permalink
Customizable chart top values (dropdown choices)
Browse files Browse the repository at this point in the history
Signed-off-by: Hiro Miyamoto <miyamotoh@us.ibm.com>
  • Loading branch information
miyamotoh committed Jun 16, 2023
1 parent bacd478 commit 2594c31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/report_controller/reports/editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module ReportController::Reports::Editor
DEFAULT_PDF_PAGE_SIZE = "US-Letter".freeze

MAX_REPORT_COLUMNS = 100 # Default maximum number of columns in a report
GRAPH_MAX_COUNT = 10
GRAPH_MAX_COUNT = ::Settings.reporting.chart_top_values || 10

CHAREGEBACK_ALLOCATED_METHODS = {
:max => N_('Maximum'),
Expand Down Expand Up @@ -653,7 +653,7 @@ def gfv_charts
end

if params[:chosen_count] && params[:chosen_count] != @edit[:new][:graph_count]
@edit[:new][:graph_count] = params[:chosen_count]
@edit[:new][:graph_count] = params[:chosen_count].to_i
@refresh_div = "chart_sample_div"
@refresh_partial = "form_chart_sample"
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/report_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
end

it "sets top values to show" do
top_val = "3"
top_val = 3
controller.params = {:chosen_count => top_val}
controller.send(:gfv_charts)
expect(assigns(:edit)[:new][:graph_count]).to eq(top_val)
Expand Down

0 comments on commit 2594c31

Please sign in to comment.