Skip to content

Commit

Permalink
Order Sub Metrics of Storage types in Rate editor
Browse files Browse the repository at this point in the history
fixing #2799

Order Sub Metrics of Storage types in Rate editor correctly when
editing newly created Chargeback Rate in Cloud Intel -> Chargeback
-> Rates.
  • Loading branch information
hstastna committed Nov 23, 2017
1 parent 963dbf9 commit 2b8ae25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/chargeback/_cb_rate_edit_table.html.haml
Expand Up @@ -18,12 +18,13 @@
%th= _("Fixed")
%th= _("Variable")
%tbody
- @edit[:new][:details].each_with_index do |detail, detail_index|
- @edit[:new][:details].sort_by { |rd| [rd[:group], rd[:description], rd[:sub_metric].to_s] }.each do |detail|
- @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? }
- 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 2b8ae25

Please sign in to comment.