Skip to content

Commit

Permalink
Fix issues with adding or editing chargeback rates
Browse files Browse the repository at this point in the history
fixing ManageIQ/manageiq#16699

Fix issues with adding new or editing existing chargeback rates in Cloud Intel
-> Chargeback -> Rates tab, caused by improper detail_index in the chargeback
rate edit table.
  • Loading branch information
hstastna committed Jan 2, 2018
1 parent 629f2d6 commit a2adf5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/views/chargeback/_cb_rate_edit_table.html.haml
Expand Up @@ -18,13 +18,14 @@
%th= _("Fixed")
%th= _("Variable")
%tbody
- @edit[:new][:details].sort_by { |rd| [rd[:group], rd[:description], rd[:sub_metric].to_s] }.each do |detail|
- @edit[:new][:details].sort_by { |rd| [rd[:group], rd[:description], rd[:sub_metric].to_s] }.each_with_index do |detail, detail_index|
- @cur_group = detail[:group] if @cur_group.nil?
- if @cur_group != detail[:group]
- @cur_group = detail[:group]
%tr
%td{:colspan => "10", :style => "background-color: #f5f5f5;"}  
- detail_index = @edit[:new][:tiers].index { |x| x.detect { |tier_hash| tier_hash['chargeback_rate_detail_id'] == detail[:id] }.present? }
- if params[:pressed] == "chargeback_rates_edit"
- detail_index = @edit[:new][:tiers].index { |x| x.detect { |tier_hash| tier_hash['chargeback_rate_detail_id'] == detail[:id] }.present? }
- num_tiers = @edit[:new][:tiers][detail_index].blank? ? "1" : @edit[:new][:tiers][detail_index].length.to_s

%tr.rdetail{:id => "rate_detail_row_#{detail_index}_0"}
Expand Down

0 comments on commit a2adf5c

Please sign in to comment.