プロジェクト

全般

プロフィール

Vote #81049

未完了

Repository Tab will not showing if no repository is set as "Main repository"

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Confirmed
優先度:
通常
担当者:
-
カテゴリ:
SCM_3
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
3
version_id:
32
issue_org_id:
33953
author_id:
76810
assigned_to_id:
0
comments:
4
status_id:
9
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
160
ステータス-->[Confirmed]

説明

I suggest that:

  • if there are any repositories in project, the "Repository Tab" button should show on main menu.
  • if no repository is set with "Main repository" and there is only one repository, the page should show the only repository by default.
  • if no repository is set with "Main repository" and there is multiple repositories, a blank page with Repositories sidebar should show.

journals

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
This issue and #14506 need to be resolved together. I created the following patch.

<pre><code class="diff">
diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index b0108d531..4ceeaf014 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -321,7 +321,7 @@ class RepositoriesController < ApplicationController
if params[:repository_id].present?
@repository = @project.repositories.find_by_identifier_param(params[:repository_id])
else
- @repository = @project.repository
+ @repository = @project.repository || @project.repositories.first
end
(render_404; return false) unless @repository
@path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s
diff --git a/lib/redmine.rb b/lib/redmine.rb
index de2993e13..470b5ae41 100644
--- a/lib/redmine.rb
+++ b/lib/redmine.rb
@@ -346,7 +346,7 @@ Redmine::MenuManager.map :project_menu do |menu|
menu.push :repository,
{:controller => 'repositories', :action => 'show',
:repository_id => nil, :path => nil, :rev => nil},
- :if => Proc.new {|p| p.repository && !p.repository.new_record?}
+ :if => Proc.new {|p| p.repositories.any?{|r| !r.new_record?}}
menu.push :settings, {:controller => 'projects', :action => 'settings'},
:last => true
end
</code></pre>
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,14506,Multiple repositories not visible if main repository is empty

Admin Redmine さんが3年以上前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0