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

View File

@ -1,6 +1,7 @@
import Component from "@ember/component";
import { getCustomHTML } from "discourse/helpers/custom-html";
import { getOwner } from "discourse-common/lib/get-owner";
import deprecated from "discourse-common/lib/deprecated";
export default Component.extend({
triggerAppEvent: null,
@ -16,6 +17,10 @@ export default Component.extend({
} else {
const template = getOwner(this).lookup(`template:${name}`);
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);
}
}