Skip to content

A platform for community discussion. Free, open, simple.

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

Osama Sayeghf91631b625f1
diff --git a/app/assets/javascripts/discourse/tests/fixtures/concerns/notification-types.js b/app/assets/javascripts/discourse/tests/fixtures/concerns/notification-types.js
index a75d7721a16..512f63e00c8 100644
--- a/app/assets/javascripts/discourse/tests/fixtures/concerns/notification-types.js
+++ b/app/assets/javascripts/discourse/tests/fixtures/concerns/notification-types.js
@@ -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,
};
diff --git a/app/assets/javascripts/pretty-text/addon/emoji/data.js b/app/assets/javascripts/pretty-text/addon/emoji/data.js
index e24f72e4459..1a28d7beef6 100644
--- a/app/assets/javascripts/pretty-text/addon/emoji/data.js
+++ b/app/assets/javascripts/pretty-text/addon/emoji/data.js
@@ -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",
diff --git a/app/models/emoji.rb b/app/models/emoji.rb
index 84a0f718dcc..cddd9042c0e 100644
--- a/app/models/emoji.rb
+++ b/app/models/emoji.rb
@@ -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
diff --git a/lib/emoji/db.json b/lib/emoji/db.json
index 8b3f530c5d9..0cbab5704b8 100644
--- a/lib/emoji/db.json
+++ b/lib/emoji/db.json
@@ -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"
}
-}
\ No newline at end of file
+}
diff --git a/lib/emoji/groups.json b/lib/emoji/groups.json
index 04395ce4d32..fdb56fd6285 100644
--- a/lib/emoji/groups.json
+++ b/lib/emoji/groups.json
@@ -7449,4 +7449,4 @@
}
]
}
-]
\ No newline at end of file
+]
diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake
index cf43fd72bab..bf02c4a6ad5 100644
--- a/lib/tasks/javascript.rake
+++ b/lib/tasks/javascript.rake
@@ -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
diff --git a/spec/lib/pretty_text_spec.rb b/spec/lib/pretty_text_spec.rb
index 737ce0f198d..ac11ef85e21 100644
--- a/spec/lib/pretty_text_spec.rb
+++ b/spec/lib/pretty_text_spec.rb
@@ -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\:/)