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
Register `global_menu` and `global` layout
Aaron Contreras7d6c48059d25
diff --git a/app/views/layouts/global.html.erb b/app/views/layouts/global.html.erbnew file mode 100644index 00000000000..06a2fb8a49b--- /dev/null+++ b/app/views/layouts/global.html.erb@@ -0,0 +1,30 @@+<%#-- copyright+OpenProject is an open source project management software.+Copyright (C) 2012-2023 the OpenProject GmbH++This program is free software; you can redistribute it and/or+modify it under the terms of the GNU General Public License version 3.++OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+Copyright (C) 2006-2013 Jean-Philippe Lang+Copyright (C) 2010-2013 the ChiliProject Team++This program is free software; you can redistribute it and/or+modify it under the terms of the GNU General Public License+as published by the Free Software Foundation; either version 2+of the License, or (at your option) any later version.++This program is distributed in the hope that it will be useful,+but WITHOUT ANY WARRANTY; without even the implied warranty of+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+GNU General Public License for more details.++You should have received a copy of the GNU General Public License+along with this program; if not, write to the Free Software+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.++See COPYRIGHT and LICENSE files for more details.++++#%>++<%= render template: "layouts/base", locals: { menu_name: :global_menu } %>diff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex de4ca0e58fc..e27f3b10260 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -121,6 +121,8 @@ Redmine::MenuManager.map :account_menu do |menu|if: Proc.new { User.current.logged? }end+Redmine::MenuManager.map :global_menu+Redmine::MenuManager.map :global_work_packages_menu do |menu|menu.push :work_packages_query_select,{ controller: '/work_packages', action: 'index' },diff --git a/spec/lib/redmine/menu_manager_spec.rb b/spec/lib/redmine/menu_manager_spec.rbindex 80d1698c6ed..6f9198c8b0b 100644--- a/spec/lib/redmine/menu_manager_spec.rb+++ b/spec/lib/redmine/menu_manager_spec.rb@@ -49,6 +49,14 @@ RSpec.describe Redmine::MenuManager doendend+ context 'for the global_menu' do+ it 'includes the expected items' do+ pending ':home menu item missing in the menu'+ expect(described_class.items(:global_menu).map(&:name))+ .to include(:home)+ end+ end+context 'for the global_work_packages_menu' doit 'includes the expected items' doexpect(described_class.items(:global_work_packages_menu).map(&:name))