Skip to content

Commit 292c7b8

Browse files
committed
[IMP] awesome_dashboard: add section 10
1 parent 164bc52 commit 292c7b8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

awesome_dashboard/static/src/dashboard/dashboard.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class AwesomeDashboard extends Component {
1414
static components = { Layout, DashboardItem, PieChart }
1515

1616
setup() {
17-
this.action = useService("action");
17+
this.action = useService("action")
1818
this.stats = useState(useService("awesome_dashboard.statistics"))
19-
this.items = items
19+
this.items = registry.category("awesome_dashboard").getAll()
2020
}
2121

2222
openPartners() {

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 @@
11
import { NumberCard } from "./number_card/number_card"
22
import { PieChartCard } from "./pie_chart_card/pie_chart_card"
3+
import { registry } from "@web/core/registry";
34

4-
export const items = [
5+
const items = [
56
{
67
id: "average_quantity",
78
description: "Average amount of t-shirt",
@@ -58,3 +59,7 @@ export const items = [
5859
})
5960
}
6061
]
62+
63+
items.forEach(i => {
64+
registry.category("awesome_dashboard").add(i.id, i);
65+
});

0 commit comments

Comments
 (0)