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 Calendar Index Pages sort by `project_name`
Aaron Contrerase10d207de009
diff --git a/modules/calendar/app/components/calendar/row_component.rb b/modules/calendar/app/components/calendar/row_component.rbindex 17f7e5433c7..040f3f43d79 100644--- a/modules/calendar/app/components/calendar/row_component.rb+++ b/modules/calendar/app/components/calendar/row_component.rb@@ -38,7 +38,7 @@ module Calendarlink_to query.name, project_calendar_path(project, query.id)end- def project_id+ def project_namelink_to project.name, project_path(project)enddiff --git a/modules/calendar/app/components/calendar/table_component.rb b/modules/calendar/app/components/calendar/table_component.rbindex dfe47166c09..a9553381d6a 100644--- a/modules/calendar/app/components/calendar/table_component.rb+++ b/modules/calendar/app/components/calendar/table_component.rb@@ -30,7 +30,11 @@ module Calendarclass TableComponent < ::TableComponentoptions :current_project, :current_user- sortable_columns :name, :project_id, :created_at+ sortable_columns :name, :project_name, :created_at++ def sortable_columns_correlation+ super.merge(project_name: 'projects.name')+ enddef initial_sort%i[name asc]@@ -42,9 +46,9 @@ module Calendardef headers@headers ||= [- ['name', { caption: I18n.t(:label_name) }],- current_project.blank? ? ['project_id', { caption: I18n.t('attributes.project') }] : nil,- ['created_at', { caption: I18n.t('attributes.created_at') }]+ [:name, { caption: I18n.t(:label_name) }],+ current_project.blank? ? [:project_name, { caption: I18n.t('attributes.project') }] : nil,+ [:created_at, { caption: I18n.t('attributes.created_at') }]].compactenddiff --git a/modules/calendar/app/controllers/calendar/calendars_controller.rb b/modules/calendar/app/controllers/calendar/calendars_controller.rbindex 6bbe71d7e61..c12ea9c21e9 100644--- a/modules/calendar/app/controllers/calendar/calendars_controller.rb+++ b/modules/calendar/app/controllers/calendar/calendars_controller.rb@@ -93,7 +93,7 @@ module ::Calendardef visible_viewsbase_query = Query.visible(current_user)- .joins(:views)+ .joins(:views, :project).where('views.type' => 'work_packages_calendar')if @project