[FIX] app: display correct url in dev mode message

closes #850
This commit is contained in:
Géry Debongnie
2022-02-15 10:14:50 +01:00
parent bd2aa8a72f
commit 406be446a5
3 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -18,10 +18,14 @@ export interface AppConfig<P, E> extends TemplateSetConfig {
test?: boolean;
}
export const DEV_MSG = `Owl is running in 'dev' mode.
export const DEV_MSG = () => {
const hash = (window as any).owl ? (window as any).owl.__info__.hash : "master";
return `Owl is running in 'dev' mode.
This is not suitable for production use.
See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for more information.`;
See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration for more information.`;
};
export class App<
T extends abstract new (...args: any) => any = any,
@@ -43,7 +47,7 @@ export class App<
this.dev = true;
}
if (this.dev && !config.test) {
console.info(DEV_MSG);
console.info(DEV_MSG());
}
const descrs = Object.getOwnPropertyDescriptors(config.env || {});
this.env = Object.freeze(Object.defineProperties({}, descrs)) as E;
+1 -1
View File
@@ -12,7 +12,7 @@ let mockConsoleWarn: any;
beforeAll(() => {
console.info = (message: any) => {
if (message === DEV_MSG) {
if (message === DEV_MSG()) {
return;
}
info(message);
+1 -1
View File
@@ -29,7 +29,7 @@ snapshotEverything();
beforeAll(() => {
console.info = (message: any) => {
if (message === DEV_MSG) {
if (message === DEV_MSG()) {
return;
}
info(message);