Skip to content

Commit

Permalink
DEV: Update javascript:update_constants rake task following template …
Browse files Browse the repository at this point in the history
…colocation (discourse#20365)

As of discourse@ba3f62f, 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.
  • Loading branch information
OsamaSayegh authored Feb 20, 2023
1 parent 7ad92b7 commit f91631b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
4 changes: 2 additions & 2 deletions app/assets/javascripts/pretty-text/addon/emoji/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const emojis = [
"blush",
"slightly_smiling_face",
"upside_down_face",
"relaxed",
"yum",
"relieved",
"heart_eyes",
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -6376,7 +6376,7 @@ export const replacements = {
"😊": "blush",
"🙂": "slightly_smiling_face",
"🙃": "upside_down_face",
"☺": "relaxed",
"☺": "smiling_face",
"😋": "yum",
"😌": "relieved",
"😍": "heart_eyes",
Expand Down
1 change: 0 additions & 1 deletion app/models/emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ def self.unicode_replacements
replacements["\u{263B}"] = "slight_smile"
replacements["\u{2661}"] = "heart"
replacements["\u{2665}"] = "heart"
replacements["\u{263A}"] = "relaxed"

replacements
end
Expand Down
7 changes: 5 additions & 2 deletions lib/emoji/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
{
"code": "263a",
"name": "relaxed"
"name": "smiling_face"
},
{
"code": "1f60b",
Expand Down Expand Up @@ -8310,6 +8310,9 @@
],
"frowning_with_open_mouth": [
"frowning_face_with_open_mouth"
],
"smiling_face": [
"relaxed"
]
},
"searchAliases": {
Expand Down Expand Up @@ -17285,4 +17288,4 @@
":$": "blush",
":-$": "blush"
}
}
}
2 changes: 1 addition & 1 deletion lib/emoji/groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -7449,4 +7449,4 @@
}
]
}
]
]
2 changes: 1 addition & 1 deletion lib/tasks/javascript.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/pretty_text_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ def strip_image_wrapping(html)

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\:/)
Expand Down

0 comments on commit f91631b

Please sign in to comment.