-
Notifications
You must be signed in to change notification settings - Fork 3k
Expand file tree
/
Copy pathdashboard_items.js
More file actions
65 lines (63 loc) · 1.84 KB
/
dashboard_items.js
File metadata and controls
65 lines (63 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import { NumberCard } from "./number_card/number_card";
import { PieChartCard } from "./pie_chart_card/pie_chart_card";
import {registry} from "@web/core/registry";
const items = [
{
id: "average_quantity",
description: "Average amount of t-shirt",
Component: NumberCard,
props: (data) => ({
title: "Average amount of t-shirt by order this month",
value: data.average_quantity,
}),
},
{
id: "average_time",
description: "Average order processing time",
Component: NumberCard,
size: 2,
props: (data) => ({
title: "Average time for an order to go from 'new' to 'sent' or 'cancelled' ",
value: data.average_time,
}),
},
{
id: "nb_new_orders",
description: "Number of new orders",
Component: NumberCard,
props: (data) => ({
title: "Number of new orders this month",
value: data.nb_new_orders,
}),
},
{
id: "nb_cancelled_orders",
description: "Number of cancelled orders",
Component: NumberCard,
props: (data) => ({
title: "Number of cancelled orders this month",
value: data.nb_cancelled_orders,
}),
},
{
id: "total_amount",
description: "Total new orders",
Component: NumberCard,
props: (data) => ({
title: "Total amount of new orders this month",
value: data.total_amount,
}),
},
{
id: "orders_by_size",
description: "Shirt orders by size",
Component: PieChartCard,
props: (data) => ({
title: "Shirt orders by size",
data: data.orders_by_size,
}),
},
];
items.forEach((item) => {
registry.category("awesome_dashboard").add(item.id, item);
});