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

Sort by title but downcase

Oliver Güntherb82e53c884ed
diff --git a/app/menus/submenu.rb b/app/menus/submenu.rb
index 10c211b7c8b..81dfc572d86 100644
--- a/app/menus/submenu.rb
+++ b/app/menus/submenu.rb
@@ -49,7 +49,7 @@ class Submenu
.where("starred" => "t")
.pluck(:id, :name)
.map { |id, name| menu_item(name, query_params(id)) }
- .sort_by(&:title)
+ .sort_by { |item| item.title.downcase }
end
def default_queries
@@ -62,7 +62,7 @@ class Submenu
.where("public" => "t")
.pluck(:id, :name)
.map { |id, name| menu_item(name, query_params(id)) }
- .sort_by(&:title)
+ .sort_by { |item| item.title.downcase }
end
def custom_queries
@@ -71,7 +71,7 @@ class Submenu
.where("public" => "f")
.pluck(:id, :name)
.map { |id, name| menu_item(name, query_params(id)) }
- .sort_by(&:title)
+ .sort_by { |item| item.title.downcase }
end
def base_query
diff --git a/modules/boards/app/menus/boards/menu.rb b/modules/boards/app/menus/boards/menu.rb
index 12b3cabd807..d72e323f3ba 100644
--- a/modules/boards/app/menus/boards/menu.rb
+++ b/modules/boards/app/menus/boards/menu.rb
@@ -42,7 +42,7 @@ module Boards
.where(project: @project)
.pluck(:id, :name)
.map { |id, name| menu_item(name, query_params(id)) }
- .sort_by(&:title)
+ .sort_by { |item| item.title.downcase }
end
def starred_queries
diff --git a/modules/reporting/app/menus/cost_reports/menu.rb b/modules/reporting/app/menus/cost_reports/menu.rb
index 76aa9e8d9ad..100f70925e3 100644
--- a/modules/reporting/app/menus/cost_reports/menu.rb
+++ b/modules/reporting/app/menus/cost_reports/menu.rb
@@ -47,14 +47,14 @@ module CostReports
CostQuery.public(project)
.pluck(:id, :name)
.map { |id, name| menu_item(name, query_params(id)) }
- .sort_by(&:title)
+ .sort_by { |item| item.title.downcase }
end
def custom_queries
CostQuery.private(project, User.current)
.pluck(:id, :name)
.map { |id, name| menu_item(name, query_params(id)) }
- .sort_by(&:title)
+ .sort_by { |item| item.title.downcase }
end
def selected?(query_params)