Skip to content

Commit

Permalink
Repairs compare cluster's counter
Browse files Browse the repository at this point in the history
Computes counter in brackets when "same" or "diff" filter used

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1469111
  • Loading branch information
slemrmartin committed Mar 12, 2018
1 parent 8b7a5ad commit c3031a4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion app/controllers/application_controller/compare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,21 @@ def comp_add_total(view)
def comp_add_section(view, section, records, fields)
cell_text = _(section[:header])
if records.nil? # Show records count if not nil
cell_text += " (#{fields.length})"

# If fields are filtered (attributes with same/different values)
# number of total fields has to be precomputed
fields_length = 0
fields.each_with_index do |field, _fidx|
@same = true
if @compressed # Compressed
comp_add_section_field_compressed(view, section, field)
else # Expanded
comp_add_section_field_expanded(view, section, field)
end
fields_length += 1 if compare_delete_row
end
@same = true # reset for further processing
cell_text += " (#{fields_length})"
else # Show fields count
cell_text += " (#{records.length})"
end
Expand Down

0 comments on commit c3031a4

Please sign in to comment.