Added emoji description title to award emoji buttons

Closes #29971
This commit is contained in:
Phil Hughes 2017-04-24 14:24:48 +01:00
parent 90f7343899
commit dc2f702a04
4 changed files with 1809 additions and 6 deletions

View file

@ -29,11 +29,18 @@ const categoryLabelMap = {
flags: 'Flags',
};
function createEmojiObject(alias) {
return {
alias,
description: emojiMap[alias].description,
};
};
function buildCategoryMap() {
return Object.keys(emojiMap).reduce((currentCategoryMap, emojiNameKey) => {
const emojiInfo = emojiMap[emojiNameKey];
if (currentCategoryMap[emojiInfo.category]) {
currentCategoryMap[emojiInfo.category].push(emojiNameKey);
currentCategoryMap[emojiInfo.category].push(createEmojiObject(emojiNameKey));
}
return currentCategoryMap;
@ -55,10 +62,10 @@ function renderCategory(name, emojiList, opts = {}) {
${name}
</h5>
<ul class="clearfix emoji-menu-list ${opts.menuListClass || ''}">
${emojiList.map(emojiName => `
${emojiList.map(emoji => `
<li class="emoji-menu-list-item">
<button class="emoji-menu-btn text-center js-emoji-btn" type="button">
${glEmojiTag(emojiName, {
<button class="emoji-menu-btn text-center js-emoji-btn" type="button" title="${emoji.description}">
${glEmojiTag(emoji.alias, {
sprite: true,
})}
</button>
@ -498,7 +505,7 @@ AwardsHandler.prototype.getFrequentlyUsedEmojis = function getFrequentlyUsedEmoj
const frequentlyUsedEmojis = _.uniq((Cookies.get('frequently_used_emojis') || '').split(','));
this.frequentlyUsedEmojis = frequentlyUsedEmojis.filter(
inputName => isEmojiNameValid(inputName),
);
).map(emojiNameKey => createEmojiObject(emojiNameKey));
return this.frequentlyUsedEmojis;
})();

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

@ -1,6 +1,6 @@
namespace :gemojione do
desc 'Generates Emoji SHA256 digests'
task digests: ['yarn:check', 'environment'] do
task digests: ['environment'] do
require 'digest/sha2'
require 'json'
@ -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,
}