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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
11ed1cbb
Commit
11ed1cbb
authored
Feb 18, 2016
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emoji reponses on diffs aren't award emoji
parent
a33b63b7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
4 deletions
+14
-4
CHANGELOG
CHANGELOG
+1
-0
app/models/note.rb
app/models/note.rb
+4
-0
app/views/projects/diffs/_text_file.html.haml
app/views/projects/diffs/_text_file.html.haml
+2
-2
spec/models/note_spec.rb
spec/models/note_spec.rb
+7
-2
No files found.
CHANGELOG
View file @
11ed1cbb
...
@@ -65,6 +65,7 @@ v 8.5.0 (unreleased)
...
@@ -65,6 +65,7 @@ v 8.5.0 (unreleased)
- Ability to see and sort on vote count from Issues and MR lists
- Ability to see and sort on vote count from Issues and MR lists
- Fix builds scheduler when first build in stage was allowed to fail
- Fix builds scheduler when first build in stage was allowed to fail
- User project limit is reached notice is hidden if the projects limit is zero
- User project limit is reached notice is hidden if the projects limit is zero
- Emoji comment on diffs are not award emoji
v 8.4.4
v 8.4.4
- Update omniauth-saml gem to 1.4.2
- Update omniauth-saml gem to 1.4.2
...
...
app/models/note.rb
View file @
11ed1cbb
...
@@ -375,6 +375,10 @@ class Note < ActiveRecord::Base
...
@@ -375,6 +375,10 @@ class Note < ActiveRecord::Base
#
#
def
set_award!
def
set_award!
return
unless
awards_supported?
&&
contains_emoji_only?
return
unless
awards_supported?
&&
contains_emoji_only?
# Responding with an emoji is not an award emoji if its on a diff comment
return
if
line_code
self
.
is_award
=
true
self
.
is_award
=
true
self
.
note
=
award_emoji_name
self
.
note
=
award_emoji_name
end
end
...
...
app/views/projects/diffs/_text_file.html.haml
View file @
11ed1cbb
...
@@ -35,8 +35,8 @@
...
@@ -35,8 +35,8 @@
=
render
"projects/notes/diff_notes_with_reply"
,
notes:
comments
,
line:
raw_diff_lines
[
index
].
text
=
render
"projects/notes/diff_notes_with_reply"
,
notes:
comments
,
line:
raw_diff_lines
[
index
].
text
-
if
last_line
>
0
-
if
last_line
>
0
=
render
"projects/diffs/match_line"
,
{
line:
""
,
=
render
"projects/diffs/match_line"
,
{
line:
""
,
line_old:
last_line
,
line_new:
last_line
,
bottom:
true
,
new_file:
diff_file
.
new_file
}
line_old:
last_line
,
line_new:
last_line
,
bottom:
true
,
new_file:
diff_file
.
new_file
}
-
if
diff_file
.
diff
.
blank?
&&
diff_file
.
mode_changed?
-
if
diff_file
.
diff
.
blank?
&&
diff_file
.
mode_changed?
.file-mode-changed
.file-mode-changed
...
...
spec/models/note_spec.rb
View file @
11ed1cbb
...
@@ -203,11 +203,16 @@ describe Note, models: true do
...
@@ -203,11 +203,16 @@ describe Note, models: true do
end
end
describe
"set_award!"
do
describe
"set_award!"
do
let
(
:
issue
)
{
create
:issue
}
let
(
:
merge_request
)
{
create
:merge_request
}
it
"converts aliases to actual name"
do
it
"converts aliases to actual name"
do
note
=
create
:note
,
note:
":+1:"
,
noteable:
issue
note
=
create
(
:note
,
note:
":+1:"
,
noteable:
merge_request
)
expect
(
note
.
reload
.
note
).
to
eq
(
"thumbsup"
)
expect
(
note
.
reload
.
note
).
to
eq
(
"thumbsup"
)
end
end
it
"is not an award emoji when comment is on a diff"
do
note
=
create
(
:note
,
note:
":blowfish:"
,
noteable:
merge_request
,
line_code:
"11d5d2e667e9da4f7f610f81d86c974b146b13bd_0_2"
)
expect
(
note
.
reload
.
note
).
to
eq
(
":blowfish:"
)
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