mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
load widget templates separately (so no more inline)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user