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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Ensure Meeting Index Pages sort by `project_name`
Aaron Contreras0b3d9d3e3aa0
diff --git a/modules/meeting/app/components/meetings/row_component.rb b/modules/meeting/app/components/meetings/row_component.rbindex bc384ecb100..8d2d060c74e 100644--- a/modules/meeting/app/components/meetings/row_component.rb+++ b/modules/meeting/app/components/meetings/row_component.rb@@ -30,7 +30,7 @@module Meetingsclass RowComponent < ::RowComponent- def project_id+ def project_namehelpers.link_to_project model.project, {}, {}, falseenddiff --git a/modules/meeting/app/components/meetings/table_component.rb b/modules/meeting/app/components/meetings/table_component.rbindex c2a755c41e5..3f13143ac51 100644--- a/modules/meeting/app/components/meetings/table_component.rb+++ b/modules/meeting/app/components/meetings/table_component.rb@@ -32,17 +32,20 @@ module Meetingsclass TableComponent < ::TableComponentoptions :current_project # used to determine if displaying the projects column- sortable_columns :title, :project_id, :start_time, :duration, :location+ sortable_columns :title, :project_name, :start_time, :duration, :locationdef initial_sort%i[start_time asc]end+ def sortable_columns_correlation+ super.merge(project_name: 'projects.name')+ end+def initialize_sorted_modelhelpers.sort_clear- helpers.sort_init *initial_sort.map(&:to_s)- helpers.sort_update disambiguated_sortable_columns- @model = paginate_collection apply_sort(model)++ superenddef paginated?@@ -52,7 +55,7 @@ module Meetingsdef headers@headers ||= [[:title, { caption: Meeting.human_attribute_name(:title) }],- current_project.blank? ? [:project_id, { caption: Meeting.human_attribute_name(:project) }] : nil,+ current_project.blank? ? [:project_name, { 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) }]@@ -62,12 +65,5 @@ module Meetingsdef columns@columns ||= headers.map(&:first)end-- private-- def disambiguated_sortable_columns- sortable_columns.to_h { [_1.to_s, _1.to_s] }- .merge('project_id' => 'meetings.project_id')- endendend