@allurereport/web-awesome 3.0.0-beta.15 → 3.0.0-beta.17

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 (111) hide show
  1. package/dist/multi/173.app-3f57abaa5734556b2988.js +1 -0
  2. package/dist/multi/174.app-3f57abaa5734556b2988.js +1 -0
  3. package/dist/multi/252.app-3f57abaa5734556b2988.js +1 -0
  4. package/dist/multi/282.app-3f57abaa5734556b2988.js +1 -0
  5. package/dist/multi/29.app-3f57abaa5734556b2988.js +1 -0
  6. package/dist/multi/416.app-3f57abaa5734556b2988.js +1 -0
  7. package/dist/multi/527.app-3f57abaa5734556b2988.js +1 -0
  8. package/dist/multi/600.app-3f57abaa5734556b2988.js +1 -0
  9. package/dist/multi/605.app-3f57abaa5734556b2988.js +1 -0
  10. package/dist/multi/638.app-3f57abaa5734556b2988.js +1 -0
  11. package/dist/multi/672.app-3f57abaa5734556b2988.js +1 -0
  12. package/dist/multi/686.app-3f57abaa5734556b2988.js +1 -0
  13. package/dist/multi/725.app-3f57abaa5734556b2988.js +1 -0
  14. package/dist/multi/741.app-3f57abaa5734556b2988.js +1 -0
  15. package/dist/multi/755.app-3f57abaa5734556b2988.js +1 -0
  16. package/dist/multi/894.app-3f57abaa5734556b2988.js +1 -0
  17. package/dist/multi/943.app-3f57abaa5734556b2988.js +1 -0
  18. package/dist/multi/980.app-3f57abaa5734556b2988.js +1 -0
  19. package/dist/multi/app-3f57abaa5734556b2988.js +2 -0
  20. package/dist/multi/app-3f57abaa5734556b2988.js.LICENSE.txt +16 -0
  21. package/dist/multi/manifest.json +24 -24
  22. package/dist/multi/styles-9475296a2cbcd0e5d2d0.css +44 -0
  23. package/dist/single/app-800f7e75bb52ecb2ae21.js +2 -0
  24. package/dist/single/app-800f7e75bb52ecb2ae21.js.LICENSE.txt +16 -0
  25. package/dist/single/manifest.json +1 -1
  26. package/package.json +23 -17
  27. package/src/assets/scss/day.scss +2 -0
  28. package/src/assets/scss/night.scss +2 -0
  29. package/src/assets/scss/theme.scss +4 -0
  30. package/src/components/Charts/index.tsx +2 -2
  31. package/src/components/Header/CiInfo/index.tsx +51 -0
  32. package/src/components/Header/CiInfo/styles.scss +7 -0
  33. package/src/components/Header/index.tsx +6 -1
  34. package/src/components/MetadataButton/index.tsx +1 -1
  35. package/src/components/ReportBody/Filters.tsx +44 -63
  36. package/src/components/ReportMetadata/MetadataSummary.tsx +1 -1
  37. package/src/components/ReportMetadata/MetadataWithIcon.tsx +9 -11
  38. package/src/components/TestResult/TrDescription/index.tsx +1 -1
  39. package/src/components/TestResult/TrError/TrDiff.tsx +0 -1
  40. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +63 -34
  41. package/src/components/TestResult/TrHistory/styles.scss +2 -1
  42. package/src/components/TestResult/TrInfo/TrInfoStatuses.tsx +4 -2
  43. package/src/components/TestResult/TrOverview.tsx +0 -1
  44. package/src/components/TestResult/TrPrevStatuses/index.tsx +20 -5
  45. package/src/components/TestResult/TrPwTraces/index.tsx +6 -3
  46. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +24 -6
  47. package/src/components/TestResult/TrRetriesView/index.tsx +8 -1
  48. package/src/components/TestResult/TrSteps/TrAttachment.tsx +13 -1
  49. package/src/components/TestResult/TrSteps/TrStep.tsx +4 -3
  50. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +61 -1
  51. package/src/components/TestResult/TrSteps/styles.scss +31 -0
  52. package/src/components/Tree/index.tsx +15 -3
  53. package/src/index.html +14 -1
  54. package/src/locales/az.json +34 -16
  55. package/src/locales/de.json +34 -15
  56. package/src/locales/en.json +20 -2
  57. package/src/locales/es.json +31 -12
  58. package/src/locales/fr.json +31 -12
  59. package/src/locales/he.json +21 -2
  60. package/src/locales/hy.json +21 -2
  61. package/src/locales/it.json +24 -5
  62. package/src/locales/ja.json +24 -5
  63. package/src/locales/ka.json +31 -12
  64. package/src/locales/kr.json +21 -2
  65. package/src/locales/nl.json +31 -12
  66. package/src/locales/pl.json +41 -20
  67. package/src/locales/pt.json +32 -12
  68. package/src/locales/ru.json +42 -21
  69. package/src/locales/sv.json +31 -12
  70. package/src/locales/tr.json +31 -12
  71. package/src/locales/zh.json +31 -12
  72. package/src/stores/locale.ts +2 -0
  73. package/src/stores/tree.ts +7 -1
  74. package/src/utils/charts.ts +16 -18
  75. package/src/utils/tree.ts +23 -0
  76. package/src/utils/treeFilters.ts +14 -3
  77. package/test/components/Header/CiInfo.test.tsx +151 -0
  78. package/test/components/Header.test.tsx +127 -0
  79. package/tsconfig.json +7 -2
  80. package/tsconfig.node.json +8 -0
  81. package/types.d.ts +4 -1
  82. package/vitest.config.ts +15 -2
  83. package/vitest.setup.ts +1 -0
  84. package/webpack.config.js +5 -5
  85. package/dist/multi/173.app-35b67161.js +0 -1
  86. package/dist/multi/174.app-35b67161.js +0 -1
  87. package/dist/multi/252.app-35b67161.js +0 -1
  88. package/dist/multi/282.app-35b67161.js +0 -1
  89. package/dist/multi/29.app-35b67161.js +0 -1
  90. package/dist/multi/416.app-35b67161.js +0 -1
  91. package/dist/multi/527.app-35b67161.js +0 -1
  92. package/dist/multi/600.app-35b67161.js +0 -1
  93. package/dist/multi/605.app-35b67161.js +0 -1
  94. package/dist/multi/638.app-35b67161.js +0 -1
  95. package/dist/multi/672.app-35b67161.js +0 -1
  96. package/dist/multi/686.app-35b67161.js +0 -1
  97. package/dist/multi/725.app-35b67161.js +0 -1
  98. package/dist/multi/741.app-35b67161.js +0 -1
  99. package/dist/multi/755.app-35b67161.js +0 -1
  100. package/dist/multi/894.app-35b67161.js +0 -1
  101. package/dist/multi/943.app-35b67161.js +0 -1
  102. package/dist/multi/980.app-35b67161.js +0 -1
  103. package/dist/multi/app-35b67161.js +0 -2
  104. package/dist/multi/app-35b67161.js.LICENSE.txt +0 -23
  105. package/dist/multi/styles-35b67161.css +0 -43
  106. package/dist/single/app-f5ecfcd9.js +0 -2
  107. package/dist/single/app-f5ecfcd9.js.LICENSE.txt +0 -23
  108. /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
  109. /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
  110. /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
  111. /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Prism: Lightweight, robust, elegant syntax highlighting
3
+ *
4
+ * @license MIT <https://opensource.org/licenses/MIT>
5
+ * @author Lea Verou <https://lea.verou.me>
6
+ * @namespace
7
+ * @public
8
+ */
9
+
10
+ /**
11
+ * filesize
12
+ *
13
+ * @copyright 2024 Jason Mulligan <jason.mulligan@avoidwork.com>
14
+ * @license BSD-3-Clause
15
+ * @version 10.1.6
16
+ */
@@ -1,3 +1,3 @@
1
1
  {
2
- "main.js": "app-f5ecfcd9.js"
2
+ "main.js": "app-800f7e75bb52ecb2ae21.js"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allurereport/web-awesome",
3
- "version": "3.0.0-beta.15",
3
+ "version": "3.0.0-beta.17",
4
4
  "description": "The static files for Allure Awesome Report",
5
5
  "keywords": [
6
6
  "allure",
@@ -31,39 +31,43 @@
31
31
  "IE 11"
32
32
  ],
33
33
  "dependencies": {
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",
34
+ "@allurereport/core-api": "3.0.0-beta.17",
35
+ "@allurereport/web-commons": "3.0.0-beta.17",
36
+ "@allurereport/web-components": "3.0.0-beta.17",
37
37
  "@preact/signals": "^1.3.0",
38
38
  "clsx": "^2.1.1",
39
39
  "d3-shape": "^3.2.0",
40
40
  "i18next": "^24.0.2",
41
41
  "md5": "^2.3.0",
42
42
  "preact": "^10.24.0",
43
- "prismjs": "^1.29.0",
43
+ "prismjs": "^1.30.0",
44
44
  "reset.css": "^2.0.2"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/core": "^7.25.2",
48
- "@babel/plugin-transform-react-jsx": "^7.25.2",
49
- "@babel/preset-env": "^7.25.4",
50
- "@babel/preset-typescript": "^7.24.7",
47
+ "@babel/core": "^7.27.4",
48
+ "@babel/plugin-transform-react-jsx": "^7.27.1",
49
+ "@babel/preset-env": "^7.27.2",
50
+ "@babel/preset-typescript": "^7.27.1",
51
51
  "@eslint/js": "^9.10.0",
52
52
  "@floating-ui/dom": "^1.6.12",
53
53
  "@preact/compat": "^18.3.1",
54
+ "@preact/preset-vite": "^2.10.2",
54
55
  "@stylistic/eslint-plugin": "^2.6.1",
56
+ "@testing-library/jest-dom": "^6.1.5",
57
+ "@testing-library/preact": "^3.2.3",
58
+ "@testing-library/user-event": "^14.5.1",
55
59
  "@types/babel__core": "^7.20.5",
56
60
  "@types/d3-shape": "^3.1.6",
57
61
  "@types/diff": "^7",
58
62
  "@types/eslint": "^8.56.11",
59
63
  "@types/md5": "^2.3.5",
60
64
  "@types/node": "^20.17.9",
61
- "@types/prismjs": "^1",
65
+ "@types/prismjs": "^1.26.5",
62
66
  "@typescript-eslint/eslint-plugin": "^8.0.0",
63
67
  "@typescript-eslint/parser": "^8.0.0",
64
- "@vitest/runner": "^2.1.8",
65
- "@vitest/snapshot": "^2.1.8",
66
- "allure-vitest": "^3.0.9",
68
+ "@vitest/runner": "^3.2.4",
69
+ "@vitest/snapshot": "^3.2.4",
70
+ "allure-vitest": "^3.3.2",
67
71
  "ansi-to-html": "^0.7.2",
68
72
  "autoprefixer": "^10.4.20",
69
73
  "babel-loader": "^9.2.1",
@@ -87,9 +91,10 @@
87
91
  "fork-ts-checker-webpack-plugin": "^9.0.2",
88
92
  "globals": "^15.9.0",
89
93
  "html-webpack-plugin": "^5.6.3",
94
+ "jsdom": "^26.1.0",
90
95
  "mini-css-extract-plugin": "^2.9.1",
91
96
  "npm-run-all2": "^7.0.1",
92
- "postcss": "^8.4.49",
97
+ "postcss": "^8.5.6",
93
98
  "rimraf": "^6.0.1",
94
99
  "sass": "^1.79.1",
95
100
  "sass-loader": "^16.0.1",
@@ -99,10 +104,11 @@
99
104
  "terser-webpack-plugin": "^5.3.14",
100
105
  "typescript": "^5.6.3",
101
106
  "typescript-eslint": "^8.6.0",
102
- "vitest": "^2.1.8",
103
- "webpack": "^5.94.0",
107
+ "vite": "^7.0.6",
108
+ "vitest": "^3.2.4",
109
+ "webpack": "^5.99.9",
104
110
  "webpack-cli": "^5.1.4",
105
- "webpack-dev-server": "^5.1.0",
111
+ "webpack-dev-server": "^5.2.2",
106
112
  "webpack-manifest-plugin": "^5.0.0"
107
113
  }
108
114
  }
@@ -26,6 +26,7 @@
26
26
  --bg-support-castor-medium-day: var(--castor-day-darken-2);
27
27
  --bg-support-rau-day: var(--rau-day-darken-1);
28
28
  --bg-support-skat-day: var(--skat-day-darken-1);
29
+ --bg-support-sirius-day: var(--sirius-day-darken-1);
29
30
  --constant-bg-base-modal-day: var(--gray-neutral-800);
30
31
  --constant-on-border-heavy-day: var(--gray-neutral-alpha-night-300);
31
32
  --constant-on-icon-primary-day: var(--gray-neutral-alpha-night-50);
@@ -48,4 +49,5 @@
48
49
  --on-text-hint-day: var(--gray-neutral-alpha-day-450);
49
50
  --on-text-primary-day: var(--gray-neutral-alpha-day-800);
50
51
  --on-text-secondary-day: var(--gray-neutral-alpha-day-600);
52
+ --on-text-universal-primary-day: var(--gray-neutral-75);
51
53
  }
@@ -29,6 +29,7 @@
29
29
  --bg-support-castor-night: var(--castor-night-darken-5);
30
30
  --bg-support-rau-night: var(--rau-night-darken-5);
31
31
  --bg-support-skat-night: var(--skat-night-darken-5);
32
+ --bg-support-sirius-night: var(--sirius-night-darken-5);
32
33
  --constant-bg-base-modal-night: var(--gray-neutral-750);
33
34
  --constant-bg-base-primary-night: var(--gray-neutral-950);
34
35
  --constant-on-border-heavy-night: var(--gray-neutral-alpha-night-300);
@@ -58,4 +59,5 @@
58
59
  --on-text-hint-night: var(--gray-neutral-alpha-night-450);
59
60
  --on-text-primary-night: var(--gray-neutral-alpha-night-100);
60
61
  --on-text-secondary-night: var(--gray-neutral-alpha-night-300);
62
+ --on-text-universal-primary-night: var(--gray-neutral-75);
61
63
  }
@@ -25,6 +25,7 @@
25
25
  --bg-support-castor: var(--bg-support-castor-day);
26
26
  --bg-support-rau: var(--bg-support-rau-day);
27
27
  --bg-support-skat: var(--bg-support-skat-day);
28
+ --bg-support-sirius: var(--bg-support-sirius-day);
28
29
  --constant-bg-base-modal: var(--constant-bg-base-modal-day);
29
30
  --constant-on-border-heavy: var(--constant-on-border-heavy-day);
30
31
  --constant-on-icon-primary: var(--constant-on-icon-primary-day);
@@ -47,6 +48,7 @@
47
48
  --on-text-hint: var(--on-text-hint-day);
48
49
  --on-text-primary: var(--on-text-primary-day);
49
50
  --on-text-secondary: var(--on-text-secondary-day);
51
+ --on-text-universal-primary: var(--on-text-universal-primary-day);
50
52
  --scrollbar-color: var(--gray-300);
51
53
  --bg-alpha-atlas: var(--atlas-day-darken-1-8);
52
54
  --bg-alpha-rau: var(--rau-day-darken-1-8);
@@ -88,6 +90,7 @@
88
90
  --bg-support-castor: var(--bg-support-castor-night);
89
91
  --bg-support-rau: var(--bg-support-rau-night);
90
92
  --bg-support-skat: var(--bg-support-skat-night);
93
+ --bg-support-sirius: var(--bg-support-sirius-night);
91
94
  --constant-bg-base-modal: var(--constant-bg-base-modal-night);
92
95
  --constant-bg-base-primary: var(--constant-bg-base-primary-night);
93
96
  --constant-on-border-heavy: var(--constant-on-border-heavy-night);
@@ -117,6 +120,7 @@
117
120
  --on-text-hint: var(--on-text-hint-night);
118
121
  --on-text-primary: var(--on-text-primary-night);
119
122
  --on-text-secondary: var(--on-text-secondary-night);
123
+ --on-text-universal-primary: var(--on-text-universal-primary-night);
120
124
 
121
125
  --scrollbar-color: var(--gray-400);
122
126
  --bg-alpha-atlas: var(--atlas-night-darken-5-12);
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
- import { capitalize } from "@allurereport/web-commons";
2
+ import { ChartType, capitalize } from "@allurereport/web-commons";
3
3
  import {
4
4
  Grid,
5
5
  GridItem,
@@ -13,7 +13,6 @@ import { useEffect } from "preact/hooks";
13
13
  import { chartsStore, fetchChartsData } from "@/stores/chart";
14
14
  import { useI18n } from "@/stores/locale";
15
15
  import type { ChartData } from "@/utils/charts";
16
- import { ChartType } from "@/utils/charts";
17
16
  import * as styles from "./styles.scss";
18
17
 
19
18
  const getChartWidgetByType = (
@@ -29,6 +28,7 @@ const getChartWidgetByType = (
29
28
  return (
30
29
  <TrendChartWidget
31
30
  title={title}
31
+ mode={chartData.mode}
32
32
  items={chartData.items}
33
33
  slices={chartData.slices}
34
34
  min={chartData.min}
@@ -0,0 +1,51 @@
1
+ import { CiDescriptor, CiType } from "@allurereport/core-api";
2
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
3
+ import type { ClassValue } from "clsx";
4
+ import clsx from "clsx";
5
+ import { useMemo } from "preact/hooks";
6
+ import * as styles from "./styles.scss";
7
+
8
+ interface CiInfoProps {
9
+ ci: CiDescriptor;
10
+ className?: ClassValue;
11
+ }
12
+
13
+ export const CiInfo = ({ ci, className }: CiInfoProps) => {
14
+ const icon = useMemo(() => {
15
+ switch (ci.type) {
16
+ case CiType.Amazon:
17
+ return allureIcons.amazon;
18
+ case CiType.Azure:
19
+ return allureIcons.azure;
20
+ case CiType.Bitbucket:
21
+ return allureIcons.bitbucket;
22
+ case CiType.Circle:
23
+ return allureIcons.circleci;
24
+ case CiType.Drone:
25
+ return allureIcons.drone;
26
+ case CiType.Github:
27
+ return allureIcons.github;
28
+ case CiType.Gitlab:
29
+ return allureIcons.gitlab;
30
+ case CiType.Jenkins:
31
+ return allureIcons.jenkins;
32
+ default:
33
+ return undefined;
34
+ }
35
+ }, [ci]);
36
+ const link = ci.pullRequestUrl ?? ci.jobUrl ?? ci.jobRunUrl;
37
+ const label = ci.pullRequestName ?? ci.jobName ?? ci.jobRunName ?? link;
38
+
39
+ if (!link) {
40
+ return null;
41
+ }
42
+
43
+ return (
44
+ <a className={clsx(styles["ci-info"], className)} href={link}>
45
+ {icon && <SvgIcon id={icon} width={16} height={16} />}
46
+ <Text type={"paragraph"} size={"m"} bold>
47
+ {label}
48
+ </Text>
49
+ </a>
50
+ );
51
+ };
@@ -0,0 +1,7 @@
1
+ .ci-info {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 0 6px;
5
+ color: var(--on-text-secondary);
6
+ text-decoration: none;
7
+ }
@@ -1,3 +1,4 @@
1
+ import { getReportOptions } from "@allurereport/web-commons";
1
2
  import type { ClassValue } from "clsx";
2
3
  import clsx from "clsx";
3
4
  import { HeaderControls } from "@/components/HeaderControls";
@@ -6,6 +7,8 @@ import { TrBreadcrumbs } from "@/components/TestResult/TrHeader/TrBreadcrumbs";
6
7
  import { route } from "@/stores/router";
7
8
  import { availableSections } from "@/stores/sections";
8
9
  import { testResultStore } from "@/stores/testResults";
10
+ import type { AwesomeReportOptions } from "../../../types";
11
+ import { CiInfo } from "./CiInfo";
9
12
  import * as styles from "./styles.scss";
10
13
 
11
14
  interface HeaderProps {
@@ -13,11 +16,13 @@ interface HeaderProps {
13
16
  }
14
17
 
15
18
  export const Header = ({ className }: HeaderProps) => {
16
- const testResultId = route.value.params?.testResultId ?? null;
19
+ const testResultId = route.value.params?.testResultId;
20
+ const { ci } = getReportOptions<AwesomeReportOptions>();
17
21
 
18
22
  return (
19
23
  <div className={clsx(styles.above, className)}>
20
24
  {Boolean(availableSections.value?.length) && <SectionPicker />}
25
+ {!testResultId && ci && <CiInfo ci={ci} />}
21
26
  {testResultId && <TrBreadcrumbs testResult={testResultStore.value?.data?.[testResultId]} />}
22
27
  <HeaderControls className={styles.right} />
23
28
  </div>
@@ -27,7 +27,7 @@ export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({
27
27
  <Text size={"m"} bold>
28
28
  {title}
29
29
  </Text>
30
- {counter !== null && <Counter count={counter} size="s" />}
30
+ {!!counter && <Counter count={counter} size="s" />}
31
31
  <ArrowButton
32
32
  isOpened={isOpened}
33
33
  iconSize={"s"}
@@ -1,12 +1,51 @@
1
- import { Button, Menu, Toggle, allureIcons } from "@allurereport/web-components";
1
+ import { Button, Menu, Toggle, TooltipWrapper, allureIcons } from "@allurereport/web-components";
2
2
  import { useI18n } from "@/stores/locale";
3
- import { setTreeFilter, treeFiltersStore } from "@/stores/tree";
3
+ import { type TreeFilters, setTreeFilter, treeFiltersStore } from "@/stores/tree";
4
4
  import * as styles from "./styles.scss";
5
5
 
6
+ const filterIcons: Record<TreeFilters, string> = {
7
+ flaky: allureIcons.lineIconBomb2,
8
+ retry: allureIcons.lineArrowsRefreshCcw1,
9
+ new: allureIcons.lineAlertsNew,
10
+ fixed: allureIcons.lineAlertsFixed,
11
+ regressed: allureIcons.lineAlertsRegressed,
12
+ malfunctioned: allureIcons.lineAlertsMalfunctioned,
13
+ };
14
+
15
+ const MENU_KEYS = ["flaky", "retry", "new", "fixed", "regressed", "malfunctioned"] as TreeFilters[];
16
+
6
17
  export const Filters = () => {
7
18
  const { t } = useI18n("filters");
8
- const { flaky, retry, new: isNew } = treeFiltersStore.value.filter;
9
- const hasFilter = flaky || retry || isNew;
19
+ const { t: tooltip } = useI18n("filters.description");
20
+ const hasFilter = MENU_KEYS.some((key) => treeFiltersStore.value.filter[key]);
21
+
22
+ const renderFilterItem = (filter: TreeFilters, value: boolean) => {
23
+ return (
24
+ <TooltipWrapper data-testid="filter-tooltip" tooltipText={tooltip(filter)}>
25
+ <Menu.Item
26
+ closeMenuOnClick={false}
27
+ ariaLabel={t("enable-filter", { filter: t(filter) })}
28
+ onClick={() => {
29
+ setTreeFilter(filter, !value);
30
+ }}
31
+ leadingIcon={filterIcons[filter]}
32
+ rightSlot={
33
+ <div className={styles.filterToggle}>
34
+ <Toggle
35
+ focusable={false}
36
+ value={value}
37
+ label={t("enable-filter", { filter: t(filter) })}
38
+ data-testid={`${filter}-filter`}
39
+ onChange={(changeValue) => setTreeFilter(filter, changeValue)}
40
+ />
41
+ </div>
42
+ }
43
+ >
44
+ {t(filter)}
45
+ </Menu.Item>
46
+ </TooltipWrapper>
47
+ );
48
+ };
10
49
 
11
50
  return (
12
51
  <Menu
@@ -25,65 +64,7 @@ export const Filters = () => {
25
64
  )}
26
65
  >
27
66
  <Menu.Section data-testid="filters-menu">
28
- <Menu.Item
29
- closeMenuOnClick={false}
30
- ariaLabel={t("enable-filter", { filter: t("flaky") })}
31
- onClick={() => {
32
- setTreeFilter("flaky", !flaky);
33
- }}
34
- leadingIcon={allureIcons.lineIconBomb2}
35
- rightSlot={
36
- <div className={styles.filterToggle}>
37
- <Toggle
38
- focusable={false}
39
- value={flaky}
40
- label={t("enable-filter", { filter: t("flaky") })}
41
- data-testid="flaky-filter"
42
- onChange={(value) => setTreeFilter("flaky", value)}
43
- />
44
- </div>
45
- }
46
- >
47
- {t("flaky")}
48
- </Menu.Item>
49
- <Menu.Item
50
- closeMenuOnClick={false}
51
- ariaLabel={t("enable-filter", { filter: t("retry") })}
52
- onClick={() => setTreeFilter("retry", !retry)}
53
- leadingIcon={allureIcons.lineArrowsRefreshCcw1}
54
- rightSlot={
55
- <div className={styles.filterToggle}>
56
- <Toggle
57
- focusable={false}
58
- value={retry}
59
- label={t("enable-filter", { filter: t("retry") })}
60
- data-testid="retry-filter"
61
- onChange={(value) => setTreeFilter("retry", value)}
62
- />
63
- </div>
64
- }
65
- >
66
- {t("retry")}
67
- </Menu.Item>
68
- <Menu.Item
69
- closeMenuOnClick={false}
70
- ariaLabel={t("enable-filter", { filter: t("new") })}
71
- onClick={() => setTreeFilter("new", !isNew)}
72
- leadingIcon={allureIcons.lineAlertsNotificationBox}
73
- rightSlot={
74
- <div className={styles.filterToggle}>
75
- <Toggle
76
- focusable={false}
77
- value={isNew}
78
- label={t("enable-filter", { filter: t("new") })}
79
- data-testid="new-filter"
80
- onChange={(value) => setTreeFilter("new", value)}
81
- />
82
- </div>
83
- }
84
- >
85
- {t("new")}
86
- </Menu.Item>
67
+ {MENU_KEYS.map((key: TreeFilters) => renderFilterItem(key, treeFiltersStore.value.filter[key]))}
87
68
  </Menu.Section>
88
69
  </Menu>
89
70
  );
@@ -12,7 +12,7 @@ export interface MetadataSummaryProps {
12
12
  stats: Statistic;
13
13
  }
14
14
 
15
- const metadataTestsTypes = ["flaky", "retries"] as const as (keyof Statistic)[];
15
+ const metadataTestsTypes = ["flaky", "new", "retries"] as const as (keyof Statistic)[];
16
16
 
17
17
  export const MetadataSummary: FunctionalComponent<MetadataSummaryProps> = ({ stats }) => {
18
18
  const { t } = useI18n("statuses");
@@ -6,16 +6,14 @@ import * as styles from "./styles.scss";
6
6
  const icons: Record<string, string> = {
7
7
  flaky: allureIcons.lineIconBomb2,
8
8
  retries: allureIcons.lineArrowsRefreshCcw1,
9
- new: allureIcons.lineAlertsNotificationBox,
9
+ new: allureIcons.lineAlertsNew,
10
10
  };
11
11
 
12
- export const MetadataWithIcon: FunctionComponent<MetadataProps> = ({ type, count }) => {
13
- return (
14
- <div data-testid="metadata-value" className={styles["metadata-with-icon"]}>
15
- {type !== "all" && <SvgIcon className={styles["metadata-icon"]} id={icons[type]} size={"s"} />}
16
- <Text size={"m"} bold>
17
- {count}
18
- </Text>
19
- </div>
20
- );
21
- };
12
+ export const MetadataWithIcon: FunctionComponent<MetadataProps> = ({ type, count }) => (
13
+ <div data-testid="metadata-value" className={styles["metadata-with-icon"]}>
14
+ {type !== "all" && <SvgIcon className={styles["metadata-icon"]} id={icons[type]} size={"s"} />}
15
+ <Text size={"m"} bold>
16
+ {count}
17
+ </Text>
18
+ </div>
19
+ );
@@ -18,7 +18,7 @@ export const TrDescription: FunctionalComponent<TrDescriptionProps> = ({ descrip
18
18
  <MetadataButton title={"Description"} setIsOpen={setIsOpen} isOpened={isOpen} />
19
19
  {isOpen && (
20
20
  <Text tag={"p"} className={styles["test-result-description-text"]}>
21
- {description || "Description mock"}
21
+ {description}
22
22
  </Text>
23
23
  )}
24
24
  </div>
@@ -2,7 +2,6 @@ import { Button, Code, CodeViewer } from "@allurereport/web-components";
2
2
  import type { BaseOptions, Change } from "diff";
3
3
  import { diffChars, diffLines, diffWords } from "diff";
4
4
  import { useState } from "preact/hooks";
5
- import { ac } from "vitest/dist/chunks/reporters.D7Jzd9GS";
6
5
  import * as styles from "@/components/TestResult/TrError/styles.scss";
7
6
  import { useI18n } from "@/stores";
8
7
 
@@ -1,59 +1,88 @@
1
1
  import { type HistoryTestResult, formatDuration } from "@allurereport/core-api";
2
+ import { getReportOptions } from "@allurereport/web-commons";
2
3
  import { ArrowButton, IconButton, Text, TooltipWrapper, TreeItemIcon, allureIcons } from "@allurereport/web-components";
3
4
  import { type FunctionalComponent } from "preact";
4
- import { useState } from "preact/hooks";
5
+ import { useMemo, useState } from "preact/hooks";
6
+ import type { AwesomeReportOptions } from "types";
5
7
  import { TrError } from "@/components/TestResult/TrError";
6
8
  import * as styles from "@/components/TestResult/TrHistory/styles.scss";
7
9
  import { useI18n } from "@/stores";
8
- import { navigateTo, openInNewTab } from "@/stores/router";
9
10
  import { timestampToDate } from "@/utils/time";
10
11
 
11
12
  export const TrHistoryItem: FunctionalComponent<{
12
13
  testResultItem: HistoryTestResult;
13
14
  }> = ({ testResultItem }: { testResultItem: HistoryTestResult }) => {
14
- const { status, error, stop, duration, id } = testResultItem;
15
+ const reportOptions = getReportOptions<AwesomeReportOptions & { id: string }>();
16
+ const { status, error, stop, duration, id, url } = testResultItem;
15
17
  const [isOpened, setIsOpen] = useState(false);
16
- const convertedStop = timestampToDate(stop);
17
- const formattedDuration = formatDuration(duration as number);
18
+ const convertedStop = stop ? timestampToDate(stop) : undefined;
19
+ const formattedDuration = duration ? formatDuration(duration) : undefined;
18
20
  const { t } = useI18n("controls");
21
+ const navigateUrl = useMemo(() => {
22
+ if (!url) {
23
+ return undefined;
24
+ }
19
25
 
20
- const navigateUrl = id;
26
+ const { origin, pathname } = new URL(url);
27
+ const navUrl = new URL([pathname, reportOptions.id].join("/"), origin);
21
28
 
22
- return (
23
- <div>
24
- <div className={styles["test-result-history-item-header"]}>
25
- {Boolean(error) && (
26
- <span onClick={() => setIsOpen(!isOpened)}>
27
- <ArrowButton isOpened={isOpened} icon={allureIcons.arrowsChevronDown} />
28
- </span>
29
- )}
30
- <div
31
- className={styles["test-result-history-item-wrap"]}
29
+ navUrl.hash = id;
30
+
31
+ return navUrl.toString();
32
+ }, [reportOptions, id, url]);
33
+ const renderExternalLink = () => {
34
+ if (!navigateUrl) {
35
+ return null;
36
+ }
37
+
38
+ return (
39
+ <TooltipWrapper tooltipText={t("openInNewTab")}>
40
+ <IconButton
41
+ href={navigateUrl.toString()}
42
+ target={"_blank"}
43
+ icon={allureIcons.lineGeneralLinkExternal}
44
+ style={"ghost"}
45
+ size={"s"}
46
+ className={styles["test-result-history-item-link"]}
32
47
  onClick={(e) => {
33
48
  e.stopPropagation();
34
- navigateTo(navigateUrl);
35
49
  }}
36
- >
37
- <TreeItemIcon status={status} className={styles["test-result-history-item-status"]} />
38
- <Text className={styles["test-result-history-item-text"]}>{convertedStop}</Text>
39
- <div className={styles["test-result-history-item-info"]}>
50
+ />
51
+ </TooltipWrapper>
52
+ );
53
+ };
54
+ const renderItemContent = () => {
55
+ return (
56
+ <>
57
+ <TreeItemIcon status={status} className={styles["test-result-history-item-status"]} />
58
+ {convertedStop && <Text className={styles["test-result-history-item-text"]}>{convertedStop}</Text>}
59
+ <div className={styles["test-result-history-item-info"]}>
60
+ {formattedDuration && (
40
61
  <Text type="ui" size={"s"} className={styles["item-time"]}>
41
62
  {formattedDuration}
42
63
  </Text>
43
- <TooltipWrapper tooltipText={t("openInNewTab")}>
44
- <IconButton
45
- icon={allureIcons.lineGeneralLinkExternal}
46
- style={"ghost"}
47
- size={"s"}
48
- className={styles["test-result-history-item-link"]}
49
- onClick={(e) => {
50
- e.stopPropagation();
51
- openInNewTab(navigateUrl);
52
- }}
53
- />
54
- </TooltipWrapper>
55
- </div>
64
+ )}
65
+ {renderExternalLink()}
56
66
  </div>
67
+ </>
68
+ );
69
+ };
70
+
71
+ return (
72
+ <div data-testid={"test-result-history-item"}>
73
+ <div className={styles["test-result-history-item-header"]}>
74
+ {Boolean(error) && (
75
+ <span onClick={() => setIsOpen(!isOpened)}>
76
+ <ArrowButton isOpened={isOpened} icon={allureIcons.arrowsChevronDown} />
77
+ </span>
78
+ )}
79
+ {navigateUrl ? (
80
+ <a href={navigateUrl} className={styles["test-result-history-item-wrap"]}>
81
+ {renderItemContent()}
82
+ </a>
83
+ ) : (
84
+ <div className={styles["test-result-history-item-wrap"]}>{renderItemContent()}</div>
85
+ )}
57
86
  </div>
58
87
  {isOpened && error && (
59
88
  <div>
@@ -8,7 +8,6 @@
8
8
  width: 100%;
9
9
  gap: 4px;
10
10
  align-items: center;
11
- cursor: pointer;
12
11
  }
13
12
 
14
13
  .test-result-history-item-wrap {
@@ -20,6 +19,8 @@
20
19
  padding: 4px 4px 4px 4px;
21
20
  width: 100%;
22
21
  align-items: flex-start;
22
+ text-decoration: none;
23
+ color: var(--on-text-primary);
23
24
 
24
25
  &:hover {
25
26
  background: var(--bg-control-flat-medium);
@@ -1,4 +1,4 @@
1
- import { SvgIcon, allureIcons } from "@allurereport/web-components";
1
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
2
  import { type FunctionalComponent } from "preact";
3
3
  import { useI18n } from "@/stores";
4
4
  import { capitalize } from "@/utils/capitalize";
@@ -21,7 +21,9 @@ export const TrInfoStatuses: FunctionalComponent<{ statuses: [string, boolean][]
21
21
  return (
22
22
  <div key={key} className={styles["test-result-info-status"]}>
23
23
  <SvgIcon className={styles["metadata-icon"]} id={icons[status]} size={"s"} />
24
- {capitalize(title)}
24
+ <Text type={"ui"} size={"s"}>
25
+ {capitalize(title)}
26
+ </Text>
25
27
  </div>
26
28
  );
27
29
  })}
@@ -1,4 +1,3 @@
1
- import type { TestStatus } from "@allurereport/core-api";
2
1
  import type { FunctionalComponent } from "preact";
3
2
  import type { AwesomeTestResult } from "types";
4
3
  import * as styles from "@/components/BaseLayout/styles.scss";