mirror of
https://github.com/redmine/redmine.git
synced 2025-11-08 06:15:59 +01:00
"Property changes" tab does not appear when all issue journals have both notes and property changes (#38217).
Patch by Go MAEDA. git-svn-id: https://svn.redmine.org/redmine/trunk@22085 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -695,8 +695,8 @@ module IssuesHelper
|
|||||||
def issue_history_tabs
|
def issue_history_tabs
|
||||||
tabs = []
|
tabs = []
|
||||||
if @journals.present?
|
if @journals.present?
|
||||||
journals_without_notes = @journals.select{|value| value.notes.blank?}
|
has_details = @journals.any? {|value| value.details.present?}
|
||||||
journals_with_notes = @journals.reject{|value| value.notes.blank?}
|
has_notes = @journals.any? {|value| value.notes.present?}
|
||||||
tabs <<
|
tabs <<
|
||||||
{
|
{
|
||||||
:name => 'history',
|
:name => 'history',
|
||||||
@@ -705,7 +705,7 @@ module IssuesHelper
|
|||||||
:partial => 'issues/tabs/history',
|
:partial => 'issues/tabs/history',
|
||||||
:locals => {:issue => @issue, :journals => @journals}
|
:locals => {:issue => @issue, :journals => @journals}
|
||||||
}
|
}
|
||||||
if journals_with_notes.any?
|
if has_notes
|
||||||
tabs <<
|
tabs <<
|
||||||
{
|
{
|
||||||
:name => 'notes',
|
:name => 'notes',
|
||||||
@@ -713,7 +713,7 @@ module IssuesHelper
|
|||||||
:onclick => 'showIssueHistory("notes", this.href)'
|
:onclick => 'showIssueHistory("notes", this.href)'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
if journals_without_notes.any?
|
if has_details
|
||||||
tabs <<
|
tabs <<
|
||||||
{
|
{
|
||||||
:name => 'properties',
|
:name => 'properties',
|
||||||
|
|||||||
@@ -3104,7 +3104,7 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
def test_show_display_only_all_and_notes_tabs_for_issue_with_notes_only
|
def test_show_display_only_all_and_notes_tabs_for_issue_with_notes_only
|
||||||
@request.session[:user_id] = 1
|
@request.session[:user_id] = 1
|
||||||
|
|
||||||
get :show, :params => {:id => 6}
|
get :show, :params => {:id => 14}
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select '#history' do
|
assert_select '#history' do
|
||||||
assert_select 'div.tabs ul a', 2
|
assert_select 'div.tabs ul a', 2
|
||||||
@@ -3135,13 +3135,6 @@ class IssuesControllerTest < Redmine::ControllerTest
|
|||||||
|
|
||||||
def test_show_display_all_notes_and_history_tabs_for_issue_with_notes_and_history_changes
|
def test_show_display_all_notes_and_history_tabs_for_issue_with_notes_and_history_changes
|
||||||
journal = Journal.create!(:journalized => Issue.find(6), :user_id => 1)
|
journal = Journal.create!(:journalized => Issue.find(6), :user_id => 1)
|
||||||
detail =
|
|
||||||
JournalDetail.
|
|
||||||
create!(
|
|
||||||
:journal => journal, :property => 'attr',
|
|
||||||
:prop_key => 'description',
|
|
||||||
:old_value => 'Foo', :value => 'Bar'
|
|
||||||
)
|
|
||||||
@request.session[:user_id] = 1
|
@request.session[:user_id] = 1
|
||||||
|
|
||||||
get :show, :params => {:id => 6}
|
get :show, :params => {:id => 6}
|
||||||
|
|||||||
Reference in New Issue
Block a user