emoji_picker: Add missing Flags category.

Apparently iamcal/emoji-data has a dedicated category for flag emojis.

And get_all_emoji_categories() in emoji_picker.js doesn't return the
Flags category, because we haven't declared that category in our emoji
data logic.

Note that the category looks quite sparse because it lacks country
flags, since we don't yet support emojis combined with a ‍Zero Width
Joiner (ZWJ) (see #992 & #11767).

Fixes #15303.
This commit is contained in:
Gittenburg
2020-06-14 09:01:53 +02:00
committed by Tim Abbott
parent 67053ff479
commit 12671fbc66
2 changed files with 3 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ run_test('initialize', () => {
emoji_picker.initialize();
const complete_emoji_catalog = _.sortBy(emoji_picker.complete_emoji_catalog, 'name');
assert.equal(complete_emoji_catalog.length, 10);
assert.equal(complete_emoji_catalog.length, 11);
assert.equal(emoji.emojis_by_name.size, 1037);
function assert_emoji_category(ele, icon, num) {
@@ -30,6 +30,7 @@ run_test('initialize', () => {
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-thumbs-o-up', 102);
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-lightbulb-o', 191);
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-cutlery', 92);
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-flag', 5);
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-cog', 1);
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-leaf', 104);
assert_emoji_category(complete_emoji_catalog.pop(), 'fa-soccer-ball-o', 63);

View File

@@ -39,6 +39,7 @@ function get_all_emoji_categories() {
{ name: "Travel & Places", icon: "fa-car" },
{ name: "Objects", icon: "fa-lightbulb-o" },
{ name: "Symbols", icon: "fa-hashtag" },
{ name: "Flags", icon: "fa-flag" },
{ name: "Custom", icon: "fa-cog" },
];
}