ch2.10 make it extensible

This commit is contained in:
Matt Marcha 2024-09-27 12:14:22 -10:00
parent 089ac45df2
commit 7f28d797c9
2 changed files with 10 additions and 3 deletions

View file

@ -20,7 +20,7 @@ class AwesomeDashboard extends Component {
this.stats = useState(useService('awesome_dashboard.statistics'));
this.items = items;
this.items = registry.category("awesome_dashboard").getAll();
}
openCustomers() {

View file

@ -1,7 +1,9 @@
/** @odoo-module */
import { NumberCard } from "./number_card/number_card";
import { PieChartCard } from "./pie_chart_card/pie_chart_card";
export const items = [
import { registry } from "@web/core/registry";
const items = [
{
id: "average_quantity",
description: "Average amount of t-shirt",
@ -57,4 +59,9 @@ export const items = [
values: data.orders_by_size,
})
}
]
items.forEach(item => {
registry.category("awesome_dashboard").add(item.id, item);
});