@allurereport/web-dashboard 3.0.0-beta.12 → 3.0.0-beta.14
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.
- package/dist/multi/app-38a81136.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/{styles-1ef294bc.css → styles-38a81136.css} +1 -2
- package/dist/single/app-716851c4.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +4 -4
- package/src/components/Dashboard/index.tsx +16 -6
- package/dist/multi/app-1ef294bc.js +0 -2
- package/dist/single/app-4b8d700b.js +0 -2
- package/src/components/Dashboard/components/TrendChartWidget/index.tsx +0 -69
- package/src/components/Dashboard/components/Widget/index.tsx +0 -19
- package/src/components/Dashboard/components/Widget/styles.scss +0 -31
- /package/dist/multi/{173.app-1ef294bc.js → 173.app-38a81136.js} +0 -0
- /package/dist/multi/{174.app-1ef294bc.js → 174.app-38a81136.js} +0 -0
- /package/dist/multi/{252.app-1ef294bc.js → 252.app-38a81136.js} +0 -0
- /package/dist/multi/{282.app-1ef294bc.js → 282.app-38a81136.js} +0 -0
- /package/dist/multi/{29.app-1ef294bc.js → 29.app-38a81136.js} +0 -0
- /package/dist/multi/{416.app-1ef294bc.js → 416.app-38a81136.js} +0 -0
- /package/dist/multi/{527.app-1ef294bc.js → 527.app-38a81136.js} +0 -0
- /package/dist/multi/{600.app-1ef294bc.js → 600.app-38a81136.js} +0 -0
- /package/dist/multi/{605.app-1ef294bc.js → 605.app-38a81136.js} +0 -0
- /package/dist/multi/{638.app-1ef294bc.js → 638.app-38a81136.js} +0 -0
- /package/dist/multi/{672.app-1ef294bc.js → 672.app-38a81136.js} +0 -0
- /package/dist/multi/{686.app-1ef294bc.js → 686.app-38a81136.js} +0 -0
- /package/dist/multi/{725.app-1ef294bc.js → 725.app-38a81136.js} +0 -0
- /package/dist/multi/{741.app-1ef294bc.js → 741.app-38a81136.js} +0 -0
- /package/dist/multi/{755.app-1ef294bc.js → 755.app-38a81136.js} +0 -0
- /package/dist/multi/{894.app-1ef294bc.js → 894.app-38a81136.js} +0 -0
- /package/dist/multi/{943.app-1ef294bc.js → 943.app-38a81136.js} +0 -0
- /package/dist/multi/{980.app-1ef294bc.js → 980.app-38a81136.js} +0 -0
- /package/dist/multi/{app-1ef294bc.js.LICENSE.txt → app-38a81136.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-4b8d700b.js.LICENSE.txt → app-716851c4.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/web-dashboard",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.14",
|
|
4
4
|
"description": "The static files for Allure Dashboard Report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"IE 11"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
35
|
-
"@allurereport/web-commons": "3.0.0-beta.
|
|
36
|
-
"@allurereport/web-components": "3.0.0-beta.
|
|
34
|
+
"@allurereport/core-api": "3.0.0-beta.14",
|
|
35
|
+
"@allurereport/web-commons": "3.0.0-beta.14",
|
|
36
|
+
"@allurereport/web-components": "3.0.0-beta.14",
|
|
37
37
|
"@preact/signals": "^1.3.0",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"i18next": "^24.0.2",
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
2
|
import { capitalize } from "@allurereport/web-commons";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Grid,
|
|
5
|
+
GridItem,
|
|
6
|
+
Loadable,
|
|
7
|
+
PageLoader,
|
|
8
|
+
SuccessRatePieChart,
|
|
9
|
+
TrendChartWidget,
|
|
10
|
+
Widget,
|
|
11
|
+
} from "@allurereport/web-components";
|
|
4
12
|
import { useEffect } from "preact/hooks";
|
|
5
13
|
import { type ChartData, ChartType, dashboardStore, fetchDashboardData } from "@/stores/dashboard";
|
|
6
14
|
import { useI18n } from "@/stores/locale";
|
|
7
|
-
import { TrendChartWidget } from "./components/TrendChartWidget";
|
|
8
|
-
import { Widget } from "./components/Widget";
|
|
9
15
|
import * as styles from "./styles.scss";
|
|
10
16
|
|
|
11
|
-
const getChartWidgetByType = (
|
|
17
|
+
const getChartWidgetByType = (
|
|
18
|
+
chartData: ChartData,
|
|
19
|
+
{ t, empty }: Record<string, (key: string, options?: any) => string>,
|
|
20
|
+
) => {
|
|
12
21
|
switch (chartData.type) {
|
|
13
22
|
case ChartType.Trend: {
|
|
14
23
|
const type = t(`trend.type.${chartData.dataType}`);
|
|
@@ -21,6 +30,7 @@ const getChartWidgetByType = (chartData: ChartData, t: (key: string, options?: a
|
|
|
21
30
|
slices={chartData.slices}
|
|
22
31
|
min={chartData.min}
|
|
23
32
|
max={chartData.max}
|
|
33
|
+
translations={{ "no-results": empty("no-results") }}
|
|
24
34
|
/>
|
|
25
35
|
);
|
|
26
36
|
}
|
|
@@ -42,6 +52,7 @@ const getChartWidgetByType = (chartData: ChartData, t: (key: string, options?: a
|
|
|
42
52
|
|
|
43
53
|
export const Dashboard = () => {
|
|
44
54
|
const { t } = useI18n("charts");
|
|
55
|
+
const { t: empty } = useI18n("empty");
|
|
45
56
|
|
|
46
57
|
useEffect(() => {
|
|
47
58
|
fetchDashboardData();
|
|
@@ -53,8 +64,7 @@ export const Dashboard = () => {
|
|
|
53
64
|
renderLoader={() => <PageLoader />}
|
|
54
65
|
renderData={(data) => {
|
|
55
66
|
const charts = Object.entries(data).map(([chartId, value]) => {
|
|
56
|
-
const chartWidget = getChartWidgetByType(value, t);
|
|
57
|
-
|
|
67
|
+
const chartWidget = getChartWidgetByType(value, { t, empty });
|
|
58
68
|
return (
|
|
59
69
|
<GridItem key={chartId} className={styles["overview-grid-item"]}>
|
|
60
70
|
{chartWidget}
|