Commit dc2f702a authored by Phil Hughes's avatar Phil Hughes

Added emoji description title to award emoji buttons

Closes #29971
parent 90f73438
Pipeline #7828753 canceled with stages
in 2 minutes and 27 seconds
......@@ -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;
})();
......
---
title: Added title to award emoji buttons
merge_request:
author:
This diff is collapsed.
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,
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment