BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8f92de7b
Commit
8f92de7b
authored
Mar 16, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '29529-quick-fix' into 'master'
Ensure not valid anymore labels don't break issue pages Closes #29529 See merge request !9995
parents
4a81867d
b196ee31
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
15 deletions
+18
-15
emoji.rb
lib/gitlab/emoji.rb
+4
-14
award_emoji_spec.rb
spec/features/issues/award_emoji_spec.rb
+14
-1
No files found.
lib/gitlab/emoji.rb
View file @
8f92de7b
...
...
@@ -44,27 +44,17 @@ module Gitlab
end
# CSS sprite fallback takes precedence over image fallback
def
gl_emoji_tag
(
name
,
image:
false
,
sprite:
false
,
force_fallback:
false
)
def
gl_emoji_tag
(
name
)
emoji_name
=
emojis_aliases
[
name
]
||
name
emoji_info
=
emojis
[
emoji_name
]
emoji_fallback_image_source
=
ActionController
::
Base
.
helpers
.
url_to_image
(
"emoji/
#{
emoji_info
[
'name'
]
}
.png"
)
emoji_fallback_sprite_class
=
"emoji-
#{
emoji_name
}
"
return
unless
emoji_info
data
=
{
name:
emoji_name
,
unicode_version:
emoji_unicode_version
(
emoji_name
)
}
data
[
:fallback_src
]
=
emoji_fallback_image_source
if
image
data
[
:fallback_sprite_class
]
=
emoji_fallback_sprite_class
if
sprite
ActionController
::
Base
.
helpers
.
content_tag
'gl-emoji'
,
class:
(
"emoji-icon
#{
emoji_fallback_sprite_class
}
"
if
force_fallback
&&
sprite
),
data:
data
do
if
force_fallback
&&
!
sprite
emoji_image_tag
(
emoji_name
,
emoji_fallback_image_source
)
else
emoji_info
[
'moji'
]
end
end
ActionController
::
Base
.
helpers
.
content_tag
(
'gl-emoji'
,
emoji_info
[
'moji'
],
data:
data
)
end
end
end
spec/features/issues/award_emoji_spec.rb
View file @
8f92de7b
...
...
@@ -17,8 +17,21 @@ describe 'Awards Emoji', feature: true do
login_as
(
user
)
end
describe
'visiting an issue with a legacy award emoji that is not valid anymore'
do
before
do
# The `heart_tip` emoji is not valid anymore so we need to skip validation
issue
.
award_emoji
.
build
(
user:
user
,
name:
'heart_tip'
).
save!
(
validate:
false
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
# Regression test: https://gitlab.com/gitlab-org/gitlab-ce/issues/29529
it
'does not shows a 500 page'
do
expect
(
page
).
to
have_text
(
issue
.
title
)
end
end
describe
'Click award emoji from issue#show'
do
let!
(
:note
)
{
create
(
:note_on_issue
,
noteable:
issue
,
project:
issue
.
project
,
note:
"Hello world"
)
}
let!
(
:note
)
{
create
(
:note_on_issue
,
noteable:
issue
,
project:
issue
.
project
,
note:
"Hello world"
)
}
before
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
...
...
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