Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
676678e5
Commit
676678e5
authored
Dec 24, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Link to milestone in "Milestone changed" system note
parent
989131c5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
app/services/system_note_service.rb
app/services/system_note_service.rb
+2
-2
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-2
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+1
-1
No files found.
app/services/system_note_service.rb
View file @
676678e5
...
...
@@ -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
.
usernam
e
}
"
body
=
assignee
.
nil?
?
'Assignee removed'
:
"Reassigned to
#{
assignee
.
to_referenc
e
}
"
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
.
t
itle
}
"
body
+=
milestone
.
nil?
?
'removed'
:
"changed to
#{
milestone
.
t
o_reference
(
project
)
}
"
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
end
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
676678e5
...
...
@@ -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
...
...
spec/services/system_note_service_spec.rb
View file @
676678e5
...
...
@@ -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
.
t
itl
e
}
"
expect
(
subject
.
note
).
to
eq
"Milestone changed to
#{
milestone
.
t
o_referenc
e
}
"
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment