Skip to content

Commit 7dc945e

Browse files
authored
Merge branch '18.0' into 18.0-tutorials-mepl
2 parents cb259d2 + b16e643 commit 7dc945e

File tree

2 files changed

+11
-49
lines changed

2 files changed

+11
-49
lines changed

awesome_owl/__manifest__.py

+3-12
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,13 @@
2828
],
2929
'assets': {
3030
'awesome_owl.assets_playground': [
31-
# bootstrap
3231
('include', 'web._assets_helpers'),
3332
'web/static/src/scss/pre_variables.scss',
3433
'web/static/lib/bootstrap/scss/_variables.scss',
35-
('include', 'web._assets_bootstrap_backend'),
36-
37-
# required for fa icons
38-
'web/static/src/libs/fontawesome/css/font-awesome.css',
39-
40-
# include base files from framework
34+
'web/static/lib/bootstrap/scss/_maps.scss',
35+
('include', 'web._assets_bootstrap'),
4136
('include', 'web._assets_core'),
42-
43-
'web/static/src/core/utils/functions.js',
44-
'web/static/src/core/browser/browser.js',
45-
'web/static/src/core/registry.js',
46-
'web/static/src/core/assets.js',
37+
'web/static/src/libs/fontawesome/css/font-awesome.css',
4738
'awesome_owl/static/src/**/*',
4839
],
4940
},

awesome_owl/static/src/main.js

+8-37
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,12 @@
1-
/** @odoo-module **/
21

3-
import { browser } from "@web/core/browser/browser";
4-
import { mount, whenReady } from "@odoo/owl";
2+
import { whenReady } from "@odoo/owl";
3+
import { mountComponent } from "@web/env";
54
import { Playground } from "./playground";
6-
import { templates } from "@web/core/assets";
75

8-
// Mount the Playground component when the document.body is ready
9-
whenReady( () => {
10-
mount(Playground, document.body, { templates, dev: true, name: "Owl Tutorial" });
11-
});
12-
13-
14-
15-
/**
16-
* This code is iterating over the cause property of an error object to console.error a string
17-
* containing the stack trace of the error and any errors that caused it.
18-
* @param {Event} ev
19-
*/
20-
function logError(ev) {
21-
ev.preventDefault();
22-
let error = ev ?.error || ev.reason;
6+
const config = {
7+
dev: true,
8+
name: "Owl Tutorial",
9+
};
2310

24-
if (error.seen) {
25-
// If an error causes the mount to crash, Owl will reject the mount promise and throw the
26-
// error. Therefore, this if statement prevents the same error from appearing twice.
27-
return;
28-
}
29-
error.seen = true;
30-
31-
let errorMessage = error.stack;
32-
while (error.cause) {
33-
errorMessage += "\nCaused by: "
34-
errorMessage += error.cause.stack;
35-
error = error.cause;
36-
}
37-
console.error(errorMessage);
38-
}
39-
40-
browser.addEventListener("error", (ev) => {logError(ev)});
41-
browser.addEventListener("unhandledrejection", (ev) => {logError(ev)});
11+
// Mount the Playground component when the document.body is ready
12+
whenReady(() => mountComponent(Playground, document.body, config));

0 commit comments

Comments
 (0)