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
5c120204
Commit
5c120204
authored
Feb 19, 2016
by
Douwe Maan
Committed by
Rémy Coutable
Feb 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '12792-emoji-as-text-diff-comment'
parent
ba893daf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
CHANGELOG
CHANGELOG
+1
-0
app/models/note.rb
app/models/note.rb
+2
-1
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
+10
-2
No files found.
CHANGELOG
View file @
5c120204
...
...
@@ -72,6 +72,7 @@ v 8.5.0 (unreleased)
- Allow existing users to auto link their SAML credentials by logging in via SAML
- Make it possible to erase a build (trace, artifacts) using UI and API
- Ability to revert changes from a Merge Request or Commit
- Emoji comment on diffs are not award emoji
v 8.4.4
- Update omniauth-saml gem to 1.4.2
...
...
app/models/note.rb
View file @
5c120204
...
...
@@ -375,6 +375,7 @@ class Note < ActiveRecord::Base
#
def
set_award!
return
unless
awards_supported?
&&
contains_emoji_only?
self
.
is_award
=
true
self
.
note
=
award_emoji_name
end
...
...
@@ -382,7 +383,7 @@ class Note < ActiveRecord::Base
private
def
awards_supported?
noteable
.
kind_of?
(
Issue
)
||
noteable
.
is_a?
(
MergeRequest
)
(
noteable
.
kind_of?
(
Issue
)
||
noteable
.
is_a?
(
MergeRequest
))
&&
!
for_diff_line?
end
def
contains_emoji_only?
...
...
app/views/projects/diffs/_text_file.html.haml
View file @
5c120204
...
...
@@ -35,8 +35,8 @@
=
render
"projects/notes/diff_notes_with_reply"
,
notes:
comments
,
line:
raw_diff_lines
[
index
].
text
-
if
last_line
>
0
=
render
"projects/diffs/match_line"
,
{
line:
""
,
line_old:
last_line
,
line_new:
last_line
,
bottom:
true
,
new_file:
diff_file
.
new_file
}
=
render
"projects/diffs/match_line"
,
{
line:
""
,
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?
.file-mode-changed
...
...
spec/models/note_spec.rb
View file @
5c120204
...
...
@@ -203,11 +203,19 @@ describe Note, models: true do
end
describe
"set_award!"
do
let
(
:
issue
)
{
create
:issue
}
let
(
:
merge_request
)
{
create
:merge_request
}
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"
)
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"
)
note
=
note
.
reload
expect
(
note
.
note
).
to
eq
(
":blowfish:"
)
expect
(
note
.
is_award?
).
to
be_falsy
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