@allurereport/web-classic 3.0.0-beta.9 → 3.0.1

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 (143) hide show
  1. package/.eslintrc.cjs +1 -1
  2. package/dist/multi/10.app-81fc0bb26fd1b73b22f9.js +1 -0
  3. package/dist/multi/222.app-81fc0bb26fd1b73b22f9.js +1 -0
  4. package/dist/multi/26.app-81fc0bb26fd1b73b22f9.js +1 -0
  5. package/dist/multi/302.app-81fc0bb26fd1b73b22f9.js +1 -0
  6. package/dist/multi/304.app-81fc0bb26fd1b73b22f9.js +1 -0
  7. package/dist/multi/369.app-81fc0bb26fd1b73b22f9.js +1 -0
  8. package/dist/multi/389.app-81fc0bb26fd1b73b22f9.js +1 -0
  9. package/dist/multi/498.app-81fc0bb26fd1b73b22f9.js +1 -0
  10. package/dist/multi/60.app-81fc0bb26fd1b73b22f9.js +1 -0
  11. package/dist/multi/643.app-81fc0bb26fd1b73b22f9.js +1 -0
  12. package/dist/multi/671.app-81fc0bb26fd1b73b22f9.js +1 -0
  13. package/dist/multi/725.app-81fc0bb26fd1b73b22f9.js +1 -0
  14. package/dist/multi/770.app-81fc0bb26fd1b73b22f9.js +1 -0
  15. package/dist/multi/848.app-81fc0bb26fd1b73b22f9.js +1 -0
  16. package/dist/multi/853.app-81fc0bb26fd1b73b22f9.js +1 -0
  17. package/dist/multi/872.app-81fc0bb26fd1b73b22f9.js +1 -0
  18. package/dist/multi/895.app-81fc0bb26fd1b73b22f9.js +1 -0
  19. package/dist/multi/920.app-81fc0bb26fd1b73b22f9.js +1 -0
  20. package/dist/multi/979.app-81fc0bb26fd1b73b22f9.js +1 -0
  21. package/dist/multi/991.app-81fc0bb26fd1b73b22f9.js +1 -0
  22. package/dist/multi/app-81fc0bb26fd1b73b22f9.js +2 -0
  23. package/dist/multi/{app-e5caa85e.js.LICENSE.txt → app-81fc0bb26fd1b73b22f9.js.LICENSE.txt} +9 -0
  24. package/dist/multi/manifest.json +26 -26
  25. package/dist/multi/styles-02faf4bb6ebabe212265.css +284 -0
  26. package/dist/single/app-997b57d6b8885a4f88c7.js +2 -0
  27. package/dist/single/{app-006b2a35.js.LICENSE.txt → app-997b57d6b8885a4f88c7.js.LICENSE.txt} +9 -0
  28. package/dist/single/manifest.json +1 -1
  29. package/package.json +19 -18
  30. package/src/assets/scss/palette.scss +391 -391
  31. package/src/assets/scss/theme.scss +288 -79
  32. package/src/components/Behaviors/BehaviorsList.tsx +3 -3
  33. package/src/components/Categories/CategoriesList.tsx +3 -3
  34. package/src/components/Footer/FooterLogo.tsx +1 -2
  35. package/src/components/Footer/FooterVersion.tsx +2 -2
  36. package/src/components/HeaderActions/HeaderActions.tsx +1 -2
  37. package/src/components/Modal/index.tsx +2 -2
  38. package/src/components/Overview/Overview.module.scss +29 -0
  39. package/src/components/Overview/index.tsx +101 -5
  40. package/src/components/Packages/PackagesList.tsx +3 -3
  41. package/src/components/ReportBody/index.tsx +2 -4
  42. package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
  43. package/src/components/ReportHeader/index.tsx +2 -2
  44. package/src/components/ReportMetadata/MetadataSummary.tsx +1 -2
  45. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +2 -2
  46. package/src/components/TestResult/TestResultDescription/index.tsx +2 -2
  47. package/src/components/TestResult/TestResultEmpty/index.tsx +2 -9
  48. package/src/components/TestResult/TestResultHeader/index.tsx +3 -5
  49. package/src/components/TestResult/TestResultHistory/index.tsx +2 -2
  50. package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +1 -1
  51. package/src/components/TestResult/TestResultInfo/index.tsx +2 -2
  52. package/src/components/TestResult/TestResultLinks/index.tsx +2 -2
  53. package/src/components/TestResult/TestResultMetadata/index.tsx +2 -2
  54. package/src/components/TestResult/TestResultNavigation/index.tsx +2 -2
  55. package/src/components/TestResult/TestResultOverview.tsx +2 -2
  56. package/src/components/TestResult/TestResultParameters/index.tsx +2 -2
  57. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +7 -7
  58. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +24 -8
  59. package/src/components/TestResult/TestResultRetriesView/index.tsx +10 -3
  60. package/src/components/TestResult/TestResultSetup/index.tsx +2 -2
  61. package/src/components/TestResult/TestResultSeverity/index.tsx +1 -1
  62. package/src/components/TestResult/TestResultStatus/index.tsx +1 -1
  63. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +28 -2
  64. package/src/components/TestResult/TestResultSteps/index.tsx +4 -4
  65. package/src/components/TestResult/TestResultSteps/styles.scss +1 -5
  66. package/src/components/TestResult/TestResultTeardown/index.tsx +2 -2
  67. package/src/components/TestResult/index.tsx +4 -4
  68. package/src/components/Tree/Tree.tsx +3 -3
  69. package/src/components/Tree/TreeHeader.tsx +1 -1
  70. package/src/components/Tree/index.tsx +3 -3
  71. package/src/index.tsx +1 -5
  72. package/src/stores/behaviors.ts +6 -6
  73. package/src/stores/categories.ts +6 -6
  74. package/src/stores/chart.ts +1 -1
  75. package/src/stores/charts.ts +22 -0
  76. package/src/stores/envInfo.ts +1 -1
  77. package/src/stores/locale.ts +3 -2
  78. package/src/stores/packages.ts +6 -6
  79. package/src/stores/router.ts +0 -2
  80. package/src/stores/stats.ts +1 -1
  81. package/src/stores/testResults.ts +4 -4
  82. package/src/stores/theme.ts +15 -18
  83. package/src/stores/tree.ts +6 -6
  84. package/src/stores/trend.ts +36 -0
  85. package/src/translations/am.json +2 -1
  86. package/src/translations/az.json +2 -1
  87. package/src/translations/de.json +2 -2
  88. package/src/translations/en.json +10 -1
  89. package/src/translations/es.json +2 -1
  90. package/src/translations/fr.json +2 -1
  91. package/src/translations/he.json +2 -1
  92. package/src/translations/it.json +2 -1
  93. package/src/translations/ja.json +2 -1
  94. package/src/translations/ka.json +2 -1
  95. package/src/translations/kr.json +2 -1
  96. package/src/translations/nl.json +2 -1
  97. package/src/translations/pl.json +2 -1
  98. package/src/translations/pt.json +2 -1
  99. package/src/translations/ru.json +2 -1
  100. package/src/translations/sv.json +2 -1
  101. package/src/translations/tr.json +2 -1
  102. package/src/translations/zh.json +2 -1
  103. package/src/utils/treeFilters.ts +13 -18
  104. package/test/dummy.test.ts +7 -0
  105. package/test/utils/treeFilters.test.ts +44 -44
  106. package/types.d.ts +22 -20
  107. package/webpack.config.js +8 -3
  108. package/.babelrc--old.cjs +0 -18
  109. package/.eslintrc--old.cjs +0 -125
  110. package/dist/multi/10.app-e5caa85e.js +0 -1
  111. package/dist/multi/222.app-e5caa85e.js +0 -1
  112. package/dist/multi/26.app-e5caa85e.js +0 -1
  113. package/dist/multi/302.app-e5caa85e.js +0 -1
  114. package/dist/multi/304.app-e5caa85e.js +0 -1
  115. package/dist/multi/369.app-e5caa85e.js +0 -1
  116. package/dist/multi/389.app-e5caa85e.js +0 -1
  117. package/dist/multi/498.app-e5caa85e.js +0 -1
  118. package/dist/multi/60.app-e5caa85e.js +0 -1
  119. package/dist/multi/643.app-e5caa85e.js +0 -1
  120. package/dist/multi/671.app-e5caa85e.js +0 -1
  121. package/dist/multi/725.app-e5caa85e.js +0 -1
  122. package/dist/multi/770.app-e5caa85e.js +0 -1
  123. package/dist/multi/848.app-e5caa85e.js +0 -1
  124. package/dist/multi/853.app-e5caa85e.js +0 -1
  125. package/dist/multi/872.app-e5caa85e.js +0 -1
  126. package/dist/multi/895.app-e5caa85e.js +0 -1
  127. package/dist/multi/920.app-e5caa85e.js +0 -1
  128. package/dist/multi/979.app-e5caa85e.js +0 -1
  129. package/dist/multi/991.app-e5caa85e.js +0 -1
  130. package/dist/multi/app-e5caa85e.js +0 -2
  131. package/dist/multi/styles-e5caa85e.css +0 -283
  132. package/dist/single/app-006b2a35.js +0 -2
  133. package/package--old.json +0 -106
  134. package/src/components/ReportLogo/index.tsx +0 -16
  135. package/src/components/ReportLogo/styles.scss +0 -20
  136. package/src/components/ReportLogoFull/index.tsx +0 -20
  137. package/src/components/ReportLogoFull/styles.scss +0 -7
  138. package/src/utils/capitalize.ts +0 -6
  139. package/webpack.config--old.js +0 -127
  140. /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
  141. /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
  142. /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
  143. /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
@@ -1,9 +1,105 @@
1
- import { Loadable, PageLoader } from "@allurereport/web-components";
2
- import * as styles from "@/components/BaseLayout/styles.scss";
3
- import { testResultStore } from "@/stores/testResults";
4
- import { treeStore } from "@/stores/tree";
1
+ /* eslint-disable @stylistic/quotes */
2
+
3
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
4
+ import { ChartType } from "@allurereport/charts-api";
5
+ import type { UIChartData } from "@allurereport/web-commons";
6
+ import {
7
+ Grid,
8
+ GridItem,
9
+ HeatMapWidget,
10
+ Loadable,
11
+ PageLoader,
12
+ ThemeProvider,
13
+ TreeMapChartWidget,
14
+ } from "@allurereport/web-components";
15
+ import { useEffect } from "preact/hooks";
16
+ import { themeStore, useI18n } from "@/stores";
17
+ import { chartsStore, fetchChartsData } from "@/stores/charts";
18
+ import * as styles from "./Overview.module.scss";
19
+
20
+ const getChartWidgetByType = (
21
+ chartData: UIChartData,
22
+ { t, empty }: Record<string, (key: string, options?: any) => string>,
23
+ ) => {
24
+ switch (chartData.type) {
25
+ case ChartType.CoverageDiff: {
26
+ return (
27
+ <TreeMapChartWidget
28
+ chartType={ChartType.CoverageDiff}
29
+ data={chartData.treeMap}
30
+ title={chartData.title}
31
+ formatLegend={chartData.formatLegend}
32
+ colors={chartData.colors}
33
+ legendDomain={chartData.legendDomain}
34
+ tooltipRows={chartData.tooltipRows}
35
+ translations={{ "no-results": empty("no-results") }}
36
+ />
37
+ );
38
+ }
39
+ case ChartType.SuccessRateDistribution: {
40
+ return (
41
+ <TreeMapChartWidget
42
+ chartType={ChartType.SuccessRateDistribution}
43
+ data={chartData.treeMap}
44
+ title={chartData.title}
45
+ formatLegend={chartData.formatLegend}
46
+ colors={chartData.colors}
47
+ legendDomain={chartData.legendDomain}
48
+ tooltipRows={chartData.tooltipRows}
49
+ translations={{ "no-results": empty("no-results") }}
50
+ />
51
+ );
52
+ }
53
+ case ChartType.ProblemsDistribution: {
54
+ return (
55
+ <HeatMapWidget
56
+ title={chartData.title}
57
+ data={chartData.data}
58
+ translations={{ "no-results": empty("no-results") }}
59
+ />
60
+ );
61
+ }
62
+ default: {
63
+ return null;
64
+ }
65
+ }
66
+ };
5
67
 
6
68
  const Overview = () => {
7
- const testResultId = "";
69
+ const { t } = useI18n("charts");
70
+ const { t: empty } = useI18n("empty");
71
+
72
+ useEffect(() => {
73
+ fetchChartsData();
74
+ }, []);
75
+
76
+ return (
77
+ <ThemeProvider theme={themeStore.value}>
78
+ <Loadable
79
+ source={chartsStore}
80
+ renderLoader={() => <PageLoader />}
81
+ renderData={(data) => {
82
+ const charts = Object.entries(data).map(([chartId, value]) => {
83
+ const chartWidget = getChartWidgetByType(value, { t, empty });
84
+
85
+ return (
86
+ <GridItem key={chartId} className={styles["overview-grid-item"]}>
87
+ {chartWidget}
88
+ </GridItem>
89
+ );
90
+ });
91
+
92
+ return (
93
+ <div className={styles.overview}>
94
+ <Grid kind="swap" className={styles["overview-grid"]}>
95
+ {charts}
96
+ </Grid>
97
+ </div>
98
+ );
99
+ }}
100
+ />
101
+ </ThemeProvider>
102
+ );
8
103
  };
104
+
9
105
  export default Overview;
@@ -1,6 +1,6 @@
1
1
  import { Button, Loadable, PageLoader, Text } from "@allurereport/web-components";
2
2
  import { useEffect } from "preact/hooks";
3
- import type { AllureAwesomeStatus } from "types";
3
+ import type { ClassicStatus } from "types";
4
4
  import Tree from "@/components/Tree/Tree";
5
5
  import { useI18n } from "@/stores/locale";
6
6
  import {
@@ -18,7 +18,7 @@ export const PackagesList = () => {
18
18
  const { t } = useI18n("empty");
19
19
 
20
20
  useEffect(() => {
21
- setPackagesStatus(currentTab.value as AllureAwesomeStatus);
21
+ setPackagesStatus(currentTab.value as ClassicStatus);
22
22
  }, [currentTab.value]);
23
23
 
24
24
  return (
@@ -58,7 +58,7 @@ export const PackagesList = () => {
58
58
 
59
59
  return (
60
60
  <div className={styles["tree-list"]}>
61
- <Tree tree={filteredPackages.value} statusFilter={currentTab.value as AllureAwesomeStatus} root />
61
+ <Tree tree={filteredPackages.value} statusFilter={currentTab.value as ClassicStatus} root />
62
62
  </div>
63
63
  );
64
64
  }}
@@ -1,9 +1,7 @@
1
- import { statusesList } from "@allurereport/core-api";
2
- import { Loadable } from "@allurereport/web-components";
3
- import { Counter } from "@allurereport/web-components";
1
+ import { capitalize, statusesList } from "@allurereport/core-api";
2
+ import { Counter, Loadable } from "@allurereport/web-components";
4
3
  import { statsStore } from "@/stores";
5
4
  import { useI18n } from "@/stores/locale";
6
- import { capitalize } from "@/utils/capitalize";
7
5
  import { Tab, Tabs, TabsList } from "../Tabs";
8
6
  import { TreeList } from "../Tree";
9
7
  import { HeaderActions } from "./HeaderActions";
@@ -1,10 +1,14 @@
1
+ import { getReportOptions } from "@allurereport/web-commons";
2
+ import { ReportLogo } from "@allurereport/web-components";
1
3
  import * as styles from "@/components/ReportHeader/styles.scss";
2
- import { ReportLogo } from "@/components/ReportLogo";
4
+ import type { ClassicReportOptions } from "../../../types";
3
5
 
4
6
  export const ReportHeaderLogo = () => {
7
+ const { logo } = getReportOptions<ClassicReportOptions>() ?? {};
8
+
5
9
  return (
6
10
  <div className={styles["report-header-logo"]}>
7
- <ReportLogo />
11
+ <ReportLogo logo={logo} />
8
12
  </div>
9
13
  );
10
14
  };
@@ -1,13 +1,13 @@
1
1
  import { getReportOptions } from "@allurereport/web-commons";
2
2
  import { Heading, Text } from "@allurereport/web-components";
3
- import type { AllureAwesomeReportOptions } from "types";
3
+ import type { ClassicReportOptions } from "types";
4
4
  import { ReportHeaderLogo } from "@/components/ReportHeader/ReportHeaderLogo";
5
5
  import { ReportHeaderPie } from "@/components/ReportHeader/ReportHeaderPie";
6
6
  import { currentLocaleIso } from "@/stores";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
9
  export const ReportHeader = () => {
10
- const { reportName, createdAt } = getReportOptions<AllureAwesomeReportOptions>() ?? {};
10
+ const { reportName, createdAt } = getReportOptions<ClassicReportOptions>() ?? {};
11
11
  const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
12
12
  month: "long",
13
13
  day: "numeric",
@@ -1,4 +1,4 @@
1
- import { type Statistic, statusesList } from "@allurereport/core-api";
1
+ import { type Statistic, capitalize, statusesList } from "@allurereport/core-api";
2
2
  import { Loadable } from "@allurereport/web-components";
3
3
  import { computed } from "@preact/signals";
4
4
  import type { FunctionComponent } from "preact";
@@ -8,7 +8,6 @@ import { MetadataWithIcon } from "@/components/ReportMetadata/MetadataWithIcon";
8
8
  import * as styles from "@/components/ReportMetadata/styles.scss";
9
9
  import { statsStore } from "@/stores";
10
10
  import { useI18n } from "@/stores/locale";
11
- import { capitalize } from "@/utils/capitalize";
12
11
 
13
12
  export const MetadataSummary: FunctionComponent = () => {
14
13
  const { t } = useI18n("statuses");
@@ -1,12 +1,12 @@
1
1
  import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
2
  import type { FunctionalComponent } from "preact";
3
- import type { AllureAwesomeTestResult } from "types";
3
+ import type { ClassicTestResult } from "types";
4
4
  import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
5
5
  import { useI18n } from "@/stores";
6
6
  import * as styles from "./styles.scss";
7
7
 
8
8
  export type TestResultAttachmentViewProps = {
9
- testResult?: AllureAwesomeTestResult;
9
+ testResult?: ClassicTestResult;
10
10
  };
11
11
 
12
12
  export const TestResultAttachmentView: FunctionalComponent<TestResultAttachmentViewProps> = ({ testResult }) => {
@@ -1,12 +1,12 @@
1
1
  import { Text } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import { useState } from "preact/hooks";
4
- import type { AllureAwesomeTestResult } from "types";
4
+ import type { ClassicTestResult } from "types";
5
5
  import { MetadataButton } from "@/components/MetadataButton";
6
6
  import * as styles from "./styles.scss";
7
7
 
8
8
  export type TestResultDescriptionProps = {
9
- description: AllureAwesomeTestResult["description"];
9
+ description: ClassicTestResult["description"];
10
10
  };
11
11
 
12
12
  export const TestResultDescription: FunctionalComponent<TestResultDescriptionProps> = ({ description }) => {
@@ -1,5 +1,4 @@
1
- import { SvgIcon, allureIcons } from "@allurereport/web-components";
2
- import { Text } from "@allurereport/web-components";
1
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
3
2
  import * as baseStyles from "@/components/BaseLayout/styles.scss";
4
3
  import { TestResultInfo } from "@/components/TestResult/TestResultInfo";
5
4
  import * as styles from "./styles.scss";
@@ -8,13 +7,7 @@ const TestResultThumb = () => {
8
7
  return (
9
8
  <div className={styles["test-result-thumb"]}>
10
9
  <div className={styles["test-result-thumb-wrapper"]}>
11
- <SvgIcon
12
- size={"m"}
13
- width={"32px"}
14
- height={"32px"}
15
- id={allureIcons.lineDevCodeSquare}
16
- className={styles["test-result-thumb-icon"]}
17
- />
10
+ <SvgIcon size={"xl"} id={allureIcons.lineDevCodeSquare} className={styles["test-result-thumb-icon"]} />
18
11
  <Text className={styles["test-result-thumb-text"]}>No test case results</Text>
19
12
  </div>
20
13
  </div>
@@ -1,16 +1,14 @@
1
- import { IconButton, allureIcons } from "@allurereport/web-components";
2
- import { SvgIcon } from "@allurereport/web-components";
3
- import { Text } from "@allurereport/web-components";
1
+ import { IconButton, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
4
2
  import clsx from "clsx";
5
3
  import type { FunctionalComponent } from "preact";
6
- import type { AllureAwesomeTestResult } from "types";
4
+ import type { ClassicTestResult } from "types";
7
5
  import { LanguagePicker } from "@/components/LanguagePicker";
8
6
  import { ThemeButton } from "@/components/ThemeButton/ThemeButton";
9
7
  import { navigateTo } from "@/index";
10
8
  import * as styles from "./styles.scss";
11
9
 
12
10
  export type TestResultHeaderProps = {
13
- testResult?: AllureAwesomeTestResult;
11
+ testResult?: ClassicTestResult;
14
12
  };
15
13
 
16
14
  export const TestResultHeader: FunctionalComponent<TestResultHeaderProps> = ({ testResult }) => {
@@ -1,11 +1,11 @@
1
1
  import type { FunctionalComponent } from "preact";
2
2
  import { TestResultHistoryItem } from "@/components/TestResult/TestResultHistory/TestResultHistoryItem";
3
3
  import { useI18n } from "@/stores";
4
- import { type AllureAwesomeTestResult } from "../../../../types";
4
+ import { type ClassicTestResult } from "../../../../types";
5
5
  import * as styles from "./styles.scss";
6
6
 
7
7
  export type TestResultHistoryViewProps = {
8
- testResult?: AllureAwesomeTestResult;
8
+ testResult?: ClassicTestResult;
9
9
  };
10
10
 
11
11
  const TestResultHistoryView: FunctionalComponent<TestResultHistoryViewProps> = ({ testResult }) => {
@@ -1,7 +1,7 @@
1
+ import { capitalize } from "@allurereport/core-api";
1
2
  import { SvgIcon, allureIcons } from "@allurereport/web-components";
2
3
  import { type FunctionalComponent } from "preact";
3
4
  import { useI18n } from "@/stores";
4
- import { capitalize } from "@/utils/capitalize";
5
5
  import * as styles from "./styles.scss";
6
6
 
7
7
  const icons: Record<string, string> = {
@@ -1,7 +1,7 @@
1
1
  import { formatDuration } from "@allurereport/core-api";
2
2
  import { Counter, Heading, Text, TooltipWrapper } from "@allurereport/web-components";
3
3
  import type { FunctionalComponent } from "preact";
4
- import type { AllureAwesomeTestResult } from "types";
4
+ import type { ClassicTestResult } from "types";
5
5
  import { TestResultInfoStatuses } from "@/components/TestResult/TestResultInfo/TestResultInfoStatuses";
6
6
  import { TestResultNavigation } from "@/components/TestResult/TestResultNavigation";
7
7
  import { TestResultPrevStatuses } from "@/components/TestResult/TestResultPrevStatuses";
@@ -13,7 +13,7 @@ import { timestampToDate } from "@/utils/time";
13
13
  import * as styles from "./styles.scss";
14
14
 
15
15
  export type TestResultInfoProps = {
16
- testResult?: AllureAwesomeTestResult;
16
+ testResult?: ClassicTestResult;
17
17
  };
18
18
 
19
19
  export const TestResultInfo: FunctionalComponent<TestResultInfoProps> = ({ testResult }) => {
@@ -1,7 +1,7 @@
1
1
  import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import { useState } from "preact/hooks";
4
- import type { AllureAwesomeTestResult } from "types";
4
+ import type { ClassicTestResult } from "types";
5
5
  import { MetadataButton } from "@/components/MetadataButton";
6
6
  import { useI18n } from "@/stores/locale";
7
7
  import * as styles from "./styles.scss";
@@ -35,7 +35,7 @@ const TestResultLink: FunctionalComponent<{
35
35
  };
36
36
 
37
37
  export type TestResultLinksProps = {
38
- links: AllureAwesomeTestResult["links"];
38
+ links: ClassicTestResult["links"];
39
39
  };
40
40
 
41
41
  export const TestResultLinks: FunctionalComponent<TestResultLinksProps> = ({ links }) => {
@@ -1,13 +1,13 @@
1
1
  import type { FunctionalComponent } from "preact";
2
2
  import { useState } from "preact/hooks";
3
- import type { AllureAwesomeTestResult } from "types";
3
+ import type { ClassicTestResult } from "types";
4
4
  import { TestResultMetadataList } from "@/components/Metadata";
5
5
  import { MetadataButton } from "@/components/MetadataButton";
6
6
  import { useI18n } from "@/stores/locale";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
9
  export type TestResultMetadataProps = {
10
- testResult?: AllureAwesomeTestResult;
10
+ testResult?: ClassicTestResult;
11
11
  };
12
12
 
13
13
  export const TestResultMetadata: FunctionalComponent<TestResultMetadataProps> = ({ testResult }) => {
@@ -1,6 +1,6 @@
1
1
  import { Code, IconButton, Loadable, TooltipWrapper, allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
- import type { AllureAwesomeTestResult } from "types";
3
+ import type { ClassicTestResult } from "types";
4
4
  import { useI18n } from "@/stores";
5
5
  import { testResultNavStore } from "@/stores/testResults";
6
6
  import { copyToClipboard } from "@/utils/copyToClipboard";
@@ -8,7 +8,7 @@ import { navigateTo } from "@/utils/navigate";
8
8
  import * as styles from "./styles.scss";
9
9
 
10
10
  export type TestResultNavigationProps = {
11
- testResult?: AllureAwesomeTestResult;
11
+ testResult?: ClassicTestResult;
12
12
  };
13
13
 
14
14
  export const TestResultNavigation: FunctionalComponent<TestResultNavigationProps> = ({ testResult }) => {
@@ -1,5 +1,5 @@
1
1
  import type { FunctionalComponent } from "preact";
2
- import type { AllureAwesomeTestResult } from "types";
2
+ import type { ClassicTestResult } from "types";
3
3
  import * as styles from "@/components/BaseLayout/styles.scss";
4
4
  import { TestResultDescription } from "@/components/TestResult/TestResultDescription";
5
5
  import { TestResultError } from "@/components/TestResult/TestResultError";
@@ -11,7 +11,7 @@ import { TestResultSteps } from "@/components/TestResult/TestResultSteps";
11
11
  import { TestResultTeardown } from "@/components/TestResult/TestResultTeardown";
12
12
 
13
13
  export type TestResultOverviewProps = {
14
- testResult?: AllureAwesomeTestResult;
14
+ testResult?: ClassicTestResult;
15
15
  };
16
16
 
17
17
  export const TestResultOverview: FunctionalComponent<TestResultOverviewProps> = ({ testResult }) => {
@@ -1,13 +1,13 @@
1
1
  import type { FunctionalComponent } from "preact";
2
2
  import { useState } from "preact/hooks";
3
- import type { AllureAwesomeTestResult } from "types";
3
+ import type { ClassicTestResult } from "types";
4
4
  import { MetadataList } from "@/components/Metadata";
5
5
  import { MetadataButton } from "@/components/MetadataButton";
6
6
  import { useI18n } from "@/stores/locale";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
9
  export type TestResultParametersProps = {
10
- parameters: AllureAwesomeTestResult["parameters"];
10
+ parameters: ClassicTestResult["parameters"];
11
11
  };
12
12
 
13
13
  export const TestResultParameters: FunctionalComponent<TestResultParametersProps> = ({ parameters }) => {
@@ -1,18 +1,18 @@
1
- import { type HistoryTestResult } from "@allurereport/core-api";
1
+ import { type HistoryTestResult, capitalize } from "@allurereport/core-api";
2
2
  import { SvgIcon, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
3
3
  import type { FunctionalComponent } from "preact";
4
- import type { AllureAwesomeTestResult } from "types";
4
+ import type { ClassicTestResult } from "types";
5
5
  import { useI18n } from "@/stores";
6
- import { capitalize } from "@/utils/capitalize";
7
- import { navigateTo } from "@/utils/navigate";
8
6
  import { timestampToDate } from "@/utils/time";
9
7
  import * as styles from "./styles.scss";
10
8
 
11
9
  const TestResultPrevStatus: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
10
+ const navigateUrl = new URL(item.id, item.url);
11
+
12
12
  return (
13
- <div className={styles["test-result-prev-status"]} onClick={() => navigateTo(`testresult/${item.id}`)}>
13
+ <a className={styles["test-result-prev-status"]} href={navigateUrl.toString()} target={"_blank"} rel={"noreferrer"}>
14
14
  <SvgIcon id={allureIcons.lineShapesDotCircle} className={styles[`status-${item?.status}`]} />
15
- </div>
15
+ </a>
16
16
  );
17
17
  };
18
18
  const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult }> = ({ item }) => {
@@ -31,7 +31,7 @@ const TestResultPrevStatusTooltip: FunctionalComponent<{ item: HistoryTestResult
31
31
  };
32
32
 
33
33
  export type TestResultPrevStatusesProps = {
34
- history: AllureAwesomeTestResult["history"];
34
+ history: ClassicTestResult["history"];
35
35
  };
36
36
 
37
37
  export const TestResultPrevStatuses: FunctionalComponent<TestResultPrevStatusesProps> = ({ history }) => {
@@ -6,16 +6,30 @@ import { ArrowButton } from "@/components/ArrowButton";
6
6
  import { TestResultError } from "@/components/TestResult/TestResultError";
7
7
  import * as styles from "@/components/TestResult/TestResultRetriesView/styles.scss";
8
8
  import TreeItemIcon from "@/components/Tree/TreeItemIcon";
9
+ import { useI18n } from "@/stores";
9
10
  import { navigateTo } from "@/utils/navigate";
10
11
  import { timestampToDate } from "@/utils/time";
11
12
 
12
- export const TestResultRetriesItem: FunctionalComponent<{
13
+ export type TrRetriesItemProps = {
13
14
  testResultItem: TestResult;
14
- }> = ({ testResultItem }) => {
15
+ attempt: number;
16
+ totalAttempts: number;
17
+ };
18
+
19
+ export const TestResultRetriesItem: FunctionalComponent<TrRetriesItemProps> = ({
20
+ testResultItem,
21
+ attempt,
22
+ totalAttempts,
23
+ }) => {
15
24
  const { id, status, message, trace, stop, duration } = testResultItem;
16
25
  const [isOpened, setIsOpen] = useState(false);
17
- const convertedStop = timestampToDate(stop);
18
- const formattedDuration = formatDuration(duration as number);
26
+ const { t } = useI18n("ui");
27
+
28
+ const retryTitlePrefix = t("attempt", { attempt, total: totalAttempts });
29
+ const convertedStop = stop ? timestampToDate(stop) : undefined;
30
+ const retryTitle = convertedStop ? `${retryTitlePrefix} – ${convertedStop}` : retryTitlePrefix;
31
+
32
+ const formattedDuration = typeof duration === "number" ? formatDuration(duration) : undefined;
19
33
  const navigateUrl = `testresult/${id}`;
20
34
 
21
35
  return (
@@ -24,11 +38,13 @@ export const TestResultRetriesItem: FunctionalComponent<{
24
38
  {Boolean(message) && <ArrowButton isOpened={isOpened} icon={allureIcons.lineArrowsChevronDown} />}
25
39
  <div className={styles["test-result-retries-item-wrap"]}>
26
40
  <TreeItemIcon status={status} className={styles["test-result-retries-item-status"]} />
27
- <Text className={styles["test-result-retries-item-text"]}>{convertedStop}</Text>
41
+ <Text className={styles["test-result-retries-item-text"]}>{retryTitle}</Text>
28
42
  <div className={styles["test-result-retries-item-info"]}>
29
- <Text type="ui" size={"s"} className={styles["item-time"]}>
30
- {formattedDuration}
31
- </Text>
43
+ {Boolean(formattedDuration) && (
44
+ <Text type="ui" size={"s"} className={styles["item-time"]}>
45
+ {formattedDuration}
46
+ </Text>
47
+ )}
32
48
  <IconButton
33
49
  icon={allureIcons.lineGeneralLinkExternal}
34
50
  style={"ghost"}
@@ -1,17 +1,24 @@
1
1
  import type { FunctionalComponent } from "preact";
2
- import type { AllureAwesomeTestResult } from "types";
2
+ import type { ClassicTestResult } from "types";
3
3
  import * as styles from "@/components/TestResult/TestResultHistory/styles.scss";
4
4
  import { TestResultRetriesItem } from "@/components/TestResult/TestResultRetriesView/TestResultRetriesItem";
5
5
  import { useI18n } from "@/stores";
6
6
 
7
- export const TestResultRetriesView: FunctionalComponent<{ testResult: AllureAwesomeTestResult }> = ({ testResult }) => {
7
+ export const TestResultRetriesView: FunctionalComponent<{ testResult: ClassicTestResult }> = ({ testResult }) => {
8
8
  const { retries } = testResult ?? {};
9
9
  const { t } = useI18n("empty");
10
10
 
11
11
  return (
12
12
  <div className={styles["test-result-history"]}>
13
13
  {retries.length ? (
14
- retries?.map((item, key) => <TestResultRetriesItem testResultItem={item} key={key} />)
14
+ retries?.map((item, key) => (
15
+ <TestResultRetriesItem
16
+ testResultItem={item}
17
+ key={key}
18
+ attempt={retries.length - key}
19
+ totalAttempts={retries.length + 1}
20
+ />
21
+ ))
15
22
  ) : (
16
23
  <div className={styles["test-result-empty"]}>{t("no-retries-results")}</div>
17
24
  )}
@@ -1,7 +1,7 @@
1
1
  import { allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import { useState } from "preact/hooks";
4
- import type { AllureAwesomeTestResult } from "types";
4
+ import type { ClassicTestResult } from "types";
5
5
  import { TestResultDropdown } from "@/components/TestResult/TestResultDropdown";
6
6
  import * as styles from "@/components/TestResult/TestResultSteps/styles.scss";
7
7
  import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
@@ -16,7 +16,7 @@ const typeMap = {
16
16
  };
17
17
 
18
18
  export type TestResultSetupProps = {
19
- setup: AllureAwesomeTestResult["setup"];
19
+ setup: ClassicTestResult["setup"];
20
20
  };
21
21
 
22
22
  export const TestResultSetup: FunctionalComponent<TestResultSetupProps> = ({ setup }) => {
@@ -1,7 +1,7 @@
1
+ import { capitalize } from "@allurereport/core-api";
1
2
  import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
3
  import clsx from "clsx";
3
4
  import { useI18n } from "@/stores/locale";
4
- import { capitalize } from "@/utils/capitalize";
5
5
  import * as styles from "./styles.scss";
6
6
 
7
7
  const icons: Record<string, string> = {
@@ -1,9 +1,9 @@
1
1
  import type { TestStatus } from "@allurereport/core-api";
2
+ import { capitalize } from "@allurereport/core-api";
2
3
  import { Text } from "@allurereport/web-components";
3
4
  import clsx from "clsx";
4
5
  import TreeItemIcon from "@/components/Tree/TreeItemIcon";
5
6
  import { useI18n } from "@/stores";
6
- import { capitalize } from "@/utils/capitalize";
7
7
  import * as styles from "./styles.scss";
8
8
 
9
9
  export const TestResultStatus = ({ status }: { status: TestStatus }) => {
@@ -1,4 +1,6 @@
1
+ import { sanitize } from "@allurereport/web-commons";
1
2
  import type { FunctionalComponent } from "preact";
3
+ import { useEffect, useState } from "preact/hooks";
2
4
  import * as styles from "./styles.scss";
3
5
 
4
6
  // TODO: use proper type here
@@ -7,6 +9,30 @@ export type HtmlAttachmentPreviewProps = {
7
9
  };
8
10
 
9
11
  export const HtmlAttachmentPreview: FunctionalComponent<HtmlAttachmentPreviewProps> = ({ attachment }) => {
10
- // eslint-disable-next-line react/no-danger
11
- return <div className={styles["html-attachment-preview"]} dangerouslySetInnerHTML={{ __html: attachment?.text }} />;
12
+ const [blobUrl, setBlobUrl] = useState<string>("");
13
+
14
+ const rawText = attachment.text ?? "";
15
+ const sanitizedText = rawText.length > 0 ? sanitize(rawText) : "";
16
+
17
+ useEffect(() => {
18
+ if (sanitizedText) {
19
+ const blob = new Blob([sanitizedText], { type: "text/html" });
20
+ const url = URL.createObjectURL(blob);
21
+ setBlobUrl(url);
22
+
23
+ return () => {
24
+ URL.revokeObjectURL(url);
25
+ };
26
+ }
27
+ }, [sanitizedText]);
28
+
29
+ if (!sanitizedText) {
30
+ return null;
31
+ }
32
+
33
+ return (
34
+ <div className={styles["html-attachment-preview"]}>
35
+ <iframe src={blobUrl} width="100%" height="100%" frameBorder="0" sandbox="allow-same-origin" />
36
+ </div>
37
+ );
12
38
  };
@@ -1,7 +1,7 @@
1
1
  import { allureIcons } from "@allurereport/web-components";
2
2
  import type { FunctionalComponent } from "preact";
3
3
  import { useState } from "preact/hooks";
4
- import type { AllureAwesomeTestResult, AllureAwesomeTestStepResult } from "types";
4
+ import type { ClassicTestResult, ClassicTestStepResult } from "types";
5
5
  import { TestResultDropdown } from "@/components/TestResult/TestResultDropdown";
6
6
  import { TestResultAttachment } from "@/components/TestResult/TestResultSteps/testResultAttachment";
7
7
  import { TestResultStep } from "@/components/TestResult/TestResultSteps/testResultStep";
@@ -14,11 +14,11 @@ const typeMap = {
14
14
  } as const;
15
15
 
16
16
  export type TestResultStepsProps = {
17
- steps: AllureAwesomeTestResult["steps"];
17
+ steps: ClassicTestResult["steps"];
18
18
  };
19
19
 
20
20
  type StepComponentProps = FunctionalComponent<{
21
- item?: AllureAwesomeTestStepResult;
21
+ item?: ClassicTestStepResult;
22
22
  stepIndex?: number;
23
23
  }>;
24
24
 
@@ -37,7 +37,7 @@ export const TestResultSteps: FunctionalComponent<TestResultStepsProps> = ({ ste
37
37
  />
38
38
  {isOpened && (
39
39
  <div className={styles["test-result-steps-root"]}>
40
- {steps?.map((item: AllureAwesomeTestStepResult, index) => {
40
+ {steps?.map((item: ClassicTestStepResult, index) => {
41
41
  const { type } = item;
42
42
  const StepComponent: StepComponentProps = typeMap[type];
43
43
  return StepComponent ? <StepComponent item={item} stepIndex={index + 1} key={index} /> : null;