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
Add the `Activity` items to the global menu
Aaron Contrerasd1aa21783ae1
diff --git a/app/controllers/activities_controller.rb b/app/controllers/activities_controller.rbindex 1ec234df12f..0fc2c11dcb7 100644--- a/app/controllers/activities_controller.rb+++ b/app/controllers/activities_controller.rb@@ -105,7 +105,7 @@ class ActivitiesController < ApplicationControllerenddef respond_html- render locals: { menu_name: project_or_global_activity_menu }+ render locals: { menu_name: project_or_global_menu }enddef respond_atomdiff --git a/app/controllers/concerns/layout.rb b/app/controllers/concerns/layout.rbindex bd1b13f8b56..93641495fcc 100644--- a/app/controllers/concerns/layout.rb+++ b/app/controllers/concerns/layout.rb@@ -47,13 +47,5 @@ module Layout:global_menuendend-- def project_or_global_activity_menu- if @project- :project_menu- else- :global_activities_menu- end- endendenddiff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex b95e5a7b3ea..f0d087eedf3 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -126,6 +126,17 @@ Redmine::MenuManager.map :global_menu do |menu|menu.push :home,{ controller: '/homescreen', action: 'index' },icon: 'home'++ # Activity+ menu.push :activity,+ { controller: '/activities', action: 'index' },+ icon: 'checkmark'++ menu.push :activity_filters,+ { controller: '/activities', action: 'index' },+ parent: :activity,+ partial: 'activities/filters_menu'+# Work packagesmenu.push :work_packages,{ controller: '/work_packages', action: 'index' },diff --git a/spec/features/activities/activity_page_navigation_spec.rb b/spec/features/activities/activity_page_navigation_spec.rbindex 98cfb6daf60..d0cb5da7be5 100644--- a/spec/features/activities/activity_page_navigation_spec.rb+++ b/spec/features/activities/activity_page_navigation_spec.rb@@ -28,7 +28,7 @@require 'spec_helper'-RSpec.describe 'Activity page navigation', js: true do+RSpec.describe 'Activity page navigation', :js, :with_cuprite doinclude ActiveSupport::Testing::TimeHelpersshared_let(:project) { create(:project, enabled_module_names: Setting.default_projects_modules + ['activity']) }@@ -59,6 +59,18 @@ RSpec.describe 'Activity page navigation', js: true docurrent_user { user }+ describe 'global menu item' do+ it 'allows navigating to the global activity page' do+ visit root_path++ within '#main-menu' do+ click_link 'Activity'+ end++ expect(page).to have_current_path(activity_index_path)+ end+ end+it 'stays on the same period when changing filters' dovisit project_activity_index_path(project)click_link('Previous')diff --git a/spec/lib/redmine/menu_manager_spec.rb b/spec/lib/redmine/menu_manager_spec.rbindex 94ea1d6381b..a0e75dcad8f 100644--- a/spec/lib/redmine/menu_manager_spec.rb+++ b/spec/lib/redmine/menu_manager_spec.rb@@ -52,7 +52,7 @@ RSpec.describe Redmine::MenuManager docontext 'for the global_menu' doit 'includes the expected items' doexpect(described_class.items(:global_menu).map(&:name))- .to include(:home, :work_packages, :cost_reports_global)+ .to include(:home, :activity, :work_packages, :cost_reports_global)endend