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

Attempt to move adding to the menu to the engine instead of core initializer

Klaus Zandersd308262ce1c5
diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb
index 8dacfa355be..ce7a764f5d8 100644
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@ -55,6 +55,9 @@ Redmine::MenuManager.map :top_menu do |menu|
User.current.allowed_to_globally?(:view_news)
}
+ # TODO: This should be put in modules/meeting/../engine.rb, but if it is put
+ # in there, it causes a NameError because `Setting` that is used by FeatureDecisions
+ # is not loaded yet. So, let's see what to do here...
if OpenProject::FeatureDecisions.more_global_index_pages_active?
menu.push :meetings,
{ controller: '/meetings', project_id: nil, action: 'index' },
diff --git a/modules/meeting/lib/open_project/meeting/engine.rb b/modules/meeting/lib/open_project/meeting/engine.rb
index 85114b8bdf5..be4a0cc4cd2 100644
--- a/modules/meeting/lib/open_project/meeting/engine.rb
+++ b/modules/meeting/lib/open_project/meeting/engine.rb
@@ -63,6 +63,17 @@ module OpenProject::Meeting
before: :members,
icon: 'meetings'
+ # if OpenProject::FeatureDecisions.more_global_index_pages_active?
+ # menu :top_menu,
+ # :meetings, { controller: '/meetings', project_id: nil, action: 'index' },
+ # context: :modules,
+ # caption: I18n.t('label_meetings_plural'),
+ # if: Proc.new {
+ # (User.current.logged? || !Setting.login_required?) &&
+ # User.current.allowed_to_globally?(:view_meetings)
+ # }
+ # end
+
ActiveSupport::Inflector.inflections do |inflect|
inflect.uncountable 'meeting_minutes'
end