@allurereport/web-awesome 3.0.0-beta.8 → 3.0.0

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 (282) hide show
  1. package/dist/multi/173.app-9931797d1602fc52db5b.js +1 -0
  2. package/dist/multi/174.app-9931797d1602fc52db5b.js +1 -0
  3. package/dist/multi/252.app-9931797d1602fc52db5b.js +1 -0
  4. package/dist/multi/282.app-9931797d1602fc52db5b.js +1 -0
  5. package/dist/multi/29.app-9931797d1602fc52db5b.js +1 -0
  6. package/dist/multi/416.app-9931797d1602fc52db5b.js +1 -0
  7. package/dist/multi/527.app-9931797d1602fc52db5b.js +1 -0
  8. package/dist/multi/600.app-9931797d1602fc52db5b.js +1 -0
  9. package/dist/multi/605.app-9931797d1602fc52db5b.js +1 -0
  10. package/dist/multi/638.app-9931797d1602fc52db5b.js +1 -0
  11. package/dist/multi/672.app-9931797d1602fc52db5b.js +1 -0
  12. package/dist/multi/686.app-9931797d1602fc52db5b.js +1 -0
  13. package/dist/multi/725.app-9931797d1602fc52db5b.js +1 -0
  14. package/dist/multi/741.app-9931797d1602fc52db5b.js +1 -0
  15. package/dist/multi/755.app-9931797d1602fc52db5b.js +1 -0
  16. package/dist/multi/894.app-9931797d1602fc52db5b.js +1 -0
  17. package/dist/multi/91.app-9931797d1602fc52db5b.js +1 -0
  18. package/dist/multi/943.app-9931797d1602fc52db5b.js +1 -0
  19. package/dist/multi/980.app-9931797d1602fc52db5b.js +1 -0
  20. package/dist/multi/app-9931797d1602fc52db5b.js +2 -0
  21. package/dist/multi/app-9931797d1602fc52db5b.js.LICENSE.txt +10 -0
  22. package/dist/multi/manifest.json +25 -24
  23. package/dist/multi/styles-8fe37354d1c2270c691e.css +48 -0
  24. package/dist/single/app-6199dc1c2fd3bddc2526.js +2 -0
  25. package/dist/single/app-6199dc1c2fd3bddc2526.js.LICENSE.txt +10 -0
  26. package/dist/single/manifest.json +1 -1
  27. package/package.json +30 -17
  28. package/src/assets/scss/day.scss +2 -0
  29. package/src/assets/scss/index.scss +1 -3
  30. package/src/assets/scss/night.scss +2 -0
  31. package/src/assets/scss/palette.scss +391 -391
  32. package/src/assets/scss/theme.scss +292 -79
  33. package/src/components/BaseLayout/index.tsx +10 -31
  34. package/src/components/BaseLayout/styles.scss +14 -4
  35. package/src/components/Charts/index.tsx +245 -0
  36. package/src/components/Charts/styles.scss +27 -0
  37. package/src/components/EnvironmentPicker/index.tsx +60 -0
  38. package/src/components/EnvironmentPicker/styles.scss +9 -0
  39. package/src/components/Footer/FooterLogo.tsx +1 -2
  40. package/src/components/Footer/FooterVersion.tsx +7 -3
  41. package/src/components/Footer/index.tsx +6 -2
  42. package/src/components/Header/CiInfo/index.tsx +67 -0
  43. package/src/components/Header/CiInfo/styles.scss +7 -0
  44. package/src/components/Header/index.tsx +21 -8
  45. package/src/components/Header/styles.scss +9 -1
  46. package/src/components/HeaderControls/index.tsx +20 -0
  47. package/src/components/MainReport/index.tsx +84 -6
  48. package/src/components/MainReport/styles.scss +20 -0
  49. package/src/components/Metadata/index.tsx +6 -4
  50. package/src/components/MetadataButton/index.tsx +14 -6
  51. package/src/components/MetadataButton/styles.scss +3 -0
  52. package/src/components/Modal/index.tsx +15 -167
  53. package/src/components/NavTabs/index.tsx +70 -0
  54. package/src/components/{TestResult/TestResultTabs → NavTabs}/styles.scss +0 -3
  55. package/src/components/Report/index.tsx +7 -0
  56. package/src/components/ReportBody/Filters.tsx +45 -66
  57. package/src/components/ReportBody/index.tsx +29 -17
  58. package/src/components/ReportBody/styles.scss +9 -3
  59. package/src/components/ReportGlobalAttachments/index.tsx +34 -0
  60. package/src/components/ReportGlobalAttachments/styles.scss +11 -0
  61. package/src/components/ReportGlobalErrors/index.tsx +30 -0
  62. package/src/components/ReportGlobalErrors/styles.scss +12 -0
  63. package/src/components/ReportHeader/ReportHeaderLogo.tsx +6 -2
  64. package/src/components/ReportHeader/ReportHeaderPie.tsx +1 -2
  65. package/src/components/ReportHeader/index.tsx +38 -12
  66. package/src/components/ReportHeader/styles.scss +9 -1
  67. package/src/components/ReportMetadata/MetadataSummary.tsx +57 -65
  68. package/src/components/ReportMetadata/MetadataWithIcon.tsx +11 -13
  69. package/src/components/ReportMetadata/index.tsx +50 -3
  70. package/src/components/ReportMetadata/styles.scss +0 -2
  71. package/src/components/ReportQualityGateResults/index.tsx +42 -0
  72. package/src/components/ReportQualityGateResults/styles.scss +44 -0
  73. package/src/components/SectionPicker/index.tsx +55 -0
  74. package/src/components/SectionPicker/styles.scss +5 -0
  75. package/src/components/SectionSwitcher/index.tsx +16 -0
  76. package/src/components/SectionSwitcher/styles.scss +4 -0
  77. package/src/components/SectionTabs/index.tsx +0 -0
  78. package/src/components/SideBySide/index.tsx +52 -0
  79. package/src/components/SideBySide/styles.scss +64 -0
  80. package/src/components/SplitLayout/index.tsx +73 -0
  81. package/src/components/SplitLayout/styles.scss +84 -0
  82. package/src/components/Tabs/index.tsx +5 -0
  83. package/src/components/TestResult/TestStepsEmpty/index.tsx +23 -0
  84. package/src/components/TestResult/TestStepsEmpty/styles.scss +25 -0
  85. package/src/components/TestResult/TrAttachmentsView/index.tsx +29 -0
  86. package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +5 -5
  87. package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +7 -5
  88. package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +10 -9
  89. package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
  90. package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
  91. package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
  92. package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
  93. package/src/components/TestResult/TrError/TrDiff.tsx +121 -0
  94. package/src/components/TestResult/TrError/index.tsx +104 -0
  95. package/src/components/TestResult/TrError/styles.scss +223 -0
  96. package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +44 -0
  97. package/src/components/TestResult/TrHeader/index.tsx +15 -0
  98. package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +7 -2
  99. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +94 -0
  100. package/src/components/TestResult/TrHistory/index.tsx +26 -0
  101. package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +2 -1
  102. package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +6 -4
  103. package/src/components/TestResult/TrInfo/index.tsx +99 -0
  104. package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +18 -0
  105. package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +8 -8
  106. package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +6 -6
  107. package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +7 -9
  108. package/src/components/TestResult/TrOverview.tsx +46 -0
  109. package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +4 -4
  110. package/src/components/TestResult/TrPrevStatuses/index.tsx +63 -0
  111. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
  112. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +32 -0
  113. package/src/components/TestResult/TrPwTraces/index.tsx +32 -0
  114. package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
  115. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +70 -0
  116. package/src/components/TestResult/TrRetriesView/index.tsx +29 -0
  117. package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +24 -15
  118. package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +2 -2
  119. package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +5 -5
  120. package/src/components/TestResult/TrSteps/TrAttachment.tsx +118 -0
  121. package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +11 -11
  122. package/src/components/TestResult/TrSteps/TrStep.tsx +98 -0
  123. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +90 -0
  124. package/src/components/TestResult/TrSteps/index.tsx +58 -0
  125. package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +49 -10
  126. package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
  127. package/src/components/TestResult/TrTabs/index.tsx +42 -0
  128. package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +25 -15
  129. package/src/components/TestResult/index.tsx +54 -38
  130. package/src/components/TestResult/styles.scss +12 -0
  131. package/src/components/Timeline/index.tsx +100 -0
  132. package/src/components/Timeline/styles.scss +45 -0
  133. package/src/components/ToggleLayout/index.tsx +17 -0
  134. package/src/components/Tree/index.tsx +122 -16
  135. package/src/components/Tree/styles.scss +23 -5
  136. package/src/index.html +23 -6
  137. package/src/index.tsx +91 -20
  138. package/src/locales/az.json +376 -0
  139. package/src/locales/de.json +376 -0
  140. package/src/locales/en.json +376 -0
  141. package/src/locales/es.json +376 -0
  142. package/src/locales/fr.json +376 -0
  143. package/src/locales/he.json +376 -0
  144. package/src/locales/hy.json +376 -0
  145. package/src/locales/it.json +376 -0
  146. package/src/locales/ja.json +376 -0
  147. package/src/locales/ka.json +376 -0
  148. package/src/locales/kr.json +376 -0
  149. package/src/locales/nl.json +376 -0
  150. package/src/locales/pl.json +384 -0
  151. package/src/locales/pt.json +376 -0
  152. package/src/locales/ru.json +384 -0
  153. package/src/locales/sv.json +376 -0
  154. package/src/locales/tr.json +376 -0
  155. package/src/locales/ua.json +327 -0
  156. package/src/locales/zh.json +376 -0
  157. package/src/stores/chart.ts +41 -6
  158. package/src/stores/env.ts +88 -0
  159. package/src/stores/envInfo.ts +2 -2
  160. package/src/stores/globals.ts +28 -0
  161. package/src/stores/layout.ts +36 -0
  162. package/src/stores/locale.ts +77 -29
  163. package/src/stores/modal.ts +22 -0
  164. package/src/stores/qualityGate.ts +28 -0
  165. package/src/stores/router.ts +108 -0
  166. package/src/stores/sections.ts +63 -0
  167. package/src/stores/stats.ts +52 -7
  168. package/src/stores/testResults.ts +13 -9
  169. package/src/stores/theme.ts +15 -18
  170. package/src/stores/timeline.ts +39 -0
  171. package/src/stores/tree.ts +101 -31
  172. package/src/stores/variables.ts +40 -0
  173. package/src/styles.scss +66 -0
  174. package/src/utils/loadFromLocalStorage.ts +8 -0
  175. package/src/utils/time.ts +1 -0
  176. package/src/utils/tree.ts +23 -0
  177. package/src/utils/treeFilters.ts +27 -21
  178. package/test/components/Header/CiInfo.test.tsx +177 -0
  179. package/test/components/Header.test.tsx +122 -0
  180. package/test/utils/treeFilters.test.ts +44 -44
  181. package/tsconfig.json +7 -2
  182. package/tsconfig.node.json +8 -0
  183. package/types.d.ts +53 -21
  184. package/vitest.config.ts +15 -2
  185. package/vitest.setup.ts +1 -0
  186. package/webpack.config.js +37 -5
  187. package/dist/multi/141.app-4375537b.js +0 -1
  188. package/dist/multi/222.app-4375537b.js +0 -1
  189. package/dist/multi/335.app-4375537b.js +0 -1
  190. package/dist/multi/34.app-4375537b.js +0 -1
  191. package/dist/multi/349.app-4375537b.js +0 -1
  192. package/dist/multi/378.app-4375537b.js +0 -1
  193. package/dist/multi/406.app-4375537b.js +0 -1
  194. package/dist/multi/476.app-4375537b.js +0 -1
  195. package/dist/multi/53.app-4375537b.js +0 -1
  196. package/dist/multi/584.app-4375537b.js +0 -1
  197. package/dist/multi/690.app-4375537b.js +0 -1
  198. package/dist/multi/747.app-4375537b.js +0 -1
  199. package/dist/multi/767.app-4375537b.js +0 -1
  200. package/dist/multi/816.app-4375537b.js +0 -1
  201. package/dist/multi/83.app-4375537b.js +0 -1
  202. package/dist/multi/873.app-4375537b.js +0 -1
  203. package/dist/multi/920.app-4375537b.js +0 -1
  204. package/dist/multi/991.app-4375537b.js +0 -1
  205. package/dist/multi/app-4375537b.js +0 -2
  206. package/dist/multi/app-4375537b.js.LICENSE.txt +0 -16
  207. package/dist/multi/styles-4375537b.css +0 -283
  208. package/dist/single/app-f16f6693.js +0 -2
  209. package/dist/single/app-f16f6693.js.LICENSE.txt +0 -16
  210. package/src/assets/scss/code.scss +0 -71
  211. package/src/assets/scss/typography.scss +0 -218
  212. package/src/components/ArrowButton/index.tsx +0 -36
  213. package/src/components/ArrowButton/styles.scss +0 -35
  214. package/src/components/LanguagePicker/index.tsx +0 -40
  215. package/src/components/Modal/styles.scss +0 -126
  216. package/src/components/ReportLogo/index.tsx +0 -16
  217. package/src/components/ReportLogo/styles.scss +0 -20
  218. package/src/components/ReportLogoFull/index.tsx +0 -20
  219. package/src/components/ReportLogoFull/styles.scss +0 -7
  220. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +0 -27
  221. package/src/components/TestResult/TestResultError/index.tsx +0 -59
  222. package/src/components/TestResult/TestResultError/styles.scss +0 -51
  223. package/src/components/TestResult/TestResultHeader/index.tsx +0 -55
  224. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +0 -67
  225. package/src/components/TestResult/TestResultHistory/index.tsx +0 -26
  226. package/src/components/TestResult/TestResultInfo/index.tsx +0 -79
  227. package/src/components/TestResult/TestResultOverview.tsx +0 -40
  228. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +0 -49
  229. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -52
  230. package/src/components/TestResult/TestResultRetriesView/index.tsx +0 -24
  231. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +0 -12
  232. package/src/components/TestResult/TestResultSteps/attachment.tsx +0 -68
  233. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +0 -20
  234. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +0 -32
  235. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +0 -15
  236. package/src/components/TestResult/TestResultSteps/index.tsx +0 -49
  237. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +0 -77
  238. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +0 -78
  239. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -30
  240. package/src/components/TestResult/TestResultTabs/index.tsx +0 -59
  241. package/src/components/ThemeButton/ThemeButton.tsx +0 -20
  242. package/src/components/Tree/Tree.tsx +0 -68
  243. package/src/components/Tree/TreeHeader.tsx +0 -82
  244. package/src/components/Tree/TreeItem.tsx +0 -35
  245. package/src/components/Tree/TreeItemIcon.tsx +0 -32
  246. package/src/i18n/constants.ts +0 -124
  247. package/src/i18n/locales/am.json +0 -118
  248. package/src/i18n/locales/az.json +0 -118
  249. package/src/i18n/locales/de.json +0 -118
  250. package/src/i18n/locales/en.json +0 -119
  251. package/src/i18n/locales/es.json +0 -118
  252. package/src/i18n/locales/fr.json +0 -118
  253. package/src/i18n/locales/he.json +0 -118
  254. package/src/i18n/locales/it.json +0 -118
  255. package/src/i18n/locales/ja.json +0 -118
  256. package/src/i18n/locales/ka.json +0 -118
  257. package/src/i18n/locales/kr.json +0 -118
  258. package/src/i18n/locales/nl.json +0 -118
  259. package/src/i18n/locales/pl.json +0 -116
  260. package/src/i18n/locales/pt.json +0 -118
  261. package/src/i18n/locales/ru.json +0 -116
  262. package/src/i18n/locales/sv.json +0 -118
  263. package/src/i18n/locales/tr.json +0 -118
  264. package/src/i18n/locales/zh.json +0 -118
  265. package/src/utils/attachments.ts +0 -156
  266. package/src/utils/capitalize.ts +0 -6
  267. /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
  268. /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
  269. /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
  270. /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
  271. /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
  272. /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
  273. /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
  274. /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
  275. /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
  276. /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
  277. /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
  278. /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
  279. /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
  280. /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
  281. /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
  282. /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
@@ -0,0 +1,245 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
2
+ import { ChartType } from "@allurereport/charts-api";
3
+ import { type UIChartData } from "@allurereport/web-commons";
4
+ import {
5
+ CurrentStatusChartWidget,
6
+ DurationDynamicsChartWidget,
7
+ DurationsChartWidget,
8
+ FBSUAgePyramidChartWidget,
9
+ Grid,
10
+ GridItem,
11
+ HeatMapWidget,
12
+ Loadable,
13
+ PageLoader,
14
+ StabilityDistributionWidget,
15
+ StatusDynamicsChartWidget,
16
+ StatusTransitionsChartWidget,
17
+ TestBaseGrowthDynamicsChartWidget,
18
+ TestingPyramidWidget,
19
+ ThemeProvider,
20
+ TrSeveritiesChartWidget,
21
+ TreeMapChartWidget,
22
+ } from "@allurereport/web-components";
23
+ import { useEffect } from "preact/hooks";
24
+ import { themeStore } from "@/stores";
25
+ import { chartsStore, fetchChartsData } from "@/stores/chart";
26
+ import { currentEnvironment } from "@/stores/env";
27
+ import { useI18n } from "@/stores/locale";
28
+ import * as styles from "./styles.scss";
29
+
30
+ const getChartWidgetByType = (
31
+ chartData: UIChartData,
32
+ { t, empty }: Record<string, (key: string, options?: any) => string>,
33
+ ) => {
34
+ switch (chartData.type) {
35
+ case ChartType.CurrentStatus: {
36
+ const title = chartData.title ?? t("currentStatus.title");
37
+
38
+ return (
39
+ <CurrentStatusChartWidget
40
+ title={title}
41
+ data={chartData.data}
42
+ statuses={chartData.statuses}
43
+ metric={chartData.metric}
44
+ i18n={(key, props = {}) => t(`currentStatus.${key}`, props)}
45
+ />
46
+ );
47
+ }
48
+ case ChartType.StatusDynamics: {
49
+ const title = chartData.title ?? t("statusDynamics.title");
50
+
51
+ return (
52
+ <StatusDynamicsChartWidget
53
+ title={title}
54
+ data={chartData.data}
55
+ limit={chartData.limit}
56
+ statuses={chartData.statuses}
57
+ i18n={(key, props = {}) => t(`statusDynamics.${key}`, props)}
58
+ />
59
+ );
60
+ }
61
+ case ChartType.StatusTransitions: {
62
+ const title = chartData.title ?? t("statusTransitions.title");
63
+
64
+ return (
65
+ <StatusTransitionsChartWidget
66
+ title={title}
67
+ data={chartData.data}
68
+ i18n={(key, props = {}) => t(`statusTransitions.${key}`, props)}
69
+ />
70
+ );
71
+ }
72
+ case ChartType.Durations: {
73
+ const title =
74
+ chartData.title ??
75
+ (chartData.groupBy === "none"
76
+ ? t("durations.title_none")
77
+ : t("durations.title", { groupBy: chartData.groupBy }));
78
+
79
+ return (
80
+ <DurationsChartWidget
81
+ title={title}
82
+ data={chartData.data}
83
+ groupBy={chartData.groupBy}
84
+ keys={chartData.keys}
85
+ i18n={(key, props = {}) => t(`durations.${key}`, props)}
86
+ />
87
+ );
88
+ }
89
+ case ChartType.StabilityDistribution: {
90
+ const title = chartData.title ?? t("stabilityDistribution.title");
91
+
92
+ return (
93
+ <StabilityDistributionWidget
94
+ title={title}
95
+ data={chartData.data}
96
+ keys={chartData.keys}
97
+ i18n={(key, props = {}) => t(`stabilityDistribution.${key}`, props)}
98
+ />
99
+ );
100
+ }
101
+ case ChartType.TestBaseGrowthDynamics: {
102
+ const title = chartData.title ?? t("testBaseGrowthDynamics.title");
103
+
104
+ return (
105
+ <TestBaseGrowthDynamicsChartWidget
106
+ title={title}
107
+ data={chartData.data}
108
+ statuses={chartData.statuses}
109
+ i18n={(key, props = {}) => t(`testBaseGrowthDynamics.${key}`, props)}
110
+ />
111
+ );
112
+ }
113
+ case ChartType.FBSUAgePyramid: {
114
+ const title = chartData.title ?? t("fbsuAgePyramid.title");
115
+
116
+ return (
117
+ <FBSUAgePyramidChartWidget
118
+ title={title}
119
+ data={chartData.data}
120
+ statuses={chartData.statuses}
121
+ i18n={(key, props = {}) => t(`fbsuAgePyramid.${key}`, props)}
122
+ />
123
+ );
124
+ }
125
+ case ChartType.TrSeverities: {
126
+ const title = chartData.title ?? t("trSeverities.title");
127
+
128
+ return (
129
+ <TrSeveritiesChartWidget
130
+ title={title}
131
+ data={chartData.data}
132
+ levels={chartData.levels}
133
+ statuses={chartData.statuses}
134
+ i18n={(key, props = {}) => t(`trSeverities.${key}`, props)}
135
+ />
136
+ );
137
+ }
138
+ case ChartType.DurationDynamics: {
139
+ const title = chartData.title ?? t("durationDynamics.title");
140
+
141
+ return (
142
+ <DurationDynamicsChartWidget
143
+ title={title}
144
+ data={chartData.data}
145
+ i18n={(key, props = {}) => t(`durationDynamics.${key}`, props)}
146
+ />
147
+ );
148
+ }
149
+ case ChartType.CoverageDiff: {
150
+ return (
151
+ <TreeMapChartWidget
152
+ data={chartData.treeMap}
153
+ chartType={ChartType.CoverageDiff}
154
+ title={chartData.title}
155
+ formatLegend={chartData.formatLegend}
156
+ colors={chartData.colors}
157
+ legendDomain={chartData.legendDomain}
158
+ tooltipRows={chartData.tooltipRows}
159
+ translations={{ "no-results": empty("no-results") }}
160
+ />
161
+ );
162
+ }
163
+
164
+ case ChartType.SuccessRateDistribution: {
165
+ return (
166
+ <TreeMapChartWidget
167
+ chartType={ChartType.SuccessRateDistribution}
168
+ data={chartData.treeMap}
169
+ title={chartData.title}
170
+ formatLegend={chartData.formatLegend}
171
+ colors={chartData.colors}
172
+ legendDomain={chartData.legendDomain}
173
+ tooltipRows={chartData.tooltipRows}
174
+ translations={{ "no-results": empty("no-results") }}
175
+ />
176
+ );
177
+ }
178
+ case ChartType.ProblemsDistribution: {
179
+ return (
180
+ <HeatMapWidget
181
+ title={chartData.title}
182
+ data={chartData.data}
183
+ translations={{ "no-results": empty("no-results") }}
184
+ />
185
+ );
186
+ }
187
+ case ChartType.TestingPyramid: {
188
+ const isDataEmpty = !chartData.data.some((item) => item.testCount > 0);
189
+
190
+ return (
191
+ <TestingPyramidWidget
192
+ title={chartData.title}
193
+ data={isDataEmpty ? [] : chartData.data}
194
+ translations={{ "no-results": empty("no-results") }}
195
+ />
196
+ );
197
+ }
198
+ default: {
199
+ return null;
200
+ }
201
+ }
202
+ };
203
+
204
+ export const Charts = () => {
205
+ const { t } = useI18n("charts");
206
+ const { t: empty } = useI18n("empty");
207
+
208
+ useEffect(() => {
209
+ fetchChartsData();
210
+ }, []);
211
+
212
+ return (
213
+ <ThemeProvider theme={themeStore.value}>
214
+ <Loadable
215
+ source={chartsStore}
216
+ renderLoader={() => <PageLoader />}
217
+ renderData={(data) => {
218
+ const currentChartsData = currentEnvironment.value ? data.byEnv[currentEnvironment.value] : data.general;
219
+
220
+ if (!currentChartsData) {
221
+ return null;
222
+ }
223
+
224
+ const charts = Object.entries(currentChartsData).map(([chartId, value]) => {
225
+ const chartWidget = getChartWidgetByType(value, { t, empty });
226
+
227
+ return (
228
+ <GridItem key={chartId} className={styles["overview-grid-item"]}>
229
+ {chartWidget}
230
+ </GridItem>
231
+ );
232
+ });
233
+
234
+ return (
235
+ <div className={styles.overview}>
236
+ <Grid kind="swap" className={styles["overview-grid"]}>
237
+ {charts}
238
+ </Grid>
239
+ </div>
240
+ );
241
+ }}
242
+ />
243
+ </ThemeProvider>
244
+ );
245
+ };
@@ -0,0 +1,27 @@
1
+ .overview {
2
+ padding: 0 24px;
3
+ width: 100%;
4
+ height: 100%;
5
+ overflow-y: auto;
6
+ overflow-x: hidden;
7
+ }
8
+
9
+ .overview-grid {
10
+ display: grid;
11
+ gap: 12px;
12
+ grid-template-columns: 1fr;
13
+
14
+ @media (min-width: 1024px) {
15
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(50% - 12px)), 1fr));
16
+ }
17
+ }
18
+
19
+ .overview-grid-item {
20
+ padding: 4px;
21
+ width: 100%;
22
+ box-shadow: var(--shadow-small);
23
+
24
+ & *[data-drop-shadow="true"] {
25
+ box-shadow: none;
26
+ }
27
+ }
@@ -0,0 +1,60 @@
1
+ import { DropdownButton, Menu, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import { useI18n } from "@/stores";
3
+ import { currentEnvironment, environmentsStore, setCurrentEnvironment } from "@/stores/env";
4
+ import * as styles from "./styles.scss";
5
+
6
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
7
+ export const EnvironmentPicker = () => {
8
+ const { t } = useI18n("environments");
9
+ const environment = currentEnvironment.value;
10
+ const handleSelect = (selectedOption: string) => {
11
+ setCurrentEnvironment(selectedOption);
12
+ };
13
+
14
+ // TODO: use props instead
15
+ if (environmentsStore.value.data.length <= 1) {
16
+ return null;
17
+ }
18
+
19
+ return (
20
+ <div className={styles["environment-picker"]} data-testid={"environment-picker"}>
21
+ <SvgIcon id={allureIcons.environment} size={"s"} />
22
+ <Text className={styles["environment-picker-label"]} type={"ui"} size={"s"} bold>
23
+ {t("environment", { count: 1 })}:
24
+ </Text>
25
+ <Menu
26
+ size="s"
27
+ menuTrigger={({ isOpened, onClick }) => (
28
+ <DropdownButton
29
+ style="ghost"
30
+ size="s"
31
+ text={environment || t("all")}
32
+ isExpanded={isOpened}
33
+ data-testid={"environment-picker-button"}
34
+ onClick={onClick}
35
+ />
36
+ )}
37
+ >
38
+ <Menu.Section>
39
+ <Menu.ItemWithCheckmark
40
+ data-testid={"environment-picker-item"}
41
+ onClick={() => handleSelect("")}
42
+ isChecked={!environment}
43
+ >
44
+ {t("all")}
45
+ </Menu.ItemWithCheckmark>
46
+ {environmentsStore.value.data.map((env) => (
47
+ <Menu.ItemWithCheckmark
48
+ data-testid={"environment-picker-item"}
49
+ onClick={() => handleSelect(env)}
50
+ key={env}
51
+ isChecked={env === environment}
52
+ >
53
+ {env}
54
+ </Menu.ItemWithCheckmark>
55
+ ))}
56
+ </Menu.Section>
57
+ </Menu>
58
+ </div>
59
+ );
60
+ };
@@ -0,0 +1,9 @@
1
+ .environment-picker {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 0 4px;
5
+ }
6
+
7
+ .environment-picker-label {
8
+ text-transform: capitalize;
9
+ }
@@ -1,5 +1,4 @@
1
- import { Text } from "@allurereport/web-components";
2
- import { ReportLogoFull } from "../ReportLogoFull";
1
+ import { ReportLogoFull, Text } from "@allurereport/web-components";
3
2
  import * as styles from "./styles.scss";
4
3
 
5
4
  export const FooterLogo = () => {
@@ -1,18 +1,22 @@
1
1
  import { getReportOptions } from "@allurereport/web-commons";
2
2
  import { Text } from "@allurereport/web-components";
3
3
  import { useEffect, useState } from "preact/hooks";
4
- import type { AllureAwesomeReportOptions } from "types";
4
+ import type { AwesomeReportOptions } from "types";
5
5
  import { currentLocaleIso } from "@/stores";
6
6
  import * as styles from "./styles.scss";
7
7
 
8
8
  export const FooterVersion = () => {
9
9
  const [createdAt, setCreatedAt] = useState<number | null>(null);
10
+ const [currentVersion, setCurrentVersion] = useState<string>();
10
11
 
11
12
  useEffect(() => {
12
- const reportOptions = getReportOptions<AllureAwesomeReportOptions>();
13
+ const reportOptions = getReportOptions<AwesomeReportOptions>();
13
14
  if (reportOptions?.createdAt) {
14
15
  setCreatedAt(Number(reportOptions.createdAt));
15
16
  }
17
+ if (reportOptions?.allureVersion) {
18
+ setCurrentVersion(reportOptions.allureVersion as string);
19
+ }
16
20
  }, []);
17
21
 
18
22
  const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
@@ -27,7 +31,7 @@ export const FooterVersion = () => {
27
31
  return (
28
32
  <Text type="paragraph" size="m" className={styles.version}>
29
33
  {formattedCreatedAt}
30
- <span> Ver: 3.0.0</span>
34
+ {currentVersion && <span> Ver: {currentVersion}</span>}
31
35
  </Text>
32
36
  );
33
37
  };
@@ -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
- export const Footer = () => {
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>
@@ -0,0 +1,67 @@
1
+ import { CiDescriptor, CiType } from "@allurereport/core-api";
2
+ import { getReportOptions } from "@allurereport/web-commons";
3
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
4
+ import type { ClassValue } from "clsx";
5
+ import clsx from "clsx";
6
+ import type { AwesomeReportOptions } from "../../../../types";
7
+ import * as styles from "./styles.scss";
8
+
9
+ interface CiInfoProps {
10
+ className?: ClassValue;
11
+ }
12
+
13
+ interface CiIconProps {
14
+ type: CiDescriptor["type"];
15
+ }
16
+
17
+ export const CiIcon = ({ type }: CiIconProps) => {
18
+ const iconCommonProps = {
19
+ width: 16,
20
+ height: 16,
21
+ };
22
+
23
+ switch (type) {
24
+ case CiType.Amazon:
25
+ return <SvgIcon id={allureIcons.amazon} {...iconCommonProps} />;
26
+ case CiType.Azure:
27
+ return <SvgIcon id={allureIcons.azure} {...iconCommonProps} />;
28
+ case CiType.Bitbucket:
29
+ return <SvgIcon id={allureIcons.bitbucket} {...iconCommonProps} />;
30
+ case CiType.Circle:
31
+ return <SvgIcon id={allureIcons.circleci} {...iconCommonProps} />;
32
+ case CiType.Drone:
33
+ return <SvgIcon id={allureIcons.drone} {...iconCommonProps} />;
34
+ case CiType.Github:
35
+ return <SvgIcon id={allureIcons.github} {...iconCommonProps} />;
36
+ case CiType.Gitlab:
37
+ return <SvgIcon id={allureIcons.gitlab} {...iconCommonProps} />;
38
+ case CiType.Jenkins:
39
+ return <SvgIcon id={allureIcons.jenkins} {...iconCommonProps} />;
40
+ default:
41
+ return null;
42
+ }
43
+ };
44
+
45
+ export const CiInfo = ({ className }: CiInfoProps) => {
46
+ const { ci } = getReportOptions<AwesomeReportOptions>();
47
+
48
+ if (!ci) {
49
+ return null;
50
+ }
51
+
52
+ const link = ci.pullRequestUrl || ci.jobRunUrl || ci.jobUrl;
53
+ const label = ci.pullRequestName || ci.jobRunName || ci.jobName || link;
54
+
55
+ if (!link) {
56
+ return null;
57
+ }
58
+
59
+ return (
60
+ <a className={clsx(styles["ci-info"], className)} href={link} target="_blank">
61
+ <CiIcon type={ci.type} />
62
+ <Text type={"paragraph"} size={"m"} bold>
63
+ {label}
64
+ </Text>
65
+ </a>
66
+ );
67
+ };
@@ -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,14 +1,27 @@
1
- import { LanguagePicker } from "@/components/LanguagePicker";
2
- import { ThemeButton } from "@/components/ThemeButton/ThemeButton";
1
+ import type { ClassValue } from "clsx";
2
+ import clsx from "clsx";
3
+ import { HeaderControls } from "@/components/HeaderControls";
4
+ import { SectionPicker } from "@/components/SectionPicker";
5
+ import { TrBreadcrumbs } from "@/components/TestResult/TrHeader/TrBreadcrumbs";
6
+ import { route } from "@/stores/router";
7
+ import { availableSections } from "@/stores/sections";
8
+ import { testResultStore } from "@/stores/testResults";
9
+ import { CiInfo } from "./CiInfo";
3
10
  import * as styles from "./styles.scss";
4
11
 
5
- export const Header = () => {
12
+ interface HeaderProps {
13
+ className?: ClassValue;
14
+ }
15
+
16
+ export const Header = ({ className }: HeaderProps) => {
17
+ const testResultId = route.value.params?.testResultId;
18
+
6
19
  return (
7
- <div className={styles.above}>
8
- <div className={styles.right}>
9
- <LanguagePicker />
10
- <ThemeButton />
11
- </div>
20
+ <div className={clsx(styles.above, className)}>
21
+ {Boolean(availableSections.value?.length) && <SectionPicker />}
22
+ {!testResultId && <CiInfo />}
23
+ {testResultId && <TrBreadcrumbs testResult={testResultStore.value?.data?.[testResultId]} />}
24
+ <HeaderControls className={styles.right} />
12
25
  </div>
13
26
  );
14
27
  };
@@ -5,6 +5,7 @@
5
5
  justify-content: space-between;
6
6
  align-items: center;
7
7
  gap: 12px;
8
+ padding: 8px 24px 12px;
8
9
  }
9
10
 
10
11
  .logoWrapper {
@@ -18,9 +19,16 @@
18
19
  top: -2px;
19
20
  }
20
21
 
22
+ .left {
23
+ margin-right: auto;
24
+ display: flex;
25
+ gap: 12px;
26
+ align-items: center;
27
+ }
28
+
21
29
  .right {
22
30
  margin-left: auto;
23
31
  display: flex;
24
- gap: 12px;
32
+ gap: 4px;
25
33
  align-items: center;
26
34
  }
@@ -0,0 +1,20 @@
1
+ import { LanguagePicker, ThemeButton } from "@allurereport/web-components";
2
+ import { EnvironmentPicker } from "@/components/EnvironmentPicker";
3
+ import ToggleLayout from "@/components/ToggleLayout";
4
+ import { currentLocale, setLocale } from "@/stores/locale";
5
+ import { getTheme, themeStore, toggleTheme } from "@/stores/theme";
6
+
7
+ interface HeaderControlsProps {
8
+ className?: string;
9
+ }
10
+
11
+ export const HeaderControls = ({ className }: HeaderControlsProps) => {
12
+ return (
13
+ <div className={className}>
14
+ <EnvironmentPicker />
15
+ <LanguagePicker locale={currentLocale.value} setLocale={setLocale} />
16
+ <ToggleLayout />
17
+ <ThemeButton theme={themeStore.value} toggleTheme={toggleTheme} getTheme={getTheme} />
18
+ </div>
19
+ );
20
+ };
@@ -1,17 +1,95 @@
1
- import * as styles from "@/components/BaseLayout/styles.scss";
2
- import { Header } from "@/components/Header";
1
+ import { Counter, Loadable } from "@allurereport/web-components";
2
+ import clsx from "clsx";
3
+ import { NavTab, NavTabs, NavTabsList, useNavTabsContext } from "@/components/NavTabs";
3
4
  import { ReportBody } from "@/components/ReportBody";
5
+ import { ReportGlobalAttachments } from "@/components/ReportGlobalAttachments";
6
+ import { ReportGlobalErrors } from "@/components/ReportGlobalErrors";
4
7
  import { ReportHeader } from "@/components/ReportHeader";
5
8
  import { ReportMetadata } from "@/components/ReportMetadata";
9
+ import { reportStatsStore } from "@/stores";
10
+ import { useI18n } from "@/stores";
11
+ import { globalsStore } from "@/stores/globals";
12
+ import { isSplitMode } from "@/stores/layout";
13
+ import { qualityGateStore } from "@/stores/qualityGate";
14
+ import { ReportQualityGateResults } from "../ReportQualityGateResults";
15
+ import * as styles from "./styles.scss";
16
+
17
+ enum ReportRootTab {
18
+ Results = "results",
19
+ QualityGate = "qualityGate",
20
+ GlobalAttachments = "globalAttachments",
21
+ GlobalErrors = "globalErrors",
22
+ }
23
+
24
+ const viewsByTab = {
25
+ [ReportRootTab.Results]: () => (
26
+ <>
27
+ <ReportMetadata />
28
+ <ReportBody />
29
+ </>
30
+ ),
31
+ [ReportRootTab.GlobalAttachments]: () => <ReportGlobalAttachments />,
32
+ [ReportRootTab.GlobalErrors]: () => <ReportGlobalErrors />,
33
+ [ReportRootTab.QualityGate]: () => <ReportQualityGateResults />,
34
+ };
35
+
36
+ const MainReportContent = () => {
37
+ const { currentTab } = useNavTabsContext();
38
+ const tab = (currentTab as ReportRootTab) || ReportRootTab.Results;
39
+ const Content = viewsByTab[tab];
40
+
41
+ return <Content />;
42
+ };
6
43
 
7
44
  const MainReport = () => {
45
+ const { t } = useI18n("tabs");
46
+
8
47
  return (
9
48
  <>
10
- <Header />
11
- <div className={styles.content}>
49
+ <div className={clsx(styles.content, isSplitMode.value ? styles["scroll-inside"] : "")}>
12
50
  <ReportHeader />
13
- <ReportMetadata />
14
- <ReportBody />
51
+ <div className={styles["main-report-tabs"]}>
52
+ <NavTabs initialTab={ReportRootTab.Results}>
53
+ <NavTabsList>
54
+ <Loadable
55
+ source={reportStatsStore}
56
+ renderData={(stats) => (
57
+ <NavTab id={ReportRootTab.Results}>
58
+ {t("results")} <Counter count={stats?.total ?? 0} />
59
+ </NavTab>
60
+ )}
61
+ />
62
+ <Loadable
63
+ source={qualityGateStore}
64
+ renderData={(results) => (
65
+ <>
66
+ <NavTab id={ReportRootTab.QualityGate}>
67
+ {t("qualityGates")}{" "}
68
+ <Counter status={results.length > 0 ? "failed" : undefined} count={results.length} />
69
+ </NavTab>
70
+ </>
71
+ )}
72
+ />
73
+ <Loadable
74
+ source={globalsStore}
75
+ renderData={({ attachments = [], errors = [] }) => (
76
+ <>
77
+ <NavTab id={ReportRootTab.GlobalAttachments}>
78
+ {t("globalAttachments")} <Counter count={attachments.length} />
79
+ </NavTab>
80
+ <NavTab id={ReportRootTab.GlobalErrors}>
81
+ {t("globalErrors")}{" "}
82
+ <Counter status={errors.length > 0 ? "failed" : undefined} count={errors.length} />
83
+ </NavTab>
84
+ </>
85
+ )}
86
+ />
87
+ </NavTabsList>
88
+ <div className={styles["main-report-tabs-content"]}>
89
+ <MainReportContent />
90
+ </div>
91
+ </NavTabs>
92
+ </div>
15
93
  </div>
16
94
  </>
17
95
  );
@@ -0,0 +1,20 @@
1
+ .content {
2
+ box-shadow: var(--shadow-small);
3
+ background: var(--bg-base-primary);
4
+ border-radius: 12px;
5
+ width: 100%;
6
+ }
7
+
8
+ .scroll-inside {
9
+ overflow: auto;
10
+ height: 100%;
11
+ border-radius: 0;
12
+ }
13
+
14
+ .main-report-tabs {
15
+ padding: 0 24px;
16
+ }
17
+
18
+ .main-report-tabs-content {
19
+ border-top: 1px solid var(--on-border-primary);
20
+ }