From 98cbfd598c12e10255ed6008123b132563aceed0 Mon Sep 17 00:00:00 2001 From: Kelv Date: Mon, 15 Jul 2024 14:29:17 +0800 Subject: [PATCH] DEV: add deprecation ids for base-url, fa-icon and chat service (#27911) --- .../javascripts/discourse-common/addon/helpers/base-url.js | 4 +++- .../javascripts/discourse-common/addon/helpers/fa-icon.js | 4 +++- plugins/chat/assets/javascripts/discourse/services/chat.js | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse-common/addon/helpers/base-url.js b/app/assets/javascripts/discourse-common/addon/helpers/base-url.js index cde37687fb2..1ecc19774cb 100644 --- a/app/assets/javascripts/discourse-common/addon/helpers/base-url.js +++ b/app/assets/javascripts/discourse-common/addon/helpers/base-url.js @@ -5,6 +5,8 @@ import { registerRawHelper } from "discourse-common/lib/helpers"; registerRawHelper("base-url", baseUrl); export default function baseUrl() { - deprecated("Use `{{base-path}}` instead of `{{base-url}}`"); + deprecated("Use `{{base-path}}` instead of `{{base-url}}`", { + id: "discourse.base-url", + }); return getUrl(""); } diff --git a/app/assets/javascripts/discourse-common/addon/helpers/fa-icon.js b/app/assets/javascripts/discourse-common/addon/helpers/fa-icon.js index 95bb5a501f8..957551eda77 100644 --- a/app/assets/javascripts/discourse-common/addon/helpers/fa-icon.js +++ b/app/assets/javascripts/discourse-common/addon/helpers/fa-icon.js @@ -9,6 +9,8 @@ export function iconHTML(id, params) { registerRawHelper("fa-icon", faIcon); export default function faIcon(icon, params) { - deprecated("Use `{{d-icon}}` instead of `{{fa-icon}}"); + deprecated("Use `{{d-icon}}` instead of `{{fa-icon}}", { + id: "discourse.fa-icon", + }); return htmlSafe(iconHTML(icon, params)); } diff --git a/plugins/chat/assets/javascripts/discourse/services/chat.js b/plugins/chat/assets/javascripts/discourse/services/chat.js index be77f3f6ab8..d3e8237c0b3 100644 --- a/plugins/chat/assets/javascripts/discourse/services/chat.js +++ b/plugins/chat/assets/javascripts/discourse/services/chat.js @@ -391,7 +391,8 @@ export default class Chat extends Service { addToolbarButton() { deprecated( - "Use the new chat API `api.registerChatComposerButton` instead of `chat.addToolbarButton`" + "Use the new chat API `api.registerChatComposerButton` instead of `chat.addToolbarButton`", + { id: "discourse.chat.addToolbarButton" } ); }