Skip to content

Commit eadf4c3

Browse files
committed
[IMP] awesome_dashboard: Extensible dashboard
1 parent 0a449a3 commit eadf4c3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

awesome_dashboard/static/src/dashboard/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class AwesomeDashboard extends Component {
1313
setup() {
1414
this.action = useService("action");
1515
this.state = reactive({ statistics: useService("statistics") });
16-
this.items = dashboard_items;
16+
this.items = registry.category("awesome_dashboard").getAll();
1717
}
1818

1919
openLeads() {

awesome_dashboard/static/src/dashboard/dashboard_items.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { registry } from "@web/core/registry";
12
import { PieChartCard } from "./pie_chart_card/pie_chart_card";
23
import { NumberCard } from "./number_card/number_card";
34

4-
export default [
5+
const items = [
56
{
67
id: "average_quantity",
78
description: "Average amount of t-shirt",
@@ -63,3 +64,7 @@ export default [
6364
}),
6465
},
6566
]
67+
68+
items.forEach(item => {
69+
registry.category("awesome_dashboard").add(item.id, item);
70+
});

0 commit comments

Comments
 (0)