Merge branch 'emoji-button-titles' into 'master'

Added emoji description title to award emoji buttons

Closes #29971

See merge request !10881
This commit is contained in:
Filipa Lacerda 2017-05-03 11:34:04 +00:00
commit cac04fbd77
6 changed files with 1799 additions and 2 deletions

View File

@ -62,6 +62,7 @@ function glEmojiTag(inputName, options) {
data-fallback-src="${fallbackImageSrc}"
${fallbackSpriteAttribute}
data-unicode-version="${emojiInfo.unicodeVersion}"
title="${emojiInfo.description}"
>
${contents}
</gl-emoji>

View File

@ -0,0 +1,4 @@
---
title: Added title to award emoji buttons
merge_request:
author:

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ module Gitlab
unicode_version: emoji_unicode_version(emoji_name)
}
ActionController::Base.helpers.content_tag('gl-emoji', emoji_info['moji'], data: data)
ActionController::Base.helpers.content_tag('gl-emoji', emoji_info['moji'], title: emoji_info['description'], data: data)
end
end
end

View File

@ -19,6 +19,7 @@ namespace :gemojione do
entry = {
category: emoji_hash['category'],
moji: emoji_hash['moji'],
description: emoji_hash['description'],
unicodeVersion: Gitlab::Emoji.emoji_unicode_version(name),
digest: hash_digest,
}

View File

@ -111,7 +111,7 @@ describe MarkupHelper do
it 'replaces commit message with emoji to link' do
actual = link_to_gfm(':book: Book', '/foo')
expect(actual).
to eq '<gl-emoji data-name="book" data-unicode-version="6.0">📖</gl-emoji><a href="/foo"> Book</a>'
to eq '<gl-emoji title="open book" data-name="book" data-unicode-version="6.0">📖</gl-emoji><a href="/foo"> Book</a>'
end
end