Merge branch 'feature/progress_report' of https://dev.finn.de/git/reporting-engine into feature/progress_report

Conflicts:
	assets/javascripts/reporting/controls.js
	config/locales/en.yml
	lib/widget/table/progressbar.rb
pull/6827/head
jwollert 14 years ago
commit fca3a766ab
  1. 4
      config/locales/de.yml
  2. 4
      config/locales/en.yml
  3. 18
      lib/report.rb

@ -7,6 +7,8 @@ de:
label_report: "Report" label_report: "Report"
label_columns: "Spalten" label_columns: "Spalten"
label_rows: "Zeilen" label_rows: "Zeilen"
label_yes: Ja
label_no: Nein
label_group_by: "Gruppieren nach" label_group_by: "Gruppieren nach"
label_group_by_add: "Gruppierung hinzufügen" label_group_by_add: "Gruppierung hinzufügen"
@ -22,3 +24,5 @@ de:
validation_failure_date: "ist kein gültiges Datum" validation_failure_date: "ist kein gültiges Datum"
validation_failure_integer: "ist keine ganze Zahl" validation_failure_integer: "ist keine ganze Zahl"
load_query_question: "Der Report wird %{size} Tabellen-Zellen haben, was sehr rechenintensiv sein kann. Wollen Sie dennoch versuchen, den Report durch zu führen?"

@ -13,6 +13,8 @@ en:
label_filter: "Filter" label_filter: "Filter"
label_filter_plural: "Filters" label_filter_plural: "Filters"
label_filter_add: Add Filter label_filter_add: Add Filter
label_yes: "Yes"
label_no: "No"
label_count: Count label_count: Count
label_sum: Sum label_sum: Sum
@ -22,3 +24,5 @@ en:
validation_failure_date: "is not a valid date" validation_failure_date: "is not a valid date"
validation_failure_integer: "is not a valid integer" validation_failure_integer: "is not a valid integer"
load_query_question: "Report will have %{size} table cells and may take some time to render. Do you still want to try rendering it?"

@ -123,7 +123,7 @@ class Report < ActiveRecord::Base
def_delegators :transformer, :column_first, :row_first def_delegators :transformer, :column_first, :row_first
def_delegators :chain, :empty_chain, :top, :bottom, :chain_collect, :sql_statement, :all_group_fields, :child, :clear, :result def_delegators :chain, :empty_chain, :top, :bottom, :chain_collect, :sql_statement, :all_group_fields, :child, :clear, :result
def_delegators :result, :each_direct_result, :recursive_each, :recursive_each_with_level, :each, :each_row, :count, def_delegators :result, :each_direct_result, :recursive_each, :recursive_each_with_level, :each, :each_row, :count,
:units, :size, :final_number :units, :final_number
def_delegators :table, :row_index, :colum_index def_delegators :table, :row_index, :colum_index
def to_a def to_a
@ -134,21 +134,27 @@ class Report < ActiveRecord::Base
chain.to_s chain.to_s
end end
def size
size = 0
recursive_each {|r| size += r.size }
size
end
def hash def hash
report_string = "" report_string = ""
report_string.concat('filters: [') report_string.concat('filters: [')
report_string.concat(filters.map { |f| report_string.concat(filters.map { |f|
f.class.underscore_name + f.operator.to_s + (f.values ? f.values.to_json : "") f.class.underscore_name + f.operator.to_s + (f.values ? f.values.to_json : "")
}.sort.join(', ')) }.sort.join(', '))
report_string.concat(']') report_string.concat(']')
report_string.concat(', group_bys: {') report_string.concat(', group_bys: {')
report_string.concat(group_bys.group_by(&:type).map { |t, gbs| report_string.concat(group_bys.group_by(&:type).map { |t, gbs|
"#{t} : [#{gbs.collect(&:class).collect(&:underscore_name).join(', ')}]" "#{t} : [#{gbs.collect(&:class).collect(&:underscore_name).join(', ')}]"
}.join(', ')) }.join(', '))
report_string.concat('}') report_string.concat('}')
report_string.hash report_string.hash

Loading…
Cancel
Save