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
Jérome Perrin
gitlab-ce
Commits
c1482943
Commit
c1482943
authored
Feb 24, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Does not create a todo when commenting on commit or project snippet
parent
28097398
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
3 deletions
+15
-3
CHANGELOG
CHANGELOG
+3
-0
app/services/notes/create_service.rb
app/services/notes/create_service.rb
+0
-1
app/services/todo_service.rb
app/services/todo_service.rb
+2
-2
spec/services/todo_service_spec.rb
spec/services/todo_service_spec.rb
+10
-0
No files found.
CHANGELOG
View file @
c1482943
...
@@ -2,6 +2,9 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -2,6 +2,9 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.6.0 (unreleased)
v 8.6.0 (unreleased)
v 8.5.2
- Fix error 500 when commenting on a commit
v 8.5.0
v 8.5.0
- Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu)
- Fix duplicate "me" in tooltip of the "thumbsup" awards Emoji (Stan Hu)
- Cache various Repository methods to improve performance (Yorick Peterse)
- Cache various Repository methods to improve performance (Yorick Peterse)
...
...
app/services/notes/create_service.rb
View file @
c1482943
...
@@ -13,6 +13,5 @@ module Notes
...
@@ -13,6 +13,5 @@ module Notes
note
note
end
end
end
end
end
end
app/services/todo_service.rb
View file @
c1482943
...
@@ -130,8 +130,8 @@ class TodoService
...
@@ -130,8 +130,8 @@ class TodoService
end
end
def
handle_note
(
note
,
author
)
def
handle_note
(
note
,
author
)
# Skip system notes,
like status changes and cross-references
# Skip system notes,
notes on commit, and notes on project snippet
return
if
note
.
system
return
if
note
.
system
?
||
[
'Commit'
,
'Snippet'
].
include?
(
note
.
noteable_type
)
project
=
note
.
project
project
=
note
.
project
target
=
note
.
noteable
target
=
note
.
noteable
...
...
spec/services/todo_service_spec.rb
View file @
c1482943
...
@@ -110,6 +110,8 @@ describe TodoService, services: true do
...
@@ -110,6 +110,8 @@ describe TodoService, services: true do
let!
(
:first_todo
)
{
create
(
:todo
,
:assigned
,
user:
john_doe
,
project:
project
,
target:
issue
,
author:
author
)
}
let!
(
:first_todo
)
{
create
(
:todo
,
:assigned
,
user:
john_doe
,
project:
project
,
target:
issue
,
author:
author
)
}
let!
(
:second_todo
)
{
create
(
:todo
,
:assigned
,
user:
john_doe
,
project:
project
,
target:
issue
,
author:
author
)
}
let!
(
:second_todo
)
{
create
(
:todo
,
:assigned
,
user:
john_doe
,
project:
project
,
target:
issue
,
author:
author
)
}
let
(
:note
)
{
create
(
:note
,
project:
project
,
noteable:
issue
,
author:
john_doe
,
note:
mentions
)
}
let
(
:note
)
{
create
(
:note
,
project:
project
,
noteable:
issue
,
author:
john_doe
,
note:
mentions
)
}
let
(
:note_on_commit
)
{
create
(
:note_on_commit
,
project:
project
,
author:
john_doe
,
note:
mentions
)
}
let
(
:note_on_project_snippet
)
{
create
(
:note_on_project_snippet
,
project:
project
,
author:
john_doe
,
note:
mentions
)
}
let
(
:award_note
)
{
create
(
:note
,
:award
,
project:
project
,
noteable:
issue
,
author:
john_doe
,
note:
'thumbsup'
)
}
let
(
:award_note
)
{
create
(
:note
,
:award
,
project:
project
,
noteable:
issue
,
author:
john_doe
,
note:
'thumbsup'
)
}
let
(
:system_note
)
{
create
(
:system_note
,
project:
project
,
noteable:
issue
)
}
let
(
:system_note
)
{
create
(
:system_note
,
project:
project
,
noteable:
issue
)
}
...
@@ -145,6 +147,14 @@ describe TodoService, services: true do
...
@@ -145,6 +147,14 @@ describe TodoService, services: true do
should_not_create_todo
(
user:
john_doe
,
target:
issue
,
author:
john_doe
,
action:
Todo
::
MENTIONED
,
note:
note
)
should_not_create_todo
(
user:
john_doe
,
target:
issue
,
author:
john_doe
,
action:
Todo
::
MENTIONED
,
note:
note
)
should_not_create_todo
(
user:
stranger
,
target:
issue
,
author:
john_doe
,
action:
Todo
::
MENTIONED
,
note:
note
)
should_not_create_todo
(
user:
stranger
,
target:
issue
,
author:
john_doe
,
action:
Todo
::
MENTIONED
,
note:
note
)
end
end
it
'does not create todo when leaving a note on commit'
do
should_not_create_any_todo
{
service
.
new_note
(
note_on_commit
,
john_doe
)
}
end
it
'does not create todo when leaving a note on snippet'
do
should_not_create_any_todo
{
service
.
new_note
(
note_on_project_snippet
,
john_doe
)
}
end
end
end
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