@allurereport/web-awesome 3.0.0-beta.13 → 3.0.0-beta.15
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/{173.app-01ff983b.js → 173.app-35b67161.js} +1 -1
- package/dist/multi/{174.app-01ff983b.js → 174.app-35b67161.js} +1 -1
- package/dist/multi/{252.app-01ff983b.js → 252.app-35b67161.js} +1 -1
- package/dist/multi/{282.app-01ff983b.js → 282.app-35b67161.js} +1 -1
- package/dist/multi/{29.app-01ff983b.js → 29.app-35b67161.js} +1 -1
- package/dist/multi/{416.app-01ff983b.js → 416.app-35b67161.js} +1 -1
- package/dist/multi/{527.app-01ff983b.js → 527.app-35b67161.js} +1 -1
- package/dist/multi/{600.app-01ff983b.js → 600.app-35b67161.js} +1 -1
- package/dist/multi/{605.app-01ff983b.js → 605.app-35b67161.js} +1 -1
- package/dist/multi/{638.app-01ff983b.js → 638.app-35b67161.js} +1 -1
- package/dist/multi/{672.app-01ff983b.js → 672.app-35b67161.js} +1 -1
- package/dist/multi/{686.app-01ff983b.js → 686.app-35b67161.js} +1 -1
- package/dist/multi/{725.app-01ff983b.js → 725.app-35b67161.js} +1 -1
- package/dist/multi/{741.app-01ff983b.js → 741.app-35b67161.js} +1 -1
- package/dist/multi/{755.app-01ff983b.js → 755.app-35b67161.js} +1 -1
- package/dist/multi/{894.app-01ff983b.js → 894.app-35b67161.js} +1 -1
- package/dist/multi/{943.app-01ff983b.js → 943.app-35b67161.js} +1 -1
- package/dist/multi/{980.app-01ff983b.js → 980.app-35b67161.js} +1 -1
- package/dist/multi/app-35b67161.js +2 -0
- package/dist/multi/manifest.json +20 -20
- package/dist/multi/{styles-01ff983b.css → styles-35b67161.css} +12 -10
- package/dist/single/app-f5ecfcd9.js +2 -0
- package/dist/single/manifest.json +1 -1
- package/package.json +5 -4
- package/src/components/BaseLayout/index.tsx +1 -4
- package/src/components/BaseLayout/styles.scss +5 -3
- package/src/components/Charts/index.tsx +89 -0
- package/src/components/Charts/styles.scss +29 -0
- package/src/components/Footer/index.tsx +6 -2
- package/src/components/Header/index.tsx +5 -2
- package/src/components/Header/styles.scss +1 -0
- package/src/components/MainReport/index.tsx +0 -2
- package/src/components/MetadataButton/index.tsx +2 -2
- package/src/components/Report/index.tsx +7 -0
- package/src/components/ReportBody/index.tsx +24 -13
- package/src/components/ReportBody/styles.scss +1 -0
- package/src/components/ReportHeader/index.tsx +3 -0
- package/src/components/SectionPicker/index.tsx +54 -0
- package/src/components/SectionPicker/styles.scss +5 -0
- package/src/components/SectionSwitcher/index.tsx +14 -0
- package/src/components/SectionSwitcher/styles.scss +4 -0
- package/src/components/SectionTabs/index.tsx +0 -0
- package/src/components/SideBySide/styles.scss +1 -1
- package/src/components/SplitLayout/index.tsx +1 -3
- package/src/components/SplitLayout/styles.scss +1 -3
- package/src/components/TestResult/TrDropdown/index.tsx +1 -2
- package/src/components/TestResult/TrEnvironmentItem/index.tsx +1 -2
- package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +1 -2
- package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +0 -1
- package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +5 -4
- package/src/components/TestResult/TrSteps/TrAttachment.tsx +31 -5
- package/src/components/TestResult/TrSteps/TrStep.tsx +1 -2
- package/src/components/TestResult/TrSteps/styles.scss +4 -2
- package/src/components/TestResult/TrTabs/index.tsx +8 -4
- package/src/components/TestResult/index.tsx +0 -1
- package/src/components/Tree/index.tsx +6 -6
- package/src/components/Tree/styles.scss +0 -4
- package/src/index.tsx +25 -12
- package/src/locales/az.json +16 -0
- package/src/locales/de.json +16 -0
- package/src/locales/en.json +16 -0
- package/src/locales/es.json +16 -0
- package/src/locales/fr.json +16 -0
- package/src/locales/he.json +16 -0
- package/src/locales/hy.json +16 -0
- package/src/locales/it.json +16 -0
- package/src/locales/ja.json +16 -0
- package/src/locales/ka.json +16 -0
- package/src/locales/kr.json +16 -0
- package/src/locales/nl.json +16 -0
- package/src/locales/pl.json +16 -0
- package/src/locales/pt.json +16 -0
- package/src/locales/ru.json +16 -0
- package/src/locales/sv.json +16 -0
- package/src/locales/tr.json +16 -0
- package/src/locales/zh.json +16 -0
- package/src/stores/chart.ts +35 -1
- package/src/stores/env.ts +1 -1
- package/src/stores/envInfo.ts +2 -2
- package/src/stores/locale.ts +2 -0
- package/src/stores/router.ts +76 -16
- package/src/stores/sections.ts +63 -0
- package/src/stores/stats.ts +2 -2
- package/src/stores/testResults.ts +6 -2
- package/src/stores/tree.ts +10 -7
- package/src/stores/variables.ts +3 -1
- package/src/styles.scss +21 -0
- package/src/utils/charts.ts +169 -0
- package/types.d.ts +4 -1
- package/webpack.config.js +14 -0
- package/dist/multi/app-01ff983b.js +0 -2
- package/dist/single/app-607f21f7.js +0 -2
- package/src/components/ArrowButton/index.tsx +0 -36
- package/src/components/ArrowButton/styles.scss +0 -35
- /package/dist/multi/{app-01ff983b.js.LICENSE.txt → app-35b67161.js.LICENSE.txt} +0 -0
- /package/dist/single/{app-607f21f7.js.LICENSE.txt → app-f5ecfcd9.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.15",
|
|
4
4
|
"description": "The static files for Allure Awesome 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.15",
|
|
35
|
+
"@allurereport/web-commons": "3.0.0-beta.15",
|
|
36
|
+
"@allurereport/web-components": "3.0.0-beta.15",
|
|
37
37
|
"@preact/signals": "^1.3.0",
|
|
38
38
|
"clsx": "^2.1.1",
|
|
39
39
|
"d3-shape": "^3.2.0",
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"split.js": "^1.6.5",
|
|
97
97
|
"style-loader": "^4.0.0",
|
|
98
98
|
"svg-sprite-loader": "^6.0.11",
|
|
99
|
+
"terser-webpack-plugin": "^5.3.14",
|
|
99
100
|
"typescript": "^5.6.3",
|
|
100
101
|
"typescript-eslint": "^8.6.0",
|
|
101
102
|
"vitest": "^2.1.8",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Loadable, PageLoader } from "@allurereport/web-components";
|
|
2
|
-
import { Footer } from "@/components/Footer";
|
|
3
2
|
import MainReport from "@/components/MainReport";
|
|
4
3
|
import TestResult from "@/components/TestResult";
|
|
5
4
|
import { route } from "@/stores/router";
|
|
@@ -12,7 +11,7 @@ export type BaseLayoutProps = {
|
|
|
12
11
|
};
|
|
13
12
|
|
|
14
13
|
export const BaseLayout = () => {
|
|
15
|
-
const
|
|
14
|
+
const testResultId = route.value.params?.testResultId ?? null;
|
|
16
15
|
|
|
17
16
|
const content = testResultId ? (
|
|
18
17
|
<Loadable
|
|
@@ -23,7 +22,6 @@ export const BaseLayout = () => {
|
|
|
23
22
|
<>
|
|
24
23
|
<div className={styles.wrapper} key={testResult?.id}>
|
|
25
24
|
<TestResult testResult={testResult} />
|
|
26
|
-
<Footer />
|
|
27
25
|
</div>
|
|
28
26
|
</>
|
|
29
27
|
)}
|
|
@@ -31,7 +29,6 @@ export const BaseLayout = () => {
|
|
|
31
29
|
) : (
|
|
32
30
|
<div className={styles.wrapper}>
|
|
33
31
|
<Loadable source={treeStore} renderLoader={() => <PageLoader />} renderData={() => <MainReport />} />
|
|
34
|
-
<Footer />
|
|
35
32
|
</div>
|
|
36
33
|
);
|
|
37
34
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
.layout {
|
|
2
2
|
margin: auto;
|
|
3
|
-
padding:
|
|
3
|
+
padding: 0 32px;
|
|
4
4
|
background: var(--bg-base-secondary);
|
|
5
5
|
color: var(--on-text-primary);
|
|
6
6
|
font-size: 14px;
|
|
7
|
-
|
|
7
|
+
height: 100%;
|
|
8
|
+
overflow: auto;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.wrapper {
|
|
@@ -51,7 +52,8 @@
|
|
|
51
52
|
display: flex;
|
|
52
53
|
justify-content: space-between;
|
|
53
54
|
align-items: center;
|
|
54
|
-
padding: 8px;
|
|
55
|
+
padding: 8px 24px;
|
|
56
|
+
width: 100%;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
.test-result-errors {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
|
2
|
+
import { capitalize } from "@allurereport/web-commons";
|
|
3
|
+
import {
|
|
4
|
+
Grid,
|
|
5
|
+
GridItem,
|
|
6
|
+
Loadable,
|
|
7
|
+
PageLoader,
|
|
8
|
+
SuccessRatePieChart,
|
|
9
|
+
TrendChartWidget,
|
|
10
|
+
Widget,
|
|
11
|
+
} from "@allurereport/web-components";
|
|
12
|
+
import { useEffect } from "preact/hooks";
|
|
13
|
+
import { chartsStore, fetchChartsData } from "@/stores/chart";
|
|
14
|
+
import { useI18n } from "@/stores/locale";
|
|
15
|
+
import type { ChartData } from "@/utils/charts";
|
|
16
|
+
import { ChartType } from "@/utils/charts";
|
|
17
|
+
import * as styles from "./styles.scss";
|
|
18
|
+
|
|
19
|
+
const getChartWidgetByType = (
|
|
20
|
+
chartData: ChartData,
|
|
21
|
+
{ t, empty }: Record<string, (key: string, options?: any) => string>,
|
|
22
|
+
) => {
|
|
23
|
+
switch (chartData.type) {
|
|
24
|
+
case ChartType.Trend: {
|
|
25
|
+
const type = t(`trend.type.${chartData.dataType}`);
|
|
26
|
+
const title = chartData.title ?? t("trend.title", { type: capitalize(type) });
|
|
27
|
+
const translations = empty("no-results");
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<TrendChartWidget
|
|
31
|
+
title={title}
|
|
32
|
+
items={chartData.items}
|
|
33
|
+
slices={chartData.slices}
|
|
34
|
+
min={chartData.min}
|
|
35
|
+
max={chartData.max}
|
|
36
|
+
translations={{ "no-results": translations }}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
case ChartType.Pie: {
|
|
41
|
+
const title = chartData.title ?? t("pie.title");
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Widget title={title}>
|
|
45
|
+
<div className={styles["overview-grid-item-pie-chart-wrapper"]}>
|
|
46
|
+
<div className={styles["overview-grid-item-pie-chart-wrapper-squeezer"]}>
|
|
47
|
+
<SuccessRatePieChart slices={chartData.slices} percentage={chartData.percentage} />
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</Widget>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const Charts = () => {
|
|
57
|
+
const { t } = useI18n("charts");
|
|
58
|
+
const { t: empty } = useI18n("empty");
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
fetchChartsData();
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Loadable
|
|
66
|
+
source={chartsStore}
|
|
67
|
+
renderLoader={() => <PageLoader />}
|
|
68
|
+
renderData={(data) => {
|
|
69
|
+
const charts = Object.entries(data).map(([chartId, value]) => {
|
|
70
|
+
const chartWidget = getChartWidgetByType(value, { t, empty });
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<GridItem key={chartId} className={styles["overview-grid-item"]}>
|
|
74
|
+
{chartWidget}
|
|
75
|
+
</GridItem>
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<div className={styles.overview}>
|
|
81
|
+
<Grid kind="swap" className={styles["overview-grid"]}>
|
|
82
|
+
{charts}
|
|
83
|
+
</Grid>
|
|
84
|
+
</div>
|
|
85
|
+
);
|
|
86
|
+
}}
|
|
87
|
+
/>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.overview {
|
|
2
|
+
padding: 0 24px;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.overview-grid {
|
|
9
|
+
display: grid;
|
|
10
|
+
gap: 24px;
|
|
11
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(50% - 12px)), 1fr));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.overview-grid-item {
|
|
15
|
+
padding: 12px;
|
|
16
|
+
width: 100%;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.overview-grid-item-pie-chart-wrapper {
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
align-items: center;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.overview-grid-item-pie-chart-wrapper-squeezer {
|
|
28
|
+
width: 50%;
|
|
29
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import type { ClassValue } from "clsx";
|
|
1
2
|
import { clsx } from "clsx";
|
|
2
3
|
import * as styles from "@/components/BaseLayout/styles.scss";
|
|
3
4
|
import { FooterLogo } from "@/components/Footer/FooterLogo";
|
|
4
5
|
import { FooterVersion } from "@/components/Footer/FooterVersion";
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
interface FooterProps {
|
|
8
|
+
className?: ClassValue;
|
|
9
|
+
}
|
|
10
|
+
export const Footer = ({ className }: FooterProps) => {
|
|
7
11
|
return (
|
|
8
|
-
<div className={clsx(styles.below)}>
|
|
12
|
+
<div className={clsx(styles.below, className)}>
|
|
9
13
|
<FooterLogo />
|
|
10
14
|
<FooterVersion />
|
|
11
15
|
</div>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ClassValue } from "clsx";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import { HeaderControls } from "@/components/HeaderControls";
|
|
4
|
+
import { SectionPicker } from "@/components/SectionPicker";
|
|
4
5
|
import { TrBreadcrumbs } from "@/components/TestResult/TrHeader/TrBreadcrumbs";
|
|
5
6
|
import { route } from "@/stores/router";
|
|
7
|
+
import { availableSections } from "@/stores/sections";
|
|
6
8
|
import { testResultStore } from "@/stores/testResults";
|
|
7
9
|
import * as styles from "./styles.scss";
|
|
8
10
|
|
|
@@ -11,11 +13,12 @@ interface HeaderProps {
|
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const Header = ({ className }: HeaderProps) => {
|
|
14
|
-
const
|
|
16
|
+
const testResultId = route.value.params?.testResultId ?? null;
|
|
15
17
|
|
|
16
18
|
return (
|
|
17
19
|
<div className={clsx(styles.above, className)}>
|
|
18
|
-
{
|
|
20
|
+
{Boolean(availableSections.value?.length) && <SectionPicker />}
|
|
21
|
+
{testResultId && <TrBreadcrumbs testResult={testResultStore.value?.data?.[testResultId]} />}
|
|
19
22
|
<HeaderControls className={styles.right} />
|
|
20
23
|
</div>
|
|
21
24
|
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import clsx from "clsx";
|
|
2
|
-
import { Header } from "@/components/Header";
|
|
3
2
|
import { ReportBody } from "@/components/ReportBody";
|
|
4
3
|
import { ReportHeader } from "@/components/ReportHeader";
|
|
5
4
|
import { ReportMetadata } from "@/components/ReportMetadata";
|
|
@@ -9,7 +8,6 @@ import * as styles from "./styles.scss";
|
|
|
9
8
|
const MainReport = () => {
|
|
10
9
|
return (
|
|
11
10
|
<>
|
|
12
|
-
{!isSplitMode.value && <Header />}
|
|
13
11
|
<div className={clsx(styles.content, isSplitMode.value ? styles["scroll-inside"] : "")}>
|
|
14
12
|
<ReportHeader />
|
|
15
13
|
<ReportMetadata />
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Counter, Text } from "@allurereport/web-components";
|
|
1
|
+
import { ArrowButton, Counter, Text } from "@allurereport/web-components";
|
|
2
2
|
import clsx from "clsx";
|
|
3
3
|
import type { FunctionalComponent } from "preact";
|
|
4
|
-
import { ArrowButton } from "@/components/ArrowButton";
|
|
5
4
|
import * as styles from "./styles.scss";
|
|
6
5
|
|
|
7
6
|
interface MetadataButtonProps {
|
|
@@ -34,6 +33,7 @@ export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({
|
|
|
34
33
|
iconSize={"s"}
|
|
35
34
|
buttonSize={"s"}
|
|
36
35
|
className={styles["report-metadata-header-arrow"]}
|
|
36
|
+
tag={"div"}
|
|
37
37
|
/>
|
|
38
38
|
</button>
|
|
39
39
|
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { statusesList } from "@allurereport/core-api";
|
|
2
2
|
import { Counter, Loadable } from "@allurereport/web-components";
|
|
3
|
-
import { reportStatsStore } from "@/stores";
|
|
3
|
+
import { reportStatsStore, statsByEnvStore } from "@/stores";
|
|
4
|
+
import { currentEnvironment } from "@/stores/env";
|
|
4
5
|
import { useI18n } from "@/stores/locale";
|
|
5
|
-
import { treeFiltersStore } from "@/stores/tree";
|
|
6
|
+
import { setTreeStatus, treeFiltersStore } from "@/stores/tree";
|
|
6
7
|
import { capitalize } from "@/utils/capitalize";
|
|
7
|
-
import { Tab, Tabs, TabsList } from "../Tabs";
|
|
8
|
+
import { Tab, Tabs, TabsList, useTabsContext } from "../Tabs";
|
|
8
9
|
import { TreeList } from "../Tree";
|
|
9
10
|
import { HeaderActions } from "./HeaderActions";
|
|
10
11
|
import { SortBy } from "./SortBy";
|
|
@@ -15,6 +16,7 @@ const ALL_TAB = "total";
|
|
|
15
16
|
|
|
16
17
|
const Header = () => {
|
|
17
18
|
const { t } = useI18n("statuses");
|
|
19
|
+
const { currentTab, setCurrentTab } = useTabsContext();
|
|
18
20
|
|
|
19
21
|
return (
|
|
20
22
|
<header className={styles.header}>
|
|
@@ -22,21 +24,30 @@ const Header = () => {
|
|
|
22
24
|
<div className={styles.headerRow}>
|
|
23
25
|
<TabsList>
|
|
24
26
|
<Loadable
|
|
25
|
-
source={
|
|
27
|
+
source={statsByEnvStore}
|
|
26
28
|
renderData={(stats) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const currentEnv = stats[currentEnvironment.value] || reportStatsStore.value.data;
|
|
30
|
+
const statList = statusesList
|
|
31
|
+
.map((status) => {
|
|
32
|
+
return { status, value: currentEnv[status] };
|
|
33
|
+
})
|
|
34
|
+
.filter(({ value }) => value);
|
|
35
|
+
const isStatListHaveCurrentTab = statList.filter(({ status }) => status === currentTab);
|
|
36
|
+
if (!isStatListHaveCurrentTab.length && currentTab !== "total") {
|
|
37
|
+
setCurrentTab("total");
|
|
38
|
+
setTreeStatus("total");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const allStatuses = statList.map(({ status, value }) => (
|
|
42
|
+
<Tab data-testid={`tab-${status}`} key={status} id={status}>
|
|
43
|
+
{capitalize(t(status) ?? status)} <Counter count={value} size="s" status={status} />
|
|
44
|
+
</Tab>
|
|
45
|
+
));
|
|
35
46
|
|
|
36
47
|
return (
|
|
37
48
|
<>
|
|
38
49
|
<Tab data-testid="tab-all" id={ALL_TAB}>
|
|
39
|
-
{capitalize(t("total"))} <Counter count={
|
|
50
|
+
{capitalize(t("total"))} <Counter count={currentEnv?.total ?? 0} size="s" />
|
|
40
51
|
</Tab>
|
|
41
52
|
{allStatuses}
|
|
42
53
|
</>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { DropdownButton, Menu, SvgIcon, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import { useI18n } from "@/stores";
|
|
3
|
+
import { availableSections, currentSection, setSection } from "@/stores/sections";
|
|
4
|
+
import * as styles from "./styles.scss";
|
|
5
|
+
|
|
6
|
+
export type SectionItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
logo: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const defaultSection: SectionItem = { name: "report", logo: allureIcons.reportLogo };
|
|
12
|
+
|
|
13
|
+
const sectionMap: Record<string, SectionItem> = {
|
|
14
|
+
default: defaultSection,
|
|
15
|
+
charts: { name: "charts", logo: allureIcons.lineChartsBarChartSquare },
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const SectionPicker = () => {
|
|
19
|
+
const selectedSection = sectionMap[currentSection.value] || defaultSection;
|
|
20
|
+
const { t } = useI18n("sections");
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Menu
|
|
24
|
+
size="m"
|
|
25
|
+
placement={"bottom-start"}
|
|
26
|
+
menuTrigger={({ isOpened, onClick }) => (
|
|
27
|
+
<DropdownButton
|
|
28
|
+
style="ghost"
|
|
29
|
+
size="m"
|
|
30
|
+
text={t(selectedSection.name)}
|
|
31
|
+
icon={selectedSection.logo}
|
|
32
|
+
isExpanded={isOpened}
|
|
33
|
+
onClick={onClick}
|
|
34
|
+
iconSize={"xs"}
|
|
35
|
+
/>
|
|
36
|
+
)}
|
|
37
|
+
>
|
|
38
|
+
<Menu.Section>
|
|
39
|
+
{["default", ...availableSections.value].map((value) => (
|
|
40
|
+
<Menu.ItemWithCheckmark
|
|
41
|
+
onClick={() => setSection(value)}
|
|
42
|
+
key={value}
|
|
43
|
+
isChecked={currentSection.value === value}
|
|
44
|
+
>
|
|
45
|
+
<div className={styles["menu-item"]}>
|
|
46
|
+
<SvgIcon id={sectionMap[value]?.logo} size={"s"} />
|
|
47
|
+
{t(sectionMap[value]?.name) || value}
|
|
48
|
+
</div>
|
|
49
|
+
</Menu.ItemWithCheckmark>
|
|
50
|
+
))}
|
|
51
|
+
</Menu.Section>
|
|
52
|
+
</Menu>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { VNode } from "preact";
|
|
2
|
+
import { Charts } from "@/components/Charts";
|
|
3
|
+
import { Report } from "@/components/Report";
|
|
4
|
+
import { currentSection } from "@/stores/sections";
|
|
5
|
+
import * as styles from "./styles.scss";
|
|
6
|
+
|
|
7
|
+
export const SectionSwitcher = () => {
|
|
8
|
+
const sectionMap: Record<string, VNode> = {
|
|
9
|
+
report: <Report />,
|
|
10
|
+
charts: <Charts />,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return <div className={styles.layout}>{sectionMap[currentSection.value] || sectionMap.report}</div>;
|
|
14
|
+
};
|
|
File without changes
|
|
@@ -31,7 +31,7 @@ const Loader = () => {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const SplitLayout = () => {
|
|
34
|
-
const
|
|
34
|
+
const testResultId = route.value.params?.testResultId ?? null;
|
|
35
35
|
const [cachedMain, setCachedMain] = useState<JSX.Element | null>(null);
|
|
36
36
|
|
|
37
37
|
const { t } = useI18n("controls");
|
|
@@ -69,9 +69,7 @@ export const SplitLayout = () => {
|
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
71
|
<div className={styles["side-by-side"]} data-testId={"split-layout"}>
|
|
72
|
-
<Header className={styles.header} />
|
|
73
72
|
<SideBySide left={cachedMain} right={<TrView />} />
|
|
74
|
-
<Footer />
|
|
75
73
|
</div>
|
|
76
74
|
);
|
|
77
75
|
};
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
background: var(--bg-base-secondary);
|
|
5
5
|
color: var(--on-text-primary);
|
|
6
6
|
font-size: 14px;
|
|
7
|
-
min-height: 100vh;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
.wrapper {
|
|
@@ -22,7 +21,6 @@
|
|
|
22
21
|
width: 100%;
|
|
23
22
|
overflow: hidden;
|
|
24
23
|
overflow-y: scroll;
|
|
25
|
-
height: calc(100vh - var(--footer-header-sizes));
|
|
26
24
|
position: relative;
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -69,8 +67,8 @@
|
|
|
69
67
|
.side-by-side {
|
|
70
68
|
display: flex;
|
|
71
69
|
flex-direction: column;
|
|
72
|
-
height: 100vh;
|
|
73
70
|
justify-content: space-between;
|
|
71
|
+
height: 100%;
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
.empty {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Counter, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
1
|
+
import { ArrowButton, Counter, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
2
|
import type { ClassValue } from "clsx";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { type FunctionalComponent } from "preact";
|
|
5
|
-
import { ArrowButton } from "@/components/ArrowButton";
|
|
6
5
|
import * as styles from "./styles.scss";
|
|
7
6
|
|
|
8
7
|
export const TrDropdown: FunctionalComponent<{
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { formatDuration } from "@allurereport/core-api";
|
|
2
|
-
import { IconButton, Text, TooltipWrapper, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import { ArrowButton, IconButton, Text, TooltipWrapper, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
3
3
|
import cx from "clsx";
|
|
4
4
|
import { type FunctionalComponent } from "preact";
|
|
5
5
|
import { useState } from "preact/hooks";
|
|
6
|
-
import { ArrowButton } from "@/components/ArrowButton";
|
|
7
6
|
import { TrError } from "@/components/TestResult/TrError";
|
|
8
7
|
import { useI18n } from "@/stores";
|
|
9
8
|
import { navigateTo, openInNewTab } from "@/stores/router";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type HistoryTestResult, formatDuration } from "@allurereport/core-api";
|
|
2
|
-
import { IconButton, Text, TooltipWrapper, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import { ArrowButton, IconButton, Text, TooltipWrapper, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
3
3
|
import { type FunctionalComponent } from "preact";
|
|
4
4
|
import { useState } from "preact/hooks";
|
|
5
|
-
import { ArrowButton } from "@/components/ArrowButton";
|
|
6
5
|
import { TrError } from "@/components/TestResult/TrError";
|
|
7
6
|
import * as styles from "@/components/TestResult/TrHistory/styles.scss";
|
|
8
7
|
import { useI18n } from "@/stores";
|
|
@@ -5,7 +5,6 @@ import { IconButton, TooltipWrapper, allureIcons } from "@allurereport/web-compo
|
|
|
5
5
|
import { PwTrace } from "@/components/TestResult/TrPwTraces/PwTrace";
|
|
6
6
|
import { useI18n } from "@/stores";
|
|
7
7
|
import { openModal } from "@/stores/modal";
|
|
8
|
-
import * as styles from "./styles.scss";
|
|
9
8
|
|
|
10
9
|
export const fetchFromUrl = async ({ id, ext, contentType }: Attachments) => {
|
|
11
10
|
const fileName = `${id || "-"}${ext || ""}`;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { formatDuration } from "@allurereport/core-api";
|
|
2
|
-
import { IconButton, Text, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import { ArrowButton, IconButton, Text, TreeItemIcon, allureIcons } from "@allurereport/web-components";
|
|
3
3
|
import type { FunctionalComponent } from "preact";
|
|
4
4
|
import { useState } from "preact/hooks";
|
|
5
5
|
import type { AwesomeTestResult } from "types";
|
|
6
|
-
import { ArrowButton } from "@/components/ArrowButton";
|
|
7
6
|
import { TrError } from "@/components/TestResult/TrError";
|
|
8
7
|
import * as styles from "@/components/TestResult/TrRetriesView/styles.scss";
|
|
9
8
|
import { navigateTo } from "@/stores/router";
|
|
@@ -21,7 +20,9 @@ export const TrRetriesItem: FunctionalComponent<{
|
|
|
21
20
|
return (
|
|
22
21
|
<div>
|
|
23
22
|
<div className={styles["test-result-retries-item-header"]} onClick={() => setIsOpen(!isOpened)}>
|
|
24
|
-
{Boolean(error) &&
|
|
23
|
+
{Boolean(error.trace || error.message) && (
|
|
24
|
+
<ArrowButton isOpened={isOpened} icon={allureIcons.lineArrowsChevronDown} />
|
|
25
|
+
)}
|
|
25
26
|
<div className={styles["test-result-retries-item-wrap"]}>
|
|
26
27
|
<TreeItemIcon status={status} className={styles["test-result-retries-item-status"]} />
|
|
27
28
|
<Text className={styles["test-result-retries-item-text"]}>{convertedStop}</Text>
|
|
@@ -41,7 +42,7 @@ export const TrRetriesItem: FunctionalComponent<{
|
|
|
41
42
|
</div>
|
|
42
43
|
</div>
|
|
43
44
|
</div>
|
|
44
|
-
{isOpened && error && (
|
|
45
|
+
{isOpened && (error.message || error.trace) && (
|
|
45
46
|
<div className={styles["test-result-retries-item-content"]}>
|
|
46
47
|
<TrError {...error} status={status} />
|
|
47
48
|
</div>
|