]> source.dussan.org Git - redmine.git/commitdiff
Roadmap tab is missing if there are only inherited from parent project versions ...
authorGo MAEDA <maeda@farend.jp>
Wed, 7 Apr 2021 05:09:13 +0000 (05:09 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 7 Apr 2021 05:09:13 +0000 (05:09 +0000)
Patch by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@20921 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine.rb
test/integration/lib/redmine/menu_manager_test.rb

index ee9aece1a685823be38b79e7c6fd6120e5aa6f1b..465e7dded5a7d57659103189da55a4dec5a8e598 100644 (file)
@@ -367,10 +367,10 @@ Redmine::MenuManager.map :project_menu do |menu|
     :param => :project_id,
     :if =>
       Proc.new do |p|
-        if Setting.display_subprojects_issues?
-          p.rolled_up_versions.any?
+        if p.shared_versions.any?
+          true
         else
-          p.shared_versions.any?
+          Setting.display_subprojects_issues? && p.rolled_up_versions.any?
         end
       end
   )
index 5b27bdbf1aba22c7f56dfc5b99d99e8a6d7986fa..9bac57ad49a321b2150ca1db03727141ff1870e6 100644 (file)
@@ -147,4 +147,21 @@ class MenuManagerTest < Redmine::IntegrationTest
       assert_select '#main-menu a.roadmap', 0
     end
   end
+
+  def test_project_menu_should_show_roadmap_if_project_has_shared_version
+    Version.delete_all
+    project = Project.generate!(:parent_id => 2)
+
+    Version.generate!(project_id: 2, sharing: 'tree')
+
+    with_settings :display_subprojects_issues => '1' do
+      get "/projects/#{project.id}"
+      assert_select '#main-menu a.roadmap'
+    end
+
+    with_settings :display_subprojects_issues => '0' do
+      get "/projects/#{project.id}"
+      assert_select '#main-menu a.roadmap'
+    end
+  end
 end