@allurereport/web-awesome 3.0.0-beta.24 → 3.0.0-beta.25
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-c2ae6c823c3af799e2d4.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/{styles-c0d22dac0f1d971a76eb.css → styles-016f0a9ec6cfcb83a8b3.css} +1 -1
- package/dist/single/app-0c8570034ae48c739e8e.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +6 -6
- package/src/components/Timeline/index.tsx +9 -17
- package/src/stores/timeline.ts +7 -2
- package/webpack.config.js +12 -1
- package/dist/multi/app-9744a06934ffbef2c892.js +0 -2
- package/dist/single/app-bfa8df3fad4158726f8e.js +0 -2
- /package/dist/multi/{173.app-9744a06934ffbef2c892.js → 173.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{174.app-9744a06934ffbef2c892.js → 174.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{252.app-9744a06934ffbef2c892.js → 252.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{282.app-9744a06934ffbef2c892.js → 282.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{29.app-9744a06934ffbef2c892.js → 29.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{416.app-9744a06934ffbef2c892.js → 416.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{527.app-9744a06934ffbef2c892.js → 527.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{600.app-9744a06934ffbef2c892.js → 600.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{605.app-9744a06934ffbef2c892.js → 605.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{638.app-9744a06934ffbef2c892.js → 638.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{672.app-9744a06934ffbef2c892.js → 672.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{686.app-9744a06934ffbef2c892.js → 686.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{725.app-9744a06934ffbef2c892.js → 725.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{741.app-9744a06934ffbef2c892.js → 741.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{755.app-9744a06934ffbef2c892.js → 755.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{894.app-9744a06934ffbef2c892.js → 894.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{943.app-9744a06934ffbef2c892.js → 943.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{980.app-9744a06934ffbef2c892.js → 980.app-c2ae6c823c3af799e2d4.js} +0 -0
- /package/dist/multi/{app-9744a06934ffbef2c892.js.LICENSE.txt → app-c2ae6c823c3af799e2d4.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-bfa8df3fad4158726f8e.js.LICENSE.txt → app-0c8570034ae48c739e8e.js.LICENSE.txt} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allurereport/web-awesome",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.25",
|
|
4
4
|
"description": "The static files for Allure Awesome Report",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"allure",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"IE 11"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@allurereport/charts-api": "3.0.0-beta.
|
|
35
|
-
"@allurereport/core-api": "3.0.0-beta.
|
|
36
|
-
"@allurereport/plugin-api": "3.0.0-beta.
|
|
37
|
-
"@allurereport/web-commons": "3.0.0-beta.
|
|
38
|
-
"@allurereport/web-components": "3.0.0-beta.
|
|
34
|
+
"@allurereport/charts-api": "3.0.0-beta.25",
|
|
35
|
+
"@allurereport/core-api": "3.0.0-beta.25",
|
|
36
|
+
"@allurereport/plugin-api": "3.0.0-beta.25",
|
|
37
|
+
"@allurereport/web-commons": "3.0.0-beta.25",
|
|
38
|
+
"@allurereport/web-components": "3.0.0-beta.25",
|
|
39
39
|
"@preact/signals": "^1.3.0",
|
|
40
40
|
"clsx": "^2.1.1",
|
|
41
41
|
"d3-shape": "^3.2.0",
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
-
import type { TestResult } from "@allurereport/core-api";
|
|
3
1
|
import { Timeline as AllureTimeline, Grid, GridItem, Loadable, PageLoader, Widget } from "@allurereport/web-components";
|
|
4
2
|
import { computed } from "@preact/signals";
|
|
5
3
|
import { useEffect, useMemo } from "preact/hooks";
|
|
6
4
|
import { useI18n } from "@/stores";
|
|
7
5
|
import { currentEnvironment } from "@/stores/env";
|
|
6
|
+
import type { TimlineTr } from "@/stores/timeline";
|
|
8
7
|
import { fetchTimelineData, timelineStore } from "@/stores/timeline";
|
|
9
8
|
import * as styles from "./styles.scss";
|
|
10
9
|
|
|
11
|
-
const getHosts = (tests:
|
|
10
|
+
const getHosts = (tests: TimlineTr[]) => [
|
|
12
11
|
...new Set(tests.map((test) => test.labels.find((label) => label.name === "host")?.value).filter(Boolean)),
|
|
13
12
|
];
|
|
14
13
|
|
|
15
|
-
const filterTestsByHost = (tests:
|
|
14
|
+
const filterTestsByHost = (tests: TimlineTr[], host: string) =>
|
|
16
15
|
tests.filter((test) => test.labels.find((label) => label.name === "host")?.value === host);
|
|
17
16
|
|
|
18
17
|
const currentTimelineData = computed(() => {
|
|
19
|
-
|
|
18
|
+
const tests = timelineStore.value.data ?? [];
|
|
19
|
+
if (!tests.length) {
|
|
20
20
|
return [];
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
if (currentEnvironment.value) {
|
|
24
|
-
const testsToEnv =
|
|
24
|
+
const testsToEnv = tests.filter((test) => test.environment === currentEnvironment.value);
|
|
25
25
|
const hostsByEnv = getHosts(testsToEnv);
|
|
26
26
|
|
|
27
27
|
return hostsByEnv.map((host) => ({
|
|
@@ -30,16 +30,14 @@ const currentTimelineData = computed(() => {
|
|
|
30
30
|
}));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
const hosts = getHosts(
|
|
33
|
+
const hosts = getHosts(tests);
|
|
34
34
|
|
|
35
35
|
return hosts.map((host) => ({
|
|
36
|
-
data: filterTestsByHost(
|
|
36
|
+
data: filterTestsByHost(tests, host),
|
|
37
37
|
host,
|
|
38
38
|
}));
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
// Detects if the user prefers reduced motion to disable animations for accessibility
|
|
42
|
-
const prefersLessMovement = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
43
41
|
export const Timeline = () => {
|
|
44
42
|
const { t } = useI18n("timeline");
|
|
45
43
|
|
|
@@ -87,13 +85,7 @@ export const Timeline = () => {
|
|
|
87
85
|
<GridItem key={host} className={styles["overview-grid-item"]}>
|
|
88
86
|
<Widget title={t("host", { host })}>
|
|
89
87
|
{data.length > 0 && (
|
|
90
|
-
<AllureTimeline
|
|
91
|
-
data={data}
|
|
92
|
-
dataId={host}
|
|
93
|
-
width={100}
|
|
94
|
-
enableAnimations={!prefersLessMovement}
|
|
95
|
-
translations={translations}
|
|
96
|
-
/>
|
|
88
|
+
<AllureTimeline data={data} dataId={host} width={100} translations={translations} />
|
|
97
89
|
)}
|
|
98
90
|
{data.length === 0 && <div className={styles.empty}>{t("empty_host", { host })}</div>}
|
|
99
91
|
</Widget>
|
package/src/stores/timeline.ts
CHANGED
|
@@ -3,7 +3,12 @@ import { fetchReportJsonData } from "@allurereport/web-commons";
|
|
|
3
3
|
import { signal } from "@preact/signals";
|
|
4
4
|
import type { StoreSignalState } from "@/stores/types";
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
export type TimlineTr = Pick<
|
|
7
|
+
TestResult,
|
|
8
|
+
"id" | "name" | "status" | "flaky" | "hidden" | "labels" | "environment" | "start" | "stop" | "duration"
|
|
9
|
+
>;
|
|
10
|
+
|
|
11
|
+
export const timelineStore = signal<StoreSignalState<TimlineTr[]>>({
|
|
7
12
|
loading: true,
|
|
8
13
|
error: undefined,
|
|
9
14
|
data: undefined,
|
|
@@ -17,7 +22,7 @@ export const fetchTimelineData = async () => {
|
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
try {
|
|
20
|
-
const res = await fetchReportJsonData<
|
|
25
|
+
const res = await fetchReportJsonData<TimlineTr[]>("widgets/timeline.json", { bustCache: true });
|
|
21
26
|
|
|
22
27
|
timelineStore.value = {
|
|
23
28
|
data: res,
|
package/webpack.config.js
CHANGED
|
@@ -14,6 +14,9 @@ const baseDir = dirname(fileURLToPath(import.meta.url));
|
|
|
14
14
|
|
|
15
15
|
export default (env, argv) => {
|
|
16
16
|
const devMode = argv?.mode === "development";
|
|
17
|
+
/**
|
|
18
|
+
* @type {import("webpack").Configuration}
|
|
19
|
+
*/
|
|
17
20
|
const config = {
|
|
18
21
|
entry: "./src/index.tsx",
|
|
19
22
|
output: {
|
|
@@ -21,7 +24,7 @@ export default (env, argv) => {
|
|
|
21
24
|
filename: devMode ? "app.js" : "app-[fullhash].js",
|
|
22
25
|
assetModuleFilename: "[name][ext]",
|
|
23
26
|
},
|
|
24
|
-
devtool: devMode ? "
|
|
27
|
+
devtool: devMode ? "eval-source-map" : false,
|
|
25
28
|
optimization: {
|
|
26
29
|
minimize: !devMode,
|
|
27
30
|
minimizer: [
|
|
@@ -111,6 +114,14 @@ export default (env, argv) => {
|
|
|
111
114
|
},
|
|
112
115
|
};
|
|
113
116
|
|
|
117
|
+
if (devMode) {
|
|
118
|
+
// Get and use source maps from dependencies
|
|
119
|
+
config.module.rules.push({
|
|
120
|
+
test: /\.js$/i,
|
|
121
|
+
extractSourceMap: true,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
114
125
|
if (SINGLE_FILE_MODE) {
|
|
115
126
|
config.plugins.push(
|
|
116
127
|
new webpack.optimize.LimitChunkCountPlugin({
|