Merge branch 'ticket/unstable/400-activity-event-types' into unstable
This commit is contained in:
commit
6e105a765a
|
@ -39,7 +39,14 @@ class Issue < ActiveRecord::Base
|
||||||
acts_as_watchable
|
acts_as_watchable
|
||||||
|
|
||||||
acts_as_journalized :event_title => Proc.new {|o| "#{o.tracker.name} ##{o.journaled_id} (#{o.status}): #{o.subject}"},
|
acts_as_journalized :event_title => Proc.new {|o| "#{o.tracker.name} ##{o.journaled_id} (#{o.status}): #{o.subject}"},
|
||||||
:event_type => Proc.new {|o| 'issue' + (o.closed? ? ' closed' : '')}
|
:event_type => Proc.new {|o|
|
||||||
|
t = 'issue'
|
||||||
|
if o.changes.empty?
|
||||||
|
t << '-note' unless o.initial?
|
||||||
|
else
|
||||||
|
t << (IssueStatus.find_by_id(o.new_value_for(:status_id)).try(:is_closed?) ? '-closed' : '-edit')
|
||||||
|
end
|
||||||
|
t }
|
||||||
|
|
||||||
register_on_journal_formatter(:id, 'parent_id')
|
register_on_journal_formatter(:id, 'parent_id')
|
||||||
register_on_journal_formatter(:named_association, 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
|
register_on_journal_formatter(:named_association, 'project_id', 'status_id', 'tracker_id', 'assigned_to_id',
|
||||||
|
|
|
@ -52,8 +52,9 @@ class SearchControllerTest < ActionController::TestCase
|
||||||
|
|
||||||
assert assigns(:results).include?(Issue.find(8))
|
assert assigns(:results).include?(Issue.find(8))
|
||||||
assert assigns(:results).include?(Issue.find(5))
|
assert assigns(:results).include?(Issue.find(5))
|
||||||
assert_tag :dt, :attributes => { :class => /issue closed/ },
|
assert_select "dt.issue" do
|
||||||
:child => { :tag => 'a', :content => /Closed/ }
|
assert_select "a", :text => /Closed/
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_search_project_and_subprojects
|
def test_search_project_and_subprojects
|
||||||
|
|
|
@ -172,6 +172,7 @@ module Redmine
|
||||||
:anchor => ("note-#{journal.anchor}" unless journal.initial?) }
|
:anchor => ("note-#{journal.anchor}" unless journal.initial?) }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
options[:type] ||= self.name.underscore.dasherize # Make sure the name of the journalized model and not the name of the journal is used for events
|
||||||
{ :description => :notes, :author => :user }.reverse_merge options
|
{ :description => :notes, :author => :user }.reverse_merge options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue