DEV: Deprecate CustomHTML hbs templates (#20264)

This is an old system for introducing custom content into Discourse. Nowadays, plugins and themes should be using Plugin Outlets for this.
This commit is contained in:
David Taylor 2023-02-13 17:41:32 +00:00 committed by GitHub
parent 5f4623ba47
commit 5dc2c0b5a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import Component from "@ember/component"; import Component from "@ember/component";
import { getCustomHTML } from "discourse/helpers/custom-html"; import { getCustomHTML } from "discourse/helpers/custom-html";
import { getOwner } from "discourse-common/lib/get-owner"; import { getOwner } from "discourse-common/lib/get-owner";
import deprecated from "discourse-common/lib/deprecated";
export default Component.extend({ export default Component.extend({
triggerAppEvent: null, triggerAppEvent: null,
@ -16,6 +17,10 @@ export default Component.extend({
} else { } else {
const template = getOwner(this).lookup(`template:${name}`); const template = getOwner(this).lookup(`template:${name}`);
if (template) { if (template) {
deprecated(
"Defining an hbs template for CustomHTML rendering is deprecated. Use plugin outlets instead.",
{ id: "discourse.custom_html_template" }
);
this.set("layoutName", name); this.set("layoutName", name);
} }
} }