Commit 676678e5 authored by Douwe Maan's avatar Douwe Maan

Link to milestone in "Milestone changed" system note

parent 989131c5
...@@ -41,7 +41,7 @@ class SystemNoteService ...@@ -41,7 +41,7 @@ class SystemNoteService
# #
# Returns the created Note object # Returns the created Note object
def self.change_assignee(noteable, project, author, assignee) def self.change_assignee(noteable, project, author, assignee)
body = assignee.nil? ? 'Assignee removed' : "Reassigned to @#{assignee.username}" body = assignee.nil? ? 'Assignee removed' : "Reassigned to #{assignee.to_reference}"
create_note(noteable: noteable, project: project, author: author, note: body) create_note(noteable: noteable, project: project, author: author, note: body)
end end
...@@ -103,7 +103,7 @@ class SystemNoteService ...@@ -103,7 +103,7 @@ class SystemNoteService
# Returns the created Note object # Returns the created Note object
def self.change_milestone(noteable, project, author, milestone) def self.change_milestone(noteable, project, author, milestone)
body = 'Milestone ' body = 'Milestone '
body += milestone.nil? ? 'removed' : "changed to #{milestone.title}" body += milestone.nil? ? 'removed' : "changed to #{milestone.to_reference(project)}"
create_note(noteable: noteable, project: project, author: author, note: body) create_note(noteable: noteable, project: project, author: author, note: body)
end end
......
...@@ -28,8 +28,7 @@ ...@@ -28,8 +28,7 @@
%span.back-to-milestone %span.back-to-milestone
= link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do = link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do
%strong %strong
= icon('clock-o') = issuable.milestone.reference_link_text
= issuable.milestone.title
- else - else
.light None .light None
.selectbox .selectbox
......
...@@ -171,7 +171,7 @@ describe SystemNoteService, services: true do ...@@ -171,7 +171,7 @@ describe SystemNoteService, services: true do
context 'when milestone added' do context 'when milestone added' do
it 'sets the note text' do it 'sets the note text' do
expect(subject.note).to eq "Milestone changed to #{milestone.title}" expect(subject.note).to eq "Milestone changed to #{milestone.to_reference}"
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment