diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-12-24 14:43:26 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-12-24 14:44:17 +0100 |
commit | 676678e550d61416c77e7dd6982b2639ada97580 (patch) | |
tree | 7f7226a24bb55ed39b60137c791a6393190c1d0c | |
parent | 989131c530f06fc52e9212df1e3e8d48eae4902f (diff) | |
download | gitlab-ce-676678e550d61416c77e7dd6982b2639ada97580.tar.gz |
Link to milestone in "Milestone changed" system note
-rw-r--r-- | app/services/system_note_service.rb | 4 | ||||
-rw-r--r-- | app/views/shared/issuable/_sidebar.html.haml | 3 | ||||
-rw-r--r-- | spec/services/system_note_service_spec.rb | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/app/services/system_note_service.rb b/app/services/system_note_service.rb index 98a71cbf1ad..955a28b5a7e 100644 --- a/app/services/system_note_service.rb +++ b/app/services/system_note_service.rb @@ -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 @@ -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 diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 79c5cc7f40a..9d65a621e53 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -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 diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index c9f828ae2f7..d3364a71022 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -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 |