mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove Discourse.RAW_TEMPLATES (#9630)
We were sharing `Discourse` both as an application object and a namespace which complicated things for Ember CLI. This patch moves raw templates into `__DISCOURSE_RAW_TEMPLATES` and adds a couple helper methods to create/remove them.
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
import compile from "handlebars-compiler";
|
||||
import {
|
||||
addRawTemplate,
|
||||
removeRawTemplate
|
||||
} from "discourse-common/lib/raw-templates";
|
||||
|
||||
const CONNECTOR =
|
||||
"javascripts/raw-test/connectors/topic-list-before-status/lala";
|
||||
|
||||
acceptance("Raw Plugin Outlet", {
|
||||
beforeEach() {
|
||||
Discourse.RAW_TEMPLATES[CONNECTOR] = compile(
|
||||
`<span class='topic-lala'>{{context.topic.id}}</span>`
|
||||
addRawTemplate(
|
||||
CONNECTOR,
|
||||
compile(`<span class='topic-lala'>{{context.topic.id}}</span>`)
|
||||
);
|
||||
},
|
||||
|
||||
afterEach() {
|
||||
delete Discourse.RAW_TEMPLATES[CONNECTOR];
|
||||
removeRawTemplate(CONNECTOR);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user