Skip to content

Commit

Permalink
Merge pull request #1170 from jntullo/bz/style_report_columns
Browse files Browse the repository at this point in the history
Parse the column/field name correctly in reports
  • Loading branch information
Dan Clarizio authored Jun 7, 2017
2 parents ba8bd2e + c85cea2 commit 7da9572
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/report_controller/reports/editor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def gfv_key_style(key, value)
f = @edit[:new][:field_order][f_idx] # Get the field element
field_sub_type = MiqExpression.get_col_info(f.last)[:format_sub_type]
field_data_type = MiqExpression.get_col_info(f.last)[:data_type]
field_name = f.last.include?(".") ? f.last.split(".").last.tr("-", ".") : f.last.split("-").last
field_name = MiqExpression.parse_field_or_tag(f.last).report_column
case parm
when "style" # New CSS class chosen
if value.blank?
Expand Down
2 changes: 1 addition & 1 deletion app/views/report/_form_styling.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
%tbody
- @edit[:new][:field_order].each_with_index do |f, f_idx|
- field_type = MiqExpression.get_col_info(f.last.split("__").first)[:format_sub_type]
- col_name = f.last.include?(".") ? f.last.split(".").last.gsub("-", ".") : f.last.split("-").last
- col_name = MiqExpression.parse_field_or_tag(f.last).report_column
- styles = @edit.fetch_path(:new, :col_options, col_name, :style) || []
%tr
%td
Expand Down

0 comments on commit 7da9572

Please sign in to comment.