Skip to content
Snippets Groups Projects
Commit 676678e5 authored by Douwe Maan's avatar Douwe Maan
Browse files

Link to milestone in "Milestone changed" system note

parent 989131c5
Branches
Tags
1 merge request!2203Link to milestone in "Milestone changed" system note
Pipeline #
Loading
Loading
@@ -41,7 +41,7 @@ class SystemNoteService
#
# Returns the created Note object
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)
end
Loading
Loading
@@ -103,7 +103,7 @@ class SystemNoteService
# Returns the created Note object
def self.change_milestone(noteable, project, author, 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)
end
Loading
Loading
Loading
Loading
@@ -28,8 +28,7 @@
%span.back-to-milestone
= link_to namespace_project_milestone_path(@project.namespace, @project, issuable.milestone) do
%strong
= icon('clock-o')
= issuable.milestone.title
= issuable.milestone.reference_link_text
- else
.light None
.selectbox
Loading
Loading
Loading
Loading
@@ -171,7 +171,7 @@ describe SystemNoteService, services: true do
 
context 'when milestone added' 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
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment