load widget templates separately (so no more inline)

This commit is contained in:
Géry Debongnie
2019-02-02 11:41:19 +01:00
parent 4d30180862
commit 27f5845799
19 changed files with 177 additions and 183 deletions
+9
View File
@@ -9,6 +9,7 @@ import { NotificationManager } from "../src/ts/services/notifications";
import { IActionManager, ActionEvent } from "../src/ts/services/action_manager";
import { Callback } from "../src/ts/core/event_bus";
import { IRouter, Query, RouterEvent } from "../src/ts/services/router";
import { readFile } from "fs";
export function makeTestFixture() {
let fixture = document.createElement("div");
@@ -74,3 +75,11 @@ class MockRouter implements IRouter {
export function normalize(str: string): string {
return str.replace(/\s+/g, "");
}
export async function loadTemplates(): Promise<string> {
return new Promise((resolve, reject) => {
readFile("web/static/src/xml/templates.xml", "utf-8", (err, result) => {
resolve(result);
});
});
}