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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
d19b68b6
Commit
d19b68b6
authored
Jan 08, 2018
by
Maurizio De Santis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 'removed assignee' note to include old assignee reference
parent
8a7bbe1f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
16 deletions
+14
-16
app/services/system_note_service.rb
app/services/system_note_service.rb
+8
-15
changelogs/unreleased/16301-update-removed-assignee-note-to-include-old-assignee-reference.yml
...moved-assignee-note-to-include-old-assignee-reference.yml
+5
-0
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 @
d19b68b6
...
@@ -68,8 +68,6 @@ module SystemNoteService
...
@@ -68,8 +68,6 @@ module SystemNoteService
#
#
# Returns the created Note object
# Returns the created Note object
def
change_issue_assignees
(
issue
,
project
,
author
,
old_assignees
)
def
change_issue_assignees
(
issue
,
project
,
author
,
old_assignees
)
body
=
if
issue
.
assignees
.
any?
&&
old_assignees
.
any?
unassigned_users
=
old_assignees
-
issue
.
assignees
unassigned_users
=
old_assignees
-
issue
.
assignees
added_users
=
issue
.
assignees
.
to_a
-
old_assignees
added_users
=
issue
.
assignees
.
to_a
-
old_assignees
...
@@ -77,12 +75,7 @@ module SystemNoteService
...
@@ -77,12 +75,7 @@ module SystemNoteService
text_parts
<<
"assigned to
#{
added_users
.
map
(
&
:to_reference
).
to_sentence
}
"
if
added_users
.
any?
text_parts
<<
"assigned to
#{
added_users
.
map
(
&
:to_reference
).
to_sentence
}
"
if
added_users
.
any?
text_parts
<<
"unassigned
#{
unassigned_users
.
map
(
&
:to_reference
).
to_sentence
}
"
if
unassigned_users
.
any?
text_parts
<<
"unassigned
#{
unassigned_users
.
map
(
&
:to_reference
).
to_sentence
}
"
if
unassigned_users
.
any?
text_parts
.
join
(
' and '
)
body
=
text_parts
.
join
(
' and '
)
elsif
old_assignees
.
any?
"removed assignee"
elsif
issue
.
assignees
.
any?
"assigned to
#{
issue
.
assignees
.
map
(
&
:to_reference
).
to_sentence
}
"
end
create_note
(
NoteSummary
.
new
(
issue
,
project
,
author
,
body
,
action:
'assignee'
))
create_note
(
NoteSummary
.
new
(
issue
,
project
,
author
,
body
,
action:
'assignee'
))
end
end
...
...
changelogs/unreleased/16301-update-removed-assignee-note-to-include-old-assignee-reference.yml
0 → 100644
View file @
d19b68b6
---
title
:
"
Update
'removed
assignee'
note
to
include
old
assignee
reference"
merge_request
:
16301
author
:
Maurizio De Santis
type
:
changed
spec/services/system_note_service_spec.rb
View file @
d19b68b6
...
@@ -158,7 +158,7 @@ describe SystemNoteService do
...
@@ -158,7 +158,7 @@ describe SystemNoteService do
end
end
it
'builds a correct phrase when assignee removed'
do
it
'builds a correct phrase when assignee removed'
do
expect
(
build_note
([
assignee1
],
[])).
to
eq
'removed assignee'
expect
(
build_note
([
assignee1
],
[])).
to
eq
"unassigned @
#{
assignee1
.
username
}
"
end
end
it
'builds a correct phrase when assignees changed'
do
it
'builds a correct phrase when assignees changed'
do
...
...
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