@deenruv/dashboard-widgets-plugin 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +58 -0
  3. package/dist/plugin-server/constants.d.ts +4 -0
  4. package/dist/plugin-server/constants.js +12 -0
  5. package/dist/plugin-server/controllers/admin-ui-controller.d.ts +4 -0
  6. package/dist/plugin-server/controllers/admin-ui-controller.js +46 -0
  7. package/dist/plugin-server/controllers/refresh-view-controller.d.ts +8 -0
  8. package/dist/plugin-server/controllers/refresh-view-controller.js +41 -0
  9. package/dist/plugin-server/index.d.ts +1 -0
  10. package/dist/plugin-server/index.js +17 -0
  11. package/dist/plugin-server/materialisedViewEntities/order_summary.d.ts +9 -0
  12. package/dist/plugin-server/materialisedViewEntities/order_summary.js +79 -0
  13. package/dist/plugin-server/materialisedViewEntities/orders_summary_with_state.d.ts +10 -0
  14. package/dist/plugin-server/materialisedViewEntities/orders_summary_with_state.js +79 -0
  15. package/dist/plugin-server/materialisedViewEntities/total_products.d.ts +7 -0
  16. package/dist/plugin-server/materialisedViewEntities/total_products.js +62 -0
  17. package/dist/plugin-server/materialisedViewEntities/total_products_with_state.d.ts +9 -0
  18. package/dist/plugin-server/materialisedViewEntities/total_products_with_state.js +62 -0
  19. package/dist/plugin-server/plugin.d.ts +6 -0
  20. package/dist/plugin-server/plugin.js +149 -0
  21. package/dist/plugin-server/raw-sql.d.ts +8 -0
  22. package/dist/plugin-server/raw-sql.js +48 -0
  23. package/dist/plugin-server/resolvers/admin.resolver.d.ts +47 -0
  24. package/dist/plugin-server/resolvers/admin.resolver.js +63 -0
  25. package/dist/plugin-server/services/metrics.service.d.ts +30 -0
  26. package/dist/plugin-server/services/metrics.service.js +272 -0
  27. package/dist/plugin-server/types.d.ts +20 -0
  28. package/dist/plugin-server/types.js +2 -0
  29. package/dist/plugin-server/utils.d.ts +1 -0
  30. package/dist/plugin-server/utils.js +12 -0
  31. package/dist/plugin-server/zeus/const.d.ts +6 -0
  32. package/dist/plugin-server/zeus/const.js +3675 -0
  33. package/dist/plugin-server/zeus/index.d.ts +18709 -0
  34. package/dist/plugin-server/zeus/index.js +1122 -0
  35. package/dist/plugin-server/zeus/typedDocumentNode.d.ts +3 -0
  36. package/dist/plugin-server/zeus/typedDocumentNode.js +16 -0
  37. package/dist/plugin-ui/components/CategoriesChartWidget/dashCaseToSpaces.d.ts +1 -0
  38. package/dist/plugin-ui/components/CategoriesChartWidget/dashCaseToSpaces.js +6 -0
  39. package/dist/plugin-ui/components/CategoriesChartWidget/index.d.ts +2 -0
  40. package/dist/plugin-ui/components/CategoriesChartWidget/index.js +100 -0
  41. package/dist/plugin-ui/components/LatestOrdersWidget/index.d.ts +4 -0
  42. package/dist/plugin-ui/components/LatestOrdersWidget/index.js +96 -0
  43. package/dist/plugin-ui/components/LatestOrdersWidget/paymentMethod.d.ts +6 -0
  44. package/dist/plugin-ui/components/LatestOrdersWidget/paymentMethod.js +7 -0
  45. package/dist/plugin-ui/components/OrdersWidget/CustomTooltip.d.ts +18 -0
  46. package/dist/plugin-ui/components/OrdersWidget/CustomTooltip.js +92 -0
  47. package/dist/plugin-ui/components/OrdersWidget/GroupBySelect.d.ts +8 -0
  48. package/dist/plugin-ui/components/OrdersWidget/GroupBySelect.js +17 -0
  49. package/dist/plugin-ui/components/OrdersWidget/MetricCustomDates.d.ts +9 -0
  50. package/dist/plugin-ui/components/OrdersWidget/MetricCustomDates.js +27 -0
  51. package/dist/plugin-ui/components/OrdersWidget/MetricTypeSelect.d.ts +9 -0
  52. package/dist/plugin-ui/components/OrdersWidget/MetricTypeSelect.js +17 -0
  53. package/dist/plugin-ui/components/OrdersWidget/OrdersChart.d.ts +24 -0
  54. package/dist/plugin-ui/components/OrdersWidget/OrdersChart.js +46 -0
  55. package/dist/plugin-ui/components/OrdersWidget/OrdersSummaryTile.d.ts +13 -0
  56. package/dist/plugin-ui/components/OrdersWidget/OrdersSummaryTile.js +115 -0
  57. package/dist/plugin-ui/components/OrdersWidget/ProductSelector.d.ts +17 -0
  58. package/dist/plugin-ui/components/OrdersWidget/ProductSelector.js +37 -0
  59. package/dist/plugin-ui/components/OrdersWidget/RatioBadge.d.ts +6 -0
  60. package/dist/plugin-ui/components/OrdersWidget/RatioBadge.js +12 -0
  61. package/dist/plugin-ui/components/OrdersWidget/index.d.ts +2 -0
  62. package/dist/plugin-ui/components/OrdersWidget/index.js +229 -0
  63. package/dist/plugin-ui/components/ProductsChartWidget/CustomBarChartTooltip.d.ts +9 -0
  64. package/dist/plugin-ui/components/ProductsChartWidget/CustomBarChartTooltip.js +14 -0
  65. package/dist/plugin-ui/components/ProductsChartWidget/index.d.ts +2 -0
  66. package/dist/plugin-ui/components/ProductsChartWidget/index.js +116 -0
  67. package/dist/plugin-ui/components/index.d.ts +4 -0
  68. package/dist/plugin-ui/components/index.js +4 -0
  69. package/dist/plugin-ui/components/shared/EmptyData.d.ts +6 -0
  70. package/dist/plugin-ui/components/shared/EmptyData.js +8 -0
  71. package/dist/plugin-ui/components/shared/MetricsRangeSelect.d.ts +10 -0
  72. package/dist/plugin-ui/components/shared/MetricsRangeSelect.js +26 -0
  73. package/dist/plugin-ui/components/shared/OrderStatesSelect.d.ts +8 -0
  74. package/dist/plugin-ui/components/shared/OrderStatesSelect.js +28 -0
  75. package/dist/plugin-ui/components/shared/PeriodSelect.d.ts +20 -0
  76. package/dist/plugin-ui/components/shared/PeriodSelect.js +56 -0
  77. package/dist/plugin-ui/components/shared/colors.d.ts +1 -0
  78. package/dist/plugin-ui/components/shared/colors.js +1 -0
  79. package/dist/plugin-ui/components/shared/index.d.ts +3 -0
  80. package/dist/plugin-ui/components/shared/index.js +3 -0
  81. package/dist/plugin-ui/graphql/index.d.ts +2 -0
  82. package/dist/plugin-ui/graphql/index.js +2 -0
  83. package/dist/plugin-ui/graphql/queries.d.ts +425 -0
  84. package/dist/plugin-ui/graphql/queries.js +182 -0
  85. package/dist/plugin-ui/graphql/selectors.d.ts +19 -0
  86. package/dist/plugin-ui/graphql/selectors.js +21 -0
  87. package/dist/plugin-ui/index.d.ts +9 -0
  88. package/dist/plugin-ui/index.js +21 -0
  89. package/dist/plugin-ui/locales/en/index.d.ts +72 -0
  90. package/dist/plugin-ui/locales/en/index.js +2 -0
  91. package/dist/plugin-ui/locales/en/test.json +71 -0
  92. package/dist/plugin-ui/locales/pl/index.d.ts +71 -0
  93. package/dist/plugin-ui/locales/pl/index.js +2 -0
  94. package/dist/plugin-ui/locales/pl/test.json +70 -0
  95. package/dist/plugin-ui/tsconfig.json +18 -0
  96. package/dist/plugin-ui/types.d.ts +64 -0
  97. package/dist/plugin-ui/types.js +14 -0
  98. package/dist/plugin-ui/utils.d.ts +70 -0
  99. package/dist/plugin-ui/utils.js +366 -0
  100. package/dist/plugin-ui/widgets.d.ts +15 -0
  101. package/dist/plugin-ui/widgets.js +36 -0
  102. package/dist/plugin-ui/zeus/const.d.ts +6 -0
  103. package/dist/plugin-ui/zeus/const.js +3672 -0
  104. package/dist/plugin-ui/zeus/index.d.ts +18709 -0
  105. package/dist/plugin-ui/zeus/index.js +1114 -0
  106. package/dist/plugin-ui/zeus/typedDocumentNode.d.ts +3 -0
  107. package/dist/plugin-ui/zeus/typedDocumentNode.js +9 -0
  108. package/package.json +52 -0
@@ -0,0 +1,182 @@
1
+ import { typedGql } from "../zeus/typedDocumentNode";
2
+ import { $, SortOrder } from "../zeus";
3
+ import { scalars } from "@deenruv/admin-types";
4
+ import { LatestOrderSelector, SummaryOrdersSelector } from "./selectors";
5
+ import { ORDER_STATE } from "@deenruv/react-ui-devkit";
6
+ export const OrdersSummaryQuery = typedGql("query", { scalars })({
7
+ orders: [
8
+ {
9
+ options: $("options", "OrderListOptions"),
10
+ },
11
+ { totalItems: true, items: SummaryOrdersSelector },
12
+ ],
13
+ });
14
+ export const CategoriesMetricQuery = typedGql("query", { scalars })({
15
+ chartMetric: [
16
+ {
17
+ input: $("input", "ChartMetricInput!"),
18
+ },
19
+ {
20
+ data: {
21
+ title: true,
22
+ type: true,
23
+ entries: {
24
+ intervalTick: true,
25
+ value: true,
26
+ additionalData: {
27
+ id: true,
28
+ name: true,
29
+ quantity: true,
30
+ },
31
+ },
32
+ },
33
+ },
34
+ ],
35
+ });
36
+ export const ChartMetricQuery = typedGql("query", { scalars })({
37
+ __alias: {
38
+ prevChartMetric: {
39
+ chartMetric: [
40
+ {
41
+ input: $("prevInput", "ChartMetricInput!"),
42
+ },
43
+ {
44
+ data: {
45
+ title: true,
46
+ type: true,
47
+ entries: {
48
+ intervalTick: true,
49
+ value: true,
50
+ additionalData: {
51
+ id: true,
52
+ name: true,
53
+ quantity: true,
54
+ },
55
+ },
56
+ },
57
+ },
58
+ ],
59
+ },
60
+ },
61
+ chartMetric: [
62
+ {
63
+ input: $("input", "ChartMetricInput!"),
64
+ },
65
+ {
66
+ data: {
67
+ title: true,
68
+ type: true,
69
+ entries: {
70
+ intervalTick: true,
71
+ value: true,
72
+ additionalData: {
73
+ id: true,
74
+ name: true,
75
+ quantity: true,
76
+ },
77
+ },
78
+ },
79
+ },
80
+ ],
81
+ });
82
+ export const BarChartMetricQuery = typedGql("query", { scalars })({
83
+ chartMetric: [
84
+ {
85
+ input: $("input", "ChartMetricInput!"),
86
+ },
87
+ {
88
+ data: {
89
+ title: true,
90
+ type: true,
91
+ entries: {
92
+ intervalTick: true,
93
+ value: true,
94
+ additionalData: {
95
+ id: true,
96
+ name: true,
97
+ quantity: true,
98
+ },
99
+ },
100
+ },
101
+ },
102
+ ],
103
+ });
104
+ export const OrderSummaryMetricsQuery = typedGql("query", { scalars })({
105
+ __alias: {
106
+ prevOrderSummaryMetric: {
107
+ orderSummaryMetric: [
108
+ { input: $("prevInput", "OrderSummaryMetricInput!") },
109
+ {
110
+ __typename: true,
111
+ data: {
112
+ __typename: true,
113
+ currencyCode: true,
114
+ averageOrderValue: true,
115
+ averageOrderValueWithTax: true,
116
+ orderCount: true,
117
+ total: true,
118
+ totalWithTax: true,
119
+ productCount: true,
120
+ },
121
+ },
122
+ ],
123
+ },
124
+ },
125
+ orderSummaryMetric: [
126
+ { input: $("input", "OrderSummaryMetricInput!") },
127
+ {
128
+ __typename: true,
129
+ data: {
130
+ __typename: true,
131
+ currencyCode: true,
132
+ averageOrderValue: true,
133
+ averageOrderValueWithTax: true,
134
+ orderCount: true,
135
+ total: true,
136
+ totalWithTax: true,
137
+ productCount: true,
138
+ },
139
+ },
140
+ ],
141
+ });
142
+ export const ProductCollectionsQuery = typedGql("query", { scalars })({
143
+ products: [
144
+ {
145
+ options: {
146
+ filter: {
147
+ id: {
148
+ in: $("in", "[String!]"),
149
+ },
150
+ },
151
+ },
152
+ },
153
+ { items: { collections: { slug: true } } },
154
+ ],
155
+ });
156
+ const LATEST_ORDERS_EXCLUDED_STATUSES = [
157
+ ORDER_STATE.CANCELLED,
158
+ ORDER_STATE.DRAFT,
159
+ ORDER_STATE.MODIFYING,
160
+ ORDER_STATE.ADDING_ITEMS,
161
+ ];
162
+ export const LatestOrdersQuery = typedGql("query", { scalars })({
163
+ orders: [
164
+ {
165
+ options: {
166
+ take: 5,
167
+ filter: {
168
+ active: { eq: false },
169
+ state: { notIn: LATEST_ORDERS_EXCLUDED_STATUSES },
170
+ },
171
+ sort: { createdAt: SortOrder.DESC },
172
+ },
173
+ },
174
+ {
175
+ items: LatestOrderSelector,
176
+ totalItems: true,
177
+ },
178
+ ],
179
+ });
180
+ export const AdditionalOrderStatesQuery = typedGql("query", { scalars })({
181
+ additionalOrderStates: { state: true, selectedByDefault: true },
182
+ });
@@ -0,0 +1,19 @@
1
+ import { FromSelectorWithScalars } from "@deenruv/admin-types";
2
+ export declare const SummaryOrdersSelector: {
3
+ total: true;
4
+ totalWithTax: true;
5
+ currencyCode: true;
6
+ };
7
+ export declare const LatestOrderSelector: {
8
+ totalWithTax: true;
9
+ state: true;
10
+ createdAt: true;
11
+ code: true;
12
+ id: true;
13
+ currencyCode: true;
14
+ payments: {
15
+ method: true;
16
+ id: true;
17
+ };
18
+ };
19
+ export type LatestOrderListType = FromSelectorWithScalars<typeof LatestOrderSelector, "Order">;
@@ -0,0 +1,21 @@
1
+ import { Selector } from "../zeus";
2
+ export const SummaryOrdersSelector = Selector("Order")({
3
+ total: true,
4
+ totalWithTax: true,
5
+ currencyCode: true,
6
+ });
7
+ export const LatestOrderSelector = Selector("Order")({
8
+ totalWithTax: true,
9
+ state: true,
10
+ createdAt: true,
11
+ code: true,
12
+ id: true,
13
+ currencyCode: true,
14
+ // getRealization: {
15
+ // finalPlannedAt: true,
16
+ // },
17
+ payments: {
18
+ method: true,
19
+ id: true,
20
+ },
21
+ });
@@ -0,0 +1,9 @@
1
+ export type UIPluginOptions = {
2
+ horizontalChartColors: {
3
+ colorFrom: string;
4
+ colorTo: string;
5
+ stroke: string;
6
+ };
7
+ barChartColors?: string[];
8
+ };
9
+ export declare const UIPlugin: import("@deenruv/react-ui-devkit").DeenruvUIPlugin<UIPluginOptions>;
@@ -0,0 +1,21 @@
1
+ import { createDeenruvUIPlugin } from "@deenruv/react-ui-devkit";
2
+ import { widgets } from "./widgets";
3
+ import pl from "./locales/pl";
4
+ import en from "./locales/en";
5
+ export const UIPlugin = createDeenruvUIPlugin({
6
+ config: {
7
+ horizontalChartColors: {
8
+ colorFrom: `#4338ca`,
9
+ colorTo: `#6366f1`,
10
+ stroke: `#6366f1`,
11
+ },
12
+ barChartColors: ["#2563eb", "#60a5fa", "#3b82f6", "#93c5fd", "#bfdbfe"],
13
+ },
14
+ version: "1.0.0",
15
+ name: "Dashboard Widgets Plugin",
16
+ widgets,
17
+ translations: {
18
+ ns: "dashboard-widgets-plugin",
19
+ data: { en, pl },
20
+ },
21
+ });
@@ -0,0 +1,72 @@
1
+ declare const _default: {
2
+ metrics: string;
3
+ averageOrderValue: string;
4
+ averageOrdersValue: string;
5
+ bestsellers: string;
6
+ categories: string;
7
+ showAll: string;
8
+ summary: string;
9
+ sold: string;
10
+ soldValue: string;
11
+ orderCount: string;
12
+ orderTotal: string;
13
+ dataTypes: string;
14
+ intervalTypes: string;
15
+ selectDataType: string;
16
+ selectIntervalType: string;
17
+ latestOrders: string;
18
+ ordersSummary: string;
19
+ payment: string;
20
+ totalOrdersCount: string;
21
+ totalOrdersValue: string;
22
+ today: string;
23
+ yesterday: string;
24
+ thisWeek: string;
25
+ lastWeek: string;
26
+ thisMonth: string;
27
+ lastMonth: string;
28
+ thisYear: string;
29
+ LastYear: string;
30
+ gross: string;
31
+ net: string;
32
+ firstYearQuarterInterval: string;
33
+ secondYearQuarterInterval: string;
34
+ thirdYearQuarterInterval: string;
35
+ fourthYearQuarterInterval: string;
36
+ customInterval: string;
37
+ chooseStartDate: string;
38
+ chooseEndDate: string;
39
+ orderTotalProductsCount: string;
40
+ orderTotalProductsValue: string;
41
+ emptyDataTitle: string;
42
+ emptyData: string;
43
+ lastRefresh: string;
44
+ sortBy: string;
45
+ sortByCount: string;
46
+ sortByNet: string;
47
+ showFirstFive: string;
48
+ variantID: string;
49
+ previous: string;
50
+ netSold: string;
51
+ averageNetSold: string;
52
+ grossSold: string;
53
+ averageGrossSold: string;
54
+ orders: string;
55
+ soldProducts: string;
56
+ compare: string;
57
+ selectOrderStates: string;
58
+ selectedOrderStates: string;
59
+ searchOrderStates: string;
60
+ noOrderStatesFound: string;
61
+ selectedProducts: string;
62
+ selectProducts: string;
63
+ searchProducts: string;
64
+ noProductsFound: string;
65
+ clearSelected: string;
66
+ groupBy: string;
67
+ byDay: string;
68
+ byWeek: string;
69
+ byMonth: string;
70
+ byQuarter: string;
71
+ }[];
72
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import test from "./test.json";
2
+ export default [test];
@@ -0,0 +1,71 @@
1
+ {
2
+ "metrics": "Metrics",
3
+ "averageOrderValue": "Average order value",
4
+ "averageOrdersValue": "Average order value",
5
+ "bestsellers": "Bestsellers",
6
+ "categories": "Popular categories",
7
+ "showAll": "All",
8
+ "summary": "Summary",
9
+ "sold": "Sold: ",
10
+ "soldValue": "Sold value: ",
11
+ "orderCount": "Order count",
12
+ "orderTotal": "Order total",
13
+ "dataTypes": "Data types",
14
+ "intervalTypes": "Interval types",
15
+ "selectDataType": "Select data type",
16
+ "selectIntervalType": "Select interval type",
17
+ "latestOrders": "Latest orders",
18
+ "ordersSummary": "Orders summary",
19
+ "payment": "Payment",
20
+ "totalOrdersCount": "Total orders count",
21
+ "totalOrdersValue": "Total orders value",
22
+ "today": "Today",
23
+ "yesterday": "Yesterday",
24
+ "thisWeek": "This week",
25
+ "lastWeek": "Last week",
26
+ "thisMonth": "This month",
27
+ "lastMonth": "Last month",
28
+ "thisYear": "This year",
29
+ "LastYear": "Last year",
30
+ "gross": "Gross",
31
+ "net": "Net",
32
+ "firstYearQuarterInterval": "I quarter",
33
+ "secondYearQuarterInterval": "II quarter",
34
+ "thirdYearQuarterInterval": "III quarter",
35
+ "fourthYearQuarterInterval": "IV quarter",
36
+ "customInterval": "Custom",
37
+ "chooseStartDate": "Choose start date",
38
+ "chooseEndDate": "Choose end date",
39
+ "orderTotalProductsCount": "Total products count",
40
+ "orderTotalProductsValue": "Total products value",
41
+ "emptyDataTitle": "No orders",
42
+ "emptyData": "Looks like there are no orders for selected period",
43
+ "lastRefresh": "Last refresh: ",
44
+ "sortBy": "Sort by",
45
+ "sortByCount": "Sort by count",
46
+ "sortByNet": "Sort by values",
47
+ "showFirstFive": "Top five",
48
+ "variantID": "Variant ID",
49
+ "previous": "Previous",
50
+ "netSold": "Net sold",
51
+ "averageNetSold": "Average net sold",
52
+ "grossSold": "Gross sold",
53
+ "averageGrossSold": "Average gross sold",
54
+ "orders": "Orders",
55
+ "soldProducts": "Sold products",
56
+ "compare": "Compare with previous period",
57
+ "selectOrderStates": "Select order states",
58
+ "selectedOrderStates": "Selected order states",
59
+ "searchOrderStates": "Search order states...",
60
+ "noOrderStatesFound": "No order states found",
61
+ "selectedProducts": "Selected products",
62
+ "selectProducts": "Select products..",
63
+ "searchProducts": "Search product..",
64
+ "noProductsFound": "No products found",
65
+ "clearSelected": "Clear selected",
66
+ "groupBy": "Group by..",
67
+ "byDay": "Group by day",
68
+ "byWeek": "Group by week",
69
+ "byMonth": "Group by month",
70
+ "byQuarter": "Group by quarter"
71
+ }
@@ -0,0 +1,71 @@
1
+ declare const _default: {
2
+ metrics: string;
3
+ averageOrderValue: string;
4
+ bestsellers: string;
5
+ categories: string;
6
+ showAll: string;
7
+ sold: string;
8
+ summary: string;
9
+ soldValue: string;
10
+ orderCount: string;
11
+ orderTotal: string;
12
+ dataTypes: string;
13
+ intervalTypes: string;
14
+ selectDataType: string;
15
+ selectIntervalType: string;
16
+ latestOrders: string;
17
+ ordersSummary: string;
18
+ payment: string;
19
+ totalOrdersCount: string;
20
+ totalOrdersValue: string;
21
+ today: string;
22
+ yesterday: string;
23
+ thisWeek: string;
24
+ lastWeek: string;
25
+ thisMonth: string;
26
+ lastMonth: string;
27
+ thisYear: string;
28
+ lastYear: string;
29
+ gross: string;
30
+ net: string;
31
+ firstYearQuarterInterval: string;
32
+ secondYearQuarterInterval: string;
33
+ thirdYearQuarterInterval: string;
34
+ fourthYearQuarterInterval: string;
35
+ customInterval: string;
36
+ chooseStartDate: string;
37
+ chooseEndDate: string;
38
+ orderTotalProductsCount: string;
39
+ orderTotalProductsValue: string;
40
+ emptyDataTitle: string;
41
+ emptyData: string;
42
+ lastRefresh: string;
43
+ sortBy: string;
44
+ sortByCount: string;
45
+ sortByNet: string;
46
+ showFirstFive: string;
47
+ variantID: string;
48
+ previous: string;
49
+ netSold: string;
50
+ averageNetSold: string;
51
+ grossSold: string;
52
+ averageGrossSold: string;
53
+ orders: string;
54
+ soldProducts: string;
55
+ compare: string;
56
+ selectOrderStates: string;
57
+ selectedOrderStates: string;
58
+ searchOrderStates: string;
59
+ noOrderStatesFound: string;
60
+ selectedProducts: string;
61
+ selectProducts: string;
62
+ searchProducts: string;
63
+ noProductsFound: string;
64
+ clearSelected: string;
65
+ groupBy: string;
66
+ byDay: string;
67
+ byWeek: string;
68
+ byMonth: string;
69
+ byQuarter: string;
70
+ }[];
71
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import test from "./test.json";
2
+ export default [test];
@@ -0,0 +1,70 @@
1
+ {
2
+ "metrics": "Wykres szczegółowy",
3
+ "averageOrderValue": "Średnia wartość zamówień",
4
+ "bestsellers": "Bestsellery",
5
+ "categories": "Popularne kategorie",
6
+ "showAll": "Wszystkie",
7
+ "sold": "Sprzedano: ",
8
+ "summary": "Podsumowanie sprzedaży",
9
+ "soldValue": "Wartość sprzedaży: ",
10
+ "orderCount": "Ilość zamówień",
11
+ "orderTotal": "Wartość zamówień",
12
+ "dataTypes": "Dostępne typy danych",
13
+ "intervalTypes": "Typ interwału",
14
+ "selectDataType": "Wybierz typ danych",
15
+ "selectIntervalType": "Wybierz tryb interwału",
16
+ "latestOrders": "Ostatnie zamówienia",
17
+ "ordersSummary": "Sprzedaż",
18
+ "payment": "Płatność",
19
+ "totalOrdersCount": "Zamówienia",
20
+ "totalOrdersValue": "Przychód",
21
+ "today": "Dzisiaj",
22
+ "yesterday": "Wczoraj",
23
+ "thisWeek": "Ten tydzień",
24
+ "lastWeek": "Poprzedni tydzień",
25
+ "thisMonth": "Ten miesiąc",
26
+ "lastMonth": "Poprzedni miesiąc",
27
+ "thisYear": "Ten rok",
28
+ "lastYear": "Poprzedni rok",
29
+ "gross": "Brutto",
30
+ "net": "Netto",
31
+ "firstYearQuarterInterval": "I kwartał",
32
+ "secondYearQuarterInterval": "II kwartał",
33
+ "thirdYearQuarterInterval": "III kwartał",
34
+ "fourthYearQuarterInterval": "IV kwartał",
35
+ "customInterval": "Niestandardowy",
36
+ "chooseStartDate": "Data początkowa",
37
+ "chooseEndDate": "Data końcowa",
38
+ "orderTotalProductsCount": "Liczba sprzedanych produktów",
39
+ "orderTotalProductsValue": "Wartość sprzedanych produktów",
40
+ "emptyDataTitle": "Brak zamówień",
41
+ "emptyData": "Wygląda na to, że nie ma zamówień dla wybranego okresu",
42
+ "lastRefresh": "Ostatnia aktualizacja: ",
43
+ "sortBy": "Sortuj po",
44
+ "sortByCount": "Sortuj po ilości",
45
+ "sortByNet": "Sortuj po wartości",
46
+ "showFirstFive": "Top pięć",
47
+ "variantID": "ID wariantu",
48
+ "previous": "Poprzednio",
49
+ "netSold": "Sprzedaż netto",
50
+ "averageNetSold": "Średnia sprzedaż netto",
51
+ "grossSold": "Sprzedaż brutto",
52
+ "averageGrossSold": "Średnia sprzedaż brutto",
53
+ "orders": "Zamówienia",
54
+ "soldProducts": "Sprzedane produkty",
55
+ "compare": "Porównaj z poprzednim okresem",
56
+ "selectOrderStates": "Wybierz stany zamówień",
57
+ "selectedOrderStates": "Wybrane stany zamówień",
58
+ "searchOrderStates": "Wyszukaj stany zamówień...",
59
+ "noOrderStatesFound": "Nie znaleziono stanów zamówień",
60
+ "selectedProducts": "Wybrane produkty",
61
+ "selectProducts": "Wybierz produkty..",
62
+ "searchProducts": "Wyszukaj parodukt..",
63
+ "noProductsFound": "Nie znaleziono produktów",
64
+ "clearSelected": "Wyczyść wybrane",
65
+ "groupBy": "Grupuj według..",
66
+ "byDay": "Grupuj wg. dnia",
67
+ "byWeek": "Grupuj wg. tygodnia",
68
+ "byMonth": "Grupuj wg. miesiąca",
69
+ "byQuarter": "Grupuj wg. kwartału"
70
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "ESNext",
4
+ "moduleResolution": "node",
5
+ "target": "ES2020",
6
+ "jsx": "react",
7
+ "outDir": "../../dist/plugin-ui",
8
+ "importHelpers": true,
9
+ "declaration": true,
10
+ "resolveJsonModule": true,
11
+ "skipLibCheck": true,
12
+ "strict": true,
13
+ "noImplicitAny": true,
14
+ "esModuleInterop": true,
15
+ "allowSyntheticDefaultImports": true
16
+ },
17
+ "include": ["./**/*.tsx", "./**/*.json", "./**/*.ts"]
18
+ }
@@ -0,0 +1,64 @@
1
+ import { ChartMetricType } from "./zeus";
2
+ export type AdditionalEntryData = {
3
+ id: string;
4
+ name: string;
5
+ quantity: number;
6
+ };
7
+ export type DataTKeys = "averageOrderValue" | "orderCount" | "orderTotal" | "orderTotalProductsCount" | "orderTotalProductsValue";
8
+ export type BetterMetricsChartDataType = {
9
+ data: {
10
+ title: string;
11
+ type: ChartMetricType;
12
+ entries: {
13
+ type: ChartMetricType;
14
+ name: string;
15
+ value: number;
16
+ additionalData?: AdditionalEntryData[];
17
+ }[];
18
+ }[];
19
+ lastCacheRefreshTime?: string;
20
+ };
21
+ export type AvailableProductData = {
22
+ id: string;
23
+ name: string;
24
+ label: string;
25
+ value: number;
26
+ }[];
27
+ export type SortBy = "BY_COUNT" | "BY_NET_WORTH";
28
+ export type ShowData = "FIRST_FIVE" | "ALL";
29
+ export declare enum Periods {
30
+ Today = "today",
31
+ Yesterday = "yesterday",
32
+ ThisWeek = "thisWeek",
33
+ LastWeek = "lastWeek",
34
+ ThisMonth = "thisMonth",
35
+ lastMonth = "lastMonth",
36
+ ThisYear = "thisYear",
37
+ FirstYearQuarter = "firstYearQuarterInterval",
38
+ SecondYearQuarter = "secondYearQuarterInterval",
39
+ ThirdYearQuarter = "thirdYearQuarterInterval",
40
+ FourthYearQuarter = "fourthYearQuarterInterval"
41
+ }
42
+ export type Period = {
43
+ period: Periods;
44
+ text: string;
45
+ start: Date;
46
+ end: Date;
47
+ };
48
+ export type GrossNet = "gross" | "net";
49
+ export type DateRangeType = {
50
+ start: Date;
51
+ end?: Date;
52
+ };
53
+ export type GroupBy = "day" | "week" | "quarter" | "month";
54
+ export interface GroupByPeriodArgs {
55
+ data: {
56
+ [key: string]: any;
57
+ name: string;
58
+ value?: number;
59
+ type: ChartMetricType;
60
+ additionalData?: AdditionalEntryData[];
61
+ }[];
62
+ language: string;
63
+ groupBy: GroupBy;
64
+ }
@@ -0,0 +1,14 @@
1
+ export var Periods;
2
+ (function (Periods) {
3
+ Periods["Today"] = "today";
4
+ Periods["Yesterday"] = "yesterday";
5
+ Periods["ThisWeek"] = "thisWeek";
6
+ Periods["LastWeek"] = "lastWeek";
7
+ Periods["ThisMonth"] = "thisMonth";
8
+ Periods["lastMonth"] = "lastMonth";
9
+ Periods["ThisYear"] = "thisYear";
10
+ Periods["FirstYearQuarter"] = "firstYearQuarterInterval";
11
+ Periods["SecondYearQuarter"] = "secondYearQuarterInterval";
12
+ Periods["ThirdYearQuarter"] = "thirdYearQuarterInterval";
13
+ Periods["FourthYearQuarter"] = "fourthYearQuarterInterval";
14
+ })(Periods || (Periods = {}));