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:
parent
5f4623ba47
commit
5dc2c0b5a2
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue