DEV: Update javascript:update_constants rake task following template colocation (#20365)

As of ba3f62f576, handlebars templates are colocated with js files so the path to hbs templates referenced by this rake task is no longer valid. This commit fixes the path to hbs templates and updates a couple of files that are generated by the rake task.
This commit is contained in:
Osama Sayegh 2023-02-20 06:20:47 +03:00 committed by GitHub
parent 7ad92b7ab9
commit f91631b625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 8 deletions

View File

@ -38,4 +38,10 @@ export const NOTIFICATION_TYPES = {
chat_quoted: 33,
assigned: 34,
question_answer_user_commented: 35,
watching_category_or_tag: 36,
new_features: 37,
following: 800,
following_created_topic: 801,
following_replied: 802,
circles_activity: 900,
};

View File

@ -16,7 +16,6 @@ export const emojis = [
"blush",
"slightly_smiling_face",
"upside_down_face",
"relaxed",
"yum",
"relieved",
"heart_eyes",
@ -2341,6 +2340,7 @@ export const aliases = {
face_vomiting: ["puke"],
smile: ["grinning_face_with_smiling_eyes"],
frowning_with_open_mouth: ["frowning_face_with_open_mouth"],
smiling_face: ["relaxed"],
};
export const searchAliases = {
sad: [
@ -6376,7 +6376,7 @@ export const replacements = {
"😊": "blush",
"🙂": "slightly_smiling_face",
"🙃": "upside_down_face",
"☺": "relaxed",
"☺": "smiling_face",
"😋": "yum",
"😌": "relieved",
"😍": "heart_eyes",

View File

@ -232,7 +232,6 @@ class Emoji
replacements["\u{263B}"] = "slight_smile"
replacements["\u{2661}"] = "heart"
replacements["\u{2665}"] = "heart"
replacements["\u{263A}"] = "relaxed"
replacements
end

View File

@ -58,7 +58,7 @@
},
{
"code": "263a",
"name": "relaxed"
"name": "smiling_face"
},
{
"code": "1f60b",
@ -8310,6 +8310,9 @@
],
"frowning_with_open_mouth": [
"frowning_face_with_open_mouth"
],
"smiling_face": [
"relaxed"
]
},
"searchAliases": {
@ -17285,4 +17288,4 @@
":$": "blush",
":-$": "blush"
}
}
}

View File

@ -7449,4 +7449,4 @@
}
]
}
]
]

View File

@ -196,7 +196,7 @@ task "javascript:update_constants" => :environment do
emoji_sections = groups_json.map { |group| html_for_section(group) }
components_dir = "discourse/app/templates/components"
components_dir = "discourse/app/components"
write_hbs_template("#{components_dir}/emoji-group-buttons.hbs", task_name, emoji_buttons.join)
write_hbs_template("#{components_dir}/emoji-group-sections.hbs", task_name, emoji_sections.join)
end

View File

@ -1461,7 +1461,7 @@ RSpec.describe PrettyText do
it "replaces some glyphs that are not in the emoji range" do
expect(PrettyText.cook("")).to match(/\:frowning\:/)
expect(PrettyText.cook("")).to match(/\:relaxed\:/)
expect(PrettyText.cook("")).to match(/\:smiling_face\:/)
expect(PrettyText.cook("")).to match(/\:slight_smile\:/)
expect(PrettyText.cook("")).to match(/\:heart\:/)
expect(PrettyText.cook("")).to match(/\:heart\:/)