Skip to content

Commit 12ab960

Browse files
committed
[IMP] awesome_dashboard: added layout component in dashboard.
added layout component in dashboard.js. created dashboard.scss to use className in xml. added display prop in layout.
1 parent 4a394e3 commit 12ab960

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { Component } from "@odoo/owl";
22
import { registry } from "@web/core/registry";
3+
import { Layout } from "@web/search/layout";
34

45
class AwesomeDashboard extends Component {
56
static template = "awesome_dashboard.AwesomeDashboard";
7+
static components = { Layout }
68
}
79

810
registry.category("actions").add("awesome_dashboard.dashboard", AwesomeDashboard);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.o_dashboard {
2+
background-color: gray;
3+
}

awesome_dashboard/static/src/dashboard.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
<templates xml:space="preserve">
33

44
<t t-name="awesome_dashboard.AwesomeDashboard">
5-
hello dashboard
5+
<Layout display="{controlPanel: {}}" className="'o_dashboard h-100'">
6+
<h1>Hello World</h1>
7+
</Layout>
68
</t>
79

810
</templates>

awesome_owl/static/src/todo/todoitem.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class TodoItem extends Component {
1313
this.props.toggleState(this.props.todo.id)
1414
}
1515

16-
onClickRremove(){
16+
onClickRemove(){
1717
this.props.removeTodo(this.props.todo.id)
1818
}
1919
}

awesome_owl/static/src/todo/todoitem.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<input type="checkbox" t-att-checked="props.todo.isCompleted" t-on-change="toggleIsCompleted"/>
66
<span t-esc="props.todo.id"/>.
77
<span t-esc="props.todo.description"/>
8-
<span style="margin-left: 10px; cursor: pointer;" t-on-click="onClickRremove">❌</span>
8+
<span style="margin-left: 10px; cursor: pointer;" t-on-click="onClickRemove">❌</span>
99
</div>
1010
</t>
1111
</templates>

awesome_owl/static/src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { useRef, onMounted } from "@odoo/owl";
22

3+
34
export function useAutofocus(refName) {
45
const ref = useRef(refName);
56

67
onMounted(() => {
78
if (ref.el) {
89
ref.el.focus();
910
}
10-
});
11-
11+
});
1212
return ref;
1313
}

0 commit comments

Comments
 (0)