diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb index e52606a27690..a0b9cb130832 100644 --- a/config/initializers/menus.rb +++ b/config/initializers/menus.rb @@ -43,6 +43,7 @@ menu.push :activity, { controller: "/activities", action: "index" }, context: :modules, + if: Proc.new { User.current.logged? || !Setting.login_required? }, icon: "history" menu.push :work_packages, diff --git a/lib/redmine/menu_manager/top_menu_helper.rb b/lib/redmine/menu_manager/top_menu_helper.rb index 1881d9b12bf4..ec8391d3a23f 100644 --- a/lib/redmine/menu_manager/top_menu_helper.rb +++ b/lib/redmine/menu_manager/top_menu_helper.rb @@ -215,6 +215,8 @@ def more_top_menu_items def module_top_menu_item_groups items = more_top_menu_items + return items if items.empty? + item_groups = [] # add untitled group, if no heading is present diff --git a/spec/features/menu_items/top_menu_item_spec.rb b/spec/features/menu_items/top_menu_item_spec.rb index 16612c19ad4f..e25d4c3e8705 100644 --- a/spec/features/menu_items/top_menu_item_spec.rb +++ b/spec/features/menu_items/top_menu_item_spec.rb @@ -138,12 +138,6 @@ def click_link_in_open_menu(title) context "as an anonymous user" do let(:user) { create(:anonymous) } - context "when login_required", with_settings: { login_required: true } do - it "redirects to login" do - expect(page).to have_current_path /login/ - end - end - context "when not login_required", with_settings: { login_required: false } do it "displays only projects, activity and news" do has_menu_items? project_item, activity_item, news_item