Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

make modules/reporting/spec/features/update_entries_spec.rb pass locally

Christophe Bliarddc800aa014db
diff --git a/modules/reporting/lib/widget/table.rb b/modules/reporting/lib/widget/table.rb
index 42062fdf0b3..91bda7c6ae2 100644
--- a/modules/reporting/lib/widget/table.rb
+++ b/modules/reporting/lib/widget/table.rb
@@ -39,31 +39,13 @@ class Widget::Table < Widget::Base
end
def resolve_table
- if @subject.group_bys.size == 0
- self.class.detailed_table
- elsif @subject.group_bys.size == 1
- self.class.simple_table
+ if @subject.group_bys.empty?
+ Widget::Table::EntryTable
else
- self.class.fancy_table
+ Widget::Table::ReportTable
end
end
- def self.detailed_table(klass = nil)
- @@detail_table = klass if klass
- defined?(@@detail_table) ? @@detail_table : fancy_table
- end
-
- def self.simple_table(klass = nil)
- @@simple_table = klass if klass
- defined?(@@simple_table) ? @@simple_table : fancy_table
- end
-
- def self.fancy_table(klass = nil)
- @@fancy_table = klass if klass
- @@fancy_table
- end
- fancy_table Widget::Table::ReportTable
-
def render
write('<!-- table start -->')
if @subject.result.count <= 0
diff --git a/modules/reporting/lib/widget/table/entry_table.rb b/modules/reporting/lib/widget/table/entry_table.rb
index ba12ce4bfb2..3eebd2f8aa3 100644
--- a/modules/reporting/lib/widget/table/entry_table.rb
+++ b/modules/reporting/lib/widget/table/entry_table.rb
@@ -29,8 +29,6 @@
class ::Widget::Table::EntryTable < ::Widget::Table
FIELDS = %i[spent_on user_id activity_id work_package_id comments project_id]
- detailed_table self
-
def render
content = content_tag :div, class: 'generic-table--container -with-footer' do
content_tag :div, class: 'generic-table--results-container' do