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

Boyscouting: Make Meeting Index page sortable by projects

Klaus Zanders283d846a9e65
diff --git a/modules/meeting/app/components/meetings/row_component.rb b/modules/meeting/app/components/meetings/row_component.rb
index a2bb3f670c3..c734426499b 100644
--- a/modules/meeting/app/components/meetings/row_component.rb
+++ b/modules/meeting/app/components/meetings/row_component.rb
@@ -30,7 +30,7 @@
module Meetings
class RowComponent < ::RowComponent
- def project
+ def project_id
helpers.link_to_project model.project, {}, {}, false
end
diff --git a/modules/meeting/app/components/meetings/table_component.rb b/modules/meeting/app/components/meetings/table_component.rb
index 6d33134a7bd..45f525f005c 100644
--- a/modules/meeting/app/components/meetings/table_component.rb
+++ b/modules/meeting/app/components/meetings/table_component.rb
@@ -32,7 +32,7 @@ module Meetings
class TableComponent < ::TableComponent
options :current_project # used to determine if displaying the projects column
- sortable_columns :title, :start_time, :duration, :location
+ sortable_columns :title, :project_id, :start_time, :duration, :location
def initial_sort
%i[start_time asc]
@@ -45,7 +45,7 @@ module Meetings
def headers
@headers ||= [
[:title, { caption: Meeting.human_attribute_name(:title) }],
- current_project.blank? ? [:project, { caption: Meeting.human_attribute_name(:project) }] : nil,
+ current_project.blank? ? [:project_id, { caption: Meeting.human_attribute_name(:project) }] : nil,
[:start_time, { caption: Meeting.human_attribute_name(:start_time) }],
[:duration, { caption: Meeting.human_attribute_name(:duration) }],
[:location, { caption: Meeting.human_attribute_name(:location) }]
diff --git a/modules/meeting/lib/open_project/meeting/engine.rb b/modules/meeting/lib/open_project/meeting/engine.rb
index 0f7ce736fe7..e8b8fcf1f66 100644
--- a/modules/meeting/lib/open_project/meeting/engine.rb
+++ b/modules/meeting/lib/open_project/meeting/engine.rb
@@ -64,7 +64,7 @@ module OpenProject::Meeting
icon: 'meetings'
menu :top_menu,
- :meetings, { controller: '/meetings', project_id: nil, action: 'index' },
+ :meetings, { controller: '/meetings', action: 'index', project_id: nil },
context: :modules,
caption: :label_meeting_plural,
if: Proc.new {