@allurereport/web-awesome 3.0.0-beta.9 → 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 (279) 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 +29 -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 -32
  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 -64
  57. package/src/components/ReportBody/index.tsx +26 -15
  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 +2 -2
  83. package/src/components/TestResult/TestStepsEmpty/index.tsx +2 -2
  84. package/src/components/TestResult/TrAttachmentsView/index.tsx +29 -0
  85. package/src/components/TestResult/{TestResultDescription → TrDescription}/index.tsx +5 -5
  86. package/src/components/TestResult/{TestResultDropdown → TrDropdown}/index.tsx +7 -5
  87. package/src/components/TestResult/{TestResultEmpty → TrEmpty}/index.tsx +6 -6
  88. package/src/components/TestResult/TrEnvironmentItem/index.tsx +82 -0
  89. package/src/components/TestResult/TrEnvironmentItem/styles.scss +60 -0
  90. package/src/components/TestResult/TrEnvironmentsView/index.tsx +64 -0
  91. package/src/components/TestResult/TrEnvironmentsView/styles.scss +11 -0
  92. package/src/components/TestResult/TrError/TrDiff.tsx +121 -0
  93. package/src/components/TestResult/TrError/index.tsx +104 -0
  94. package/src/components/TestResult/TrError/styles.scss +223 -0
  95. package/src/components/TestResult/TrHeader/TrBreadcrumbs.tsx +44 -0
  96. package/src/components/TestResult/TrHeader/index.tsx +15 -0
  97. package/src/components/TestResult/{TestResultHeader → TrHeader}/styles.scss +7 -2
  98. package/src/components/TestResult/TrHistory/TrHistoryItem.tsx +94 -0
  99. package/src/components/TestResult/TrHistory/index.tsx +26 -0
  100. package/src/components/TestResult/{TestResultHistory → TrHistory}/styles.scss +2 -1
  101. package/src/components/TestResult/{TestResultInfo/TestResultInfoStatuses.tsx → TrInfo/TrInfoStatuses.tsx} +6 -4
  102. package/src/components/TestResult/TrInfo/index.tsx +99 -0
  103. package/src/components/TestResult/{TestResultInfo → TrInfo}/styles.scss +18 -0
  104. package/src/components/TestResult/{TestResultLinks → TrLinks}/index.tsx +8 -8
  105. package/src/components/TestResult/{TestResultMetadata → TrMetadata}/index.tsx +6 -6
  106. package/src/components/TestResult/{TestResultNavigation → TrNavigation}/index.tsx +7 -9
  107. package/src/components/TestResult/TrOverview.tsx +46 -0
  108. package/src/components/TestResult/{TestResultParameters → TrParameters}/index.tsx +4 -4
  109. package/src/components/TestResult/TrPrevStatuses/index.tsx +63 -0
  110. package/src/components/TestResult/TrPwTraces/PwTrace.tsx +34 -0
  111. package/src/components/TestResult/TrPwTraces/PwTraceButton.tsx +32 -0
  112. package/src/components/TestResult/TrPwTraces/index.tsx +32 -0
  113. package/src/components/TestResult/TrPwTraces/styles.scss +20 -0
  114. package/src/components/TestResult/TrRetriesView/TrRetriesItem.tsx +70 -0
  115. package/src/components/TestResult/TrRetriesView/index.tsx +29 -0
  116. package/src/components/TestResult/{TestResultSetup → TrSetup}/index.tsx +13 -13
  117. package/src/components/TestResult/{TestResultSeverity → TrSeverity}/index.tsx +2 -2
  118. package/src/components/TestResult/{TestResultStatus → TrStatus}/index.tsx +5 -5
  119. package/src/components/TestResult/TrSteps/TrAttachment.tsx +118 -0
  120. package/src/components/TestResult/{TestResultSteps/testResultAttachmentInfo.tsx → TrSteps/TrAttachmentInfo.tsx} +11 -11
  121. package/src/components/TestResult/TrSteps/TrStep.tsx +98 -0
  122. package/src/components/TestResult/TrSteps/TrStepInfo.tsx +90 -0
  123. package/src/components/TestResult/{TestResultSteps → TrSteps}/index.tsx +12 -12
  124. package/src/components/TestResult/{TestResultSteps → TrSteps}/styles.scss +49 -10
  125. package/src/components/TestResult/{TestResultSteps → TrSteps}/wrongAttachment.tsx +1 -1
  126. package/src/components/TestResult/TrTabs/index.tsx +42 -0
  127. package/src/components/TestResult/{TestResultTeardown → TrTeardown}/index.tsx +13 -13
  128. package/src/components/TestResult/index.tsx +54 -38
  129. package/src/components/TestResult/styles.scss +12 -0
  130. package/src/components/Timeline/index.tsx +100 -0
  131. package/src/components/Timeline/styles.scss +45 -0
  132. package/src/components/ToggleLayout/index.tsx +17 -0
  133. package/src/components/Tree/index.tsx +123 -9
  134. package/src/components/Tree/styles.scss +23 -5
  135. package/src/index.html +22 -6
  136. package/src/index.tsx +91 -20
  137. package/src/locales/az.json +376 -0
  138. package/src/locales/de.json +376 -0
  139. package/src/locales/en.json +376 -0
  140. package/src/locales/es.json +376 -0
  141. package/src/locales/fr.json +376 -0
  142. package/src/locales/he.json +376 -0
  143. package/src/locales/hy.json +376 -0
  144. package/src/locales/it.json +376 -0
  145. package/src/locales/ja.json +376 -0
  146. package/src/locales/ka.json +376 -0
  147. package/src/locales/kr.json +376 -0
  148. package/src/locales/nl.json +376 -0
  149. package/src/locales/pl.json +384 -0
  150. package/src/locales/pt.json +376 -0
  151. package/src/locales/ru.json +384 -0
  152. package/src/locales/sv.json +376 -0
  153. package/src/locales/tr.json +376 -0
  154. package/src/locales/ua.json +327 -0
  155. package/src/locales/zh.json +376 -0
  156. package/src/stores/chart.ts +41 -6
  157. package/src/stores/env.ts +88 -0
  158. package/src/stores/envInfo.ts +2 -2
  159. package/src/stores/globals.ts +28 -0
  160. package/src/stores/layout.ts +36 -0
  161. package/src/stores/locale.ts +77 -29
  162. package/src/stores/modal.ts +22 -0
  163. package/src/stores/qualityGate.ts +28 -0
  164. package/src/stores/router.ts +108 -0
  165. package/src/stores/sections.ts +63 -0
  166. package/src/stores/stats.ts +52 -7
  167. package/src/stores/testResults.ts +13 -9
  168. package/src/stores/theme.ts +15 -18
  169. package/src/stores/timeline.ts +39 -0
  170. package/src/stores/tree.ts +61 -22
  171. package/src/stores/variables.ts +40 -0
  172. package/src/styles.scss +66 -0
  173. package/src/utils/time.ts +1 -0
  174. package/src/utils/tree.ts +23 -0
  175. package/src/utils/treeFilters.ts +27 -21
  176. package/test/components/Header/CiInfo.test.tsx +177 -0
  177. package/test/components/Header.test.tsx +122 -0
  178. package/test/utils/treeFilters.test.ts +44 -44
  179. package/tsconfig.json +7 -2
  180. package/tsconfig.node.json +8 -0
  181. package/types.d.ts +43 -24
  182. package/vitest.config.ts +15 -2
  183. package/vitest.setup.ts +1 -0
  184. package/webpack.config.js +35 -5
  185. package/dist/multi/141.app-f32e4213.js +0 -1
  186. package/dist/multi/222.app-f32e4213.js +0 -1
  187. package/dist/multi/335.app-f32e4213.js +0 -1
  188. package/dist/multi/34.app-f32e4213.js +0 -1
  189. package/dist/multi/349.app-f32e4213.js +0 -1
  190. package/dist/multi/378.app-f32e4213.js +0 -1
  191. package/dist/multi/406.app-f32e4213.js +0 -1
  192. package/dist/multi/476.app-f32e4213.js +0 -1
  193. package/dist/multi/53.app-f32e4213.js +0 -1
  194. package/dist/multi/584.app-f32e4213.js +0 -1
  195. package/dist/multi/690.app-f32e4213.js +0 -1
  196. package/dist/multi/747.app-f32e4213.js +0 -1
  197. package/dist/multi/767.app-f32e4213.js +0 -1
  198. package/dist/multi/816.app-f32e4213.js +0 -1
  199. package/dist/multi/83.app-f32e4213.js +0 -1
  200. package/dist/multi/873.app-f32e4213.js +0 -1
  201. package/dist/multi/920.app-f32e4213.js +0 -1
  202. package/dist/multi/991.app-f32e4213.js +0 -1
  203. package/dist/multi/app-f32e4213.js +0 -2
  204. package/dist/multi/app-f32e4213.js.LICENSE.txt +0 -16
  205. package/dist/multi/styles-f32e4213.css +0 -284
  206. package/dist/single/app-7fa8e43f.js +0 -2
  207. package/dist/single/app-7fa8e43f.js.LICENSE.txt +0 -16
  208. package/src/assets/scss/code.scss +0 -71
  209. package/src/assets/scss/typography.scss +0 -218
  210. package/src/components/ArrowButton/index.tsx +0 -36
  211. package/src/components/ArrowButton/styles.scss +0 -35
  212. package/src/components/LanguagePicker/index.tsx +0 -40
  213. package/src/components/Modal/styles.scss +0 -126
  214. package/src/components/ReportLogo/index.tsx +0 -16
  215. package/src/components/ReportLogo/styles.scss +0 -20
  216. package/src/components/ReportLogoFull/index.tsx +0 -20
  217. package/src/components/ReportLogoFull/styles.scss +0 -7
  218. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +0 -27
  219. package/src/components/TestResult/TestResultError/index.tsx +0 -59
  220. package/src/components/TestResult/TestResultError/styles.scss +0 -51
  221. package/src/components/TestResult/TestResultHeader/index.tsx +0 -55
  222. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +0 -67
  223. package/src/components/TestResult/TestResultHistory/index.tsx +0 -26
  224. package/src/components/TestResult/TestResultInfo/index.tsx +0 -79
  225. package/src/components/TestResult/TestResultOverview.tsx +0 -43
  226. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +0 -49
  227. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +0 -52
  228. package/src/components/TestResult/TestResultRetriesView/index.tsx +0 -24
  229. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +0 -12
  230. package/src/components/TestResult/TestResultSteps/attachment.tsx +0 -68
  231. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +0 -20
  232. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +0 -32
  233. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +0 -15
  234. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +0 -77
  235. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +0 -85
  236. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +0 -30
  237. package/src/components/TestResult/TestResultTabs/index.tsx +0 -59
  238. package/src/components/ThemeButton/ThemeButton.tsx +0 -20
  239. package/src/components/Tree/Tree.tsx +0 -75
  240. package/src/components/Tree/TreeHeader.tsx +0 -82
  241. package/src/components/Tree/TreeItem.tsx +0 -35
  242. package/src/components/Tree/TreeItemIcon.tsx +0 -32
  243. package/src/i18n/constants.ts +0 -124
  244. package/src/i18n/locales/am.json +0 -120
  245. package/src/i18n/locales/az.json +0 -120
  246. package/src/i18n/locales/de.json +0 -120
  247. package/src/i18n/locales/en.json +0 -121
  248. package/src/i18n/locales/es.json +0 -120
  249. package/src/i18n/locales/fr.json +0 -120
  250. package/src/i18n/locales/he.json +0 -120
  251. package/src/i18n/locales/it.json +0 -120
  252. package/src/i18n/locales/ja.json +0 -120
  253. package/src/i18n/locales/ka.json +0 -120
  254. package/src/i18n/locales/kr.json +0 -120
  255. package/src/i18n/locales/nl.json +0 -120
  256. package/src/i18n/locales/pl.json +0 -118
  257. package/src/i18n/locales/pt.json +0 -120
  258. package/src/i18n/locales/ru.json +0 -118
  259. package/src/i18n/locales/sv.json +0 -120
  260. package/src/i18n/locales/tr.json +0 -120
  261. package/src/i18n/locales/zh.json +0 -120
  262. package/src/utils/attachments.ts +0 -156
  263. package/src/utils/capitalize.ts +0 -6
  264. /package/dist/multi/{JetBrainsMono_vf-b9a9c326..woff → JetBrainsMono_vf.woff} +0 -0
  265. /package/dist/multi/{JetBrainsMono_vf-9e9649b6..woff2 → JetBrainsMono_vf.woff2} +0 -0
  266. /package/dist/multi/{pt-root-ui_vf-22fe60ca..woff → pt-root-ui_vf.woff} +0 -0
  267. /package/dist/multi/{pt-root-ui_vf-9d251e8b..woff2 → pt-root-ui_vf.woff2} +0 -0
  268. /package/src/components/TestResult/{TestResultAttachmentsView → TrAttachmentsView}/styles.scss +0 -0
  269. /package/src/components/TestResult/{TestResultDescription → TrDescription}/styles.scss +0 -0
  270. /package/src/components/TestResult/{TestResultDropdown → TrDropdown}/styles.scss +0 -0
  271. /package/src/components/TestResult/{TestResultEmpty → TrEmpty}/styles.scss +0 -0
  272. /package/src/components/TestResult/{TestResultLinks → TrLinks}/styles.scss +0 -0
  273. /package/src/components/TestResult/{TestResultMetadata → TrMetadata}/styles.scss +0 -0
  274. /package/src/components/TestResult/{TestResultNavigation → TrNavigation}/styles.scss +0 -0
  275. /package/src/components/TestResult/{TestResultParameters → TrParameters}/styles.scss +0 -0
  276. /package/src/components/TestResult/{TestResultPrevStatuses → TrPrevStatuses}/styles.scss +0 -0
  277. /package/src/components/TestResult/{TestResultRetriesView → TrRetriesView}/styles.scss +0 -0
  278. /package/src/components/TestResult/{TestResultSeverity → TrSeverity}/styles.scss +0 -0
  279. /package/src/components/TestResult/{TestResultStatus → TrStatus}/styles.scss +0 -0
@@ -0,0 +1,12 @@
1
+ @import "~@allurereport/web-components/mixins.scss";
2
+
3
+ .report-global-errors {
4
+ padding: 20px 0;
5
+ }
6
+
7
+ .report-global-errors-empty {
8
+ display: flex;
9
+ padding: 48px 0;
10
+ width: 100%;
11
+ justify-content: center;
12
+ }
@@ -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 { AwesomeReportOptions } from "../../../types";
3
5
 
4
6
  export const ReportHeaderLogo = () => {
7
+ const { logo } = getReportOptions<AwesomeReportOptions>() ?? {};
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,5 +1,4 @@
1
- import { Loadable } from "@allurereport/web-components";
2
- import { SuccessRatePieChart } from "@allurereport/web-components";
1
+ import { Loadable, SuccessRatePieChart } from "@allurereport/web-components";
3
2
  import { pieChartStore } from "@/stores/chart";
4
3
  import * as styles from "./styles.scss";
5
4
 
@@ -1,31 +1,57 @@
1
1
  import { getReportOptions } from "@allurereport/web-commons";
2
- import { Heading, Text } from "@allurereport/web-components";
3
- import type { AllureAwesomeReportOptions } from "types";
2
+ import { Heading, Loadable, Text, TooltipWrapper } from "@allurereport/web-components";
3
+ import type { AwesomeReportOptions } from "types";
4
4
  import { ReportHeaderLogo } from "@/components/ReportHeader/ReportHeaderLogo";
5
5
  import { ReportHeaderPie } from "@/components/ReportHeader/ReportHeaderPie";
6
- import { currentLocaleIso } from "@/stores";
6
+ import { TrStatus } from "@/components/TestResult/TrStatus";
7
+ import { currentLocaleIso, useI18n } from "@/stores";
8
+ import { globalsStore } from "@/stores/globals";
7
9
  import * as styles from "./styles.scss";
8
10
 
9
11
  export const ReportHeader = () => {
10
- const { reportName, createdAt } = getReportOptions<AllureAwesomeReportOptions>() ?? {};
12
+ const { reportName, createdAt } = getReportOptions<AwesomeReportOptions>() ?? {};
13
+ const { t } = useI18n("ui");
11
14
  const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
12
15
  month: "long",
13
16
  day: "numeric",
14
17
  year: "numeric",
18
+ hour: "numeric",
19
+ minute: "numeric",
20
+ second: "numeric",
15
21
  });
16
22
 
17
23
  return (
18
24
  <div className={styles["report-header"]}>
19
25
  <div className={styles["report-wrapper"]}>
20
26
  <ReportHeaderLogo />
21
- <div className={styles["report-wrapper-text"]}>
22
- <Heading size={"s"} tag={"h2"} className={styles["wrapper-header"]} data-testid="report-title">
23
- {reportName}
24
- </Heading>
25
- <Text type="paragraph" size="m" className={styles["report-date"]}>
26
- {formattedCreatedAt}
27
- </Text>
28
- </div>
27
+ <Loadable
28
+ source={globalsStore}
29
+ renderData={({ exitCode }) => {
30
+ const code = exitCode?.actual ?? exitCode?.original;
31
+
32
+ return (
33
+ <div className={styles["report-wrapper-text"]} data-testid="report-header">
34
+ <div className={styles["report-header-title"]}>
35
+ {code !== undefined && <TrStatus status={code === 0 ? "passed" : "failed"} />}
36
+ <Heading size={"s"} tag={"h2"} className={styles["wrapper-header"]} data-testid="report-title">
37
+ {reportName}
38
+ </Heading>
39
+ </div>
40
+ <Text type="paragraph" size="m" className={styles["report-date"]} data-testid="report-data">
41
+ {code === undefined
42
+ ? formattedCreatedAt
43
+ : exitCode.actual !== undefined
44
+ ? t("finishedAtBoth", {
45
+ formattedCreatedAt,
46
+ actual: exitCode.actual,
47
+ original: exitCode.original,
48
+ })
49
+ : t("finishedAtOriginal", { formattedCreatedAt, original: exitCode.original })}
50
+ </Text>
51
+ </div>
52
+ );
53
+ }}
54
+ />
29
55
  </div>
30
56
  <ReportHeaderPie />
31
57
  </div>
@@ -2,8 +2,10 @@
2
2
  display: flex;
3
3
  column-gap: 12px;
4
4
  justify-content: space-between;
5
- padding: 24px;
5
+ padding: 24px 24px 0;
6
6
  align-items: flex-start;
7
+ background: var(--bg-base-primary);
8
+ border-radius: 8px;
7
9
  }
8
10
 
9
11
  .report-wrapper {
@@ -47,3 +49,9 @@
47
49
  .report-header-pie-chart {
48
50
  width: 88px;
49
51
  }
52
+
53
+ .report-header-title {
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 0 4px;
57
+ }
@@ -1,81 +1,73 @@
1
- import { type Statistic, statusesList } from "@allurereport/core-api";
2
- import { Loadable } from "@allurereport/web-components";
1
+ import { type Statistic, capitalize, statusesList } from "@allurereport/core-api";
3
2
  import { computed } from "@preact/signals";
4
- import type { FunctionComponent } from "preact";
3
+ import type { FunctionalComponent } from "preact";
5
4
  import MetadataItem, { type MetadataProps } from "@/components/ReportMetadata/MetadataItem";
6
5
  import { MetadataTestType } from "@/components/ReportMetadata/MetadataTestType";
7
6
  import { MetadataWithIcon } from "@/components/ReportMetadata/MetadataWithIcon";
8
7
  import * as styles from "@/components/ReportMetadata/styles.scss";
9
- import { statsStore } from "@/stores";
10
8
  import { useI18n } from "@/stores/locale";
11
- import { capitalize } from "@/utils/capitalize";
12
9
 
13
- export const MetadataSummary: FunctionComponent = () => {
10
+ export interface MetadataSummaryProps {
11
+ stats: Statistic;
12
+ }
13
+
14
+ const metadataTestsTypes = ["flaky", "new", "retries"] as const as (keyof Statistic)[];
15
+
16
+ export const MetadataSummary: FunctionalComponent<MetadataSummaryProps> = ({ stats }) => {
14
17
  const { t } = useI18n("statuses");
15
18
  const { t: testSummary } = useI18n("testSummary");
16
19
 
17
- return (
18
- <Loadable
19
- source={statsStore}
20
- renderError={() => null}
21
- renderData={(stats) => {
22
- const allTest = computed(() => ({
23
- title: capitalize(t("total")),
24
- type: "all",
25
- count: stats.total,
26
- }));
27
- const metaDataTests = ["flaky", "retry"]
28
- .map((key) => {
29
- if (!stats[key as keyof Statistic]) {
30
- return;
31
- }
32
- const title = testSummary(key);
33
- const props = { title, count: stats[key as keyof Statistic] || 0, type: key };
20
+ const allTest = computed(() => ({
21
+ title: testSummary("total"),
22
+ type: "all",
23
+ count: stats.total,
24
+ }));
34
25
 
35
- return (
36
- <div key={key}>
37
- <MetadataItem key={key} props={props} renderComponent={MetadataWithIcon} />
38
- </div>
39
- );
40
- })
41
- .filter(Boolean);
26
+ const metaDataTests = metadataTestsTypes
27
+ .map((type) => {
28
+ if (!stats[type]) {
29
+ return;
30
+ }
42
31
 
43
- const metadataStatuses = statusesList
44
- .map((status) => ({ status, value: stats[status] }))
45
- .filter(({ value }) => value)
46
- .map(({ status, value }) => {
47
- const title = capitalize(t(status) ?? status ?? "");
48
- const props = {
49
- title,
50
- count: value,
51
- status,
52
- } as MetadataProps;
32
+ const props = { title: testSummary(type), count: stats[type] || 0, type: type };
53
33
 
54
- return (
55
- <MetadataItem
56
- data-testid={`metadata-item-${status}`}
57
- key={status}
58
- props={props}
59
- renderComponent={MetadataTestType}
60
- />
61
- );
62
- });
34
+ return (
35
+ <div key={type}>
36
+ <MetadataItem data-testid={`metadata-item-${type}`} props={props} renderComponent={MetadataWithIcon} />
37
+ </div>
38
+ );
39
+ })
40
+ .filter(Boolean);
63
41
 
64
- return (
65
- <div class={styles["report-metadata-summary"]}>
66
- <div className={styles["report-metadata-all-tests"]}>
67
- <MetadataItem
68
- data-testid="metadata-item-total"
69
- props={allTest.value}
70
- renderComponent={MetadataWithIcon}
71
- />
72
- {Boolean(metaDataTests.length) && <div className={styles["report-metadata-separator"]} />}
73
- {metaDataTests}
74
- </div>
75
- <div className={styles["report-metadata-status"]}>{metadataStatuses}</div>
76
- </div>
77
- );
78
- }}
79
- />
42
+ const metadataStatuses = statusesList
43
+ .map((status) => ({ status, value: stats[status] }))
44
+ .filter(({ value }) => value)
45
+ .map(({ status, value }) => {
46
+ const title = capitalize(t(status) ?? status ?? "");
47
+ const props = {
48
+ title,
49
+ count: value,
50
+ status,
51
+ } as MetadataProps;
52
+
53
+ return (
54
+ <MetadataItem
55
+ data-testid={`metadata-item-${status}`}
56
+ key={status}
57
+ props={props}
58
+ renderComponent={MetadataTestType}
59
+ />
60
+ );
61
+ });
62
+
63
+ return (
64
+ <div class={styles["report-metadata-summary"]}>
65
+ <div className={styles["report-metadata-all-tests"]}>
66
+ <MetadataItem data-testid="metadata-item-total" props={allTest.value} renderComponent={MetadataWithIcon} />
67
+ {Boolean(metaDataTests.length) && <div className={styles["report-metadata-separator"]} />}
68
+ {metaDataTests}
69
+ </div>
70
+ <div className={styles["report-metadata-status"]}>{metadataStatuses}</div>
71
+ </div>
80
72
  );
81
73
  };
@@ -4,18 +4,16 @@ import type { MetadataProps } from "@/components/ReportMetadata/MetadataItem";
4
4
  import * as styles from "./styles.scss";
5
5
 
6
6
  const icons: Record<string, string> = {
7
- flaky: allureIcons.lineGeneralZap,
8
- retry: allureIcons.lineArrowsRefreshCcw1,
9
- new: allureIcons.lineAlertsNotificationBox,
7
+ flaky: allureIcons.lineIconBomb2,
8
+ retries: allureIcons.lineArrowsRefreshCcw1,
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
+ );
@@ -1,24 +1,34 @@
1
1
  import type { EnvironmentItem } from "@allurereport/core-api";
2
2
  import { Loadable } from "@allurereport/web-components";
3
3
  import type { FunctionalComponent } from "preact";
4
- import { useState } from "preact/hooks";
4
+ import { useEffect, useState } from "preact/hooks";
5
5
  import { MetadataList } from "@/components/Metadata";
6
6
  import { MetadataButton } from "@/components/MetadataButton";
7
7
  import { MetadataSummary } from "@/components/ReportMetadata/MetadataSummary";
8
+ import { reportStatsStore, statsByEnvStore, useI18n } from "@/stores";
9
+ import { currentEnvironment } from "@/stores/env";
8
10
  import { envInfoStore } from "@/stores/envInfo";
11
+ import { fetchVariables, variables } from "@/stores/variables";
9
12
  import * as styles from "./styles.scss";
10
13
 
11
14
  export interface MetadataItem extends EnvironmentItem {
12
15
  value?: string;
13
16
  }
14
17
 
18
+ // TODO: check, where do we use the component and refactor it up to our needs
15
19
  export type MetadataProps = {
16
20
  envInfo?: MetadataItem[];
17
21
  size?: "s" | "m";
18
22
  groupedLabels?: Record<string, string[]>;
19
23
  };
20
24
 
21
- const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
25
+ export type MetadataVariablesProps = {
26
+ variables?: Record<string, any>;
27
+ size?: "s" | "m";
28
+ groupedLabels?: Record<string, string[]>;
29
+ };
30
+
31
+ const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo = [] }) => {
22
32
  const [isOpened, setIsOpen] = useState(true);
23
33
  const convertedEnvInfo = envInfo.map((env) => {
24
34
  return { ...env, value: env.values.join(", ") };
@@ -32,10 +42,47 @@ const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
32
42
  );
33
43
  };
34
44
 
45
+ const MetadataVariables: FunctionalComponent<MetadataVariablesProps> = (props) => {
46
+ const { t } = useI18n("ui");
47
+ const [isOpened, setIsOpen] = useState(true);
48
+ const convertedEnvInfo = Object.entries(props.variables).map(([key, value]) => {
49
+ return {
50
+ name: key,
51
+ value,
52
+ } as MetadataItem;
53
+ });
54
+
55
+ return (
56
+ <div class={styles["report-metadata"]} data-testid={"report-variables"}>
57
+ <MetadataButton
58
+ isOpened={isOpened}
59
+ setIsOpen={setIsOpen}
60
+ title={t("variables")}
61
+ counter={Object.keys(props.variables).length}
62
+ data-testid={"report-variables-button"}
63
+ />
64
+ {isOpened && <MetadataList envInfo={convertedEnvInfo} />}
65
+ </div>
66
+ );
67
+ };
68
+
35
69
  export const ReportMetadata = () => {
70
+ const stats = currentEnvironment.value
71
+ ? statsByEnvStore.value.data[currentEnvironment.value]
72
+ : reportStatsStore.value.data;
73
+
74
+ useEffect(() => {
75
+ fetchVariables(currentEnvironment.value);
76
+ }, [currentEnvironment.value]);
77
+
36
78
  return (
37
79
  <div className={styles["report-metadata-wrapper"]}>
38
- <MetadataSummary />
80
+ {stats && <MetadataSummary stats={stats} />}
81
+ <Loadable
82
+ source={variables}
83
+ transformData={(data) => data?.[currentEnvironment.value ?? "default"] ?? {}}
84
+ renderData={(data) => !!Object.keys(data).length && <MetadataVariables variables={data} />}
85
+ />
39
86
  <Loadable
40
87
  source={envInfoStore}
41
88
  renderError={() => null}
@@ -6,7 +6,6 @@
6
6
  }
7
7
 
8
8
  .report-metadata-wrapper {
9
- padding: 0 24px;
10
9
  align-items: center;
11
10
  }
12
11
 
@@ -27,7 +26,6 @@
27
26
  justify-content: space-between;
28
27
  align-items: baseline;
29
28
  padding: 16px 0;
30
- border-top: 1px solid var(--on-border-primary);
31
29
  border-bottom: 1px solid var(--on-border-primary);
32
30
  width: 100%;
33
31
  }
@@ -0,0 +1,42 @@
1
+ import { Loadable, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import { TrError } from "@/components/TestResult/TrError";
3
+ import { useI18n } from "@/stores";
4
+ import { qualityGateStore } from "@/stores/qualityGate";
5
+ import * as styles from "./styles.scss";
6
+
7
+ export const ReportQualityGateResults = () => {
8
+ const { t } = useI18n("empty");
9
+
10
+ return (
11
+ <Loadable
12
+ source={qualityGateStore}
13
+ renderData={(results) => {
14
+ if (!results.length) {
15
+ return <div className={styles["report-quality-gate-results-empty"]}>{t("no-quality-gate-results")}</div>;
16
+ }
17
+
18
+ return (
19
+ <ul className={styles["report-quality-gate-results"]}>
20
+ {results.map((result) => (
21
+ <li key={result.rule} data-testid="report-quality-gate-result">
22
+ <div className={styles["report-quality-gate-result"]}>
23
+ <SvgIcon id={allureIcons.solidXCircle} className={styles["report-quality-gate-result-icon"]} />
24
+ <div className={styles["report-quality-gate-result-content"]}>
25
+ <Text tag="p" size="l" type="ui" bold data-testid="report-quality-gate-result-rule">
26
+ {result.rule}
27
+ </Text>
28
+ <TrError
29
+ className={styles["report-quality-gate-result-error"]}
30
+ message={result.message}
31
+ data-testid="report-quality-gate-result-message"
32
+ />
33
+ </div>
34
+ </div>
35
+ </li>
36
+ ))}
37
+ </ul>
38
+ );
39
+ }}
40
+ />
41
+ );
42
+ };
@@ -0,0 +1,44 @@
1
+ @import "~@allurereport/web-components/mixins.scss";
2
+
3
+ .report-quality-gate-results {
4
+ padding: 20px 0;
5
+
6
+ & > li + li {
7
+ margin-top: 12px;
8
+ }
9
+ }
10
+
11
+ .report-quality-gate-results-empty {
12
+ display: flex;
13
+ padding: 48px 0;
14
+ width: 100%;
15
+ justify-content: center;
16
+ }
17
+
18
+ .report-quality-gate-result {
19
+ display: flex;
20
+ align-items: flex-start;
21
+ gap: 0 8px;
22
+
23
+ b {
24
+ font-weight: 700;
25
+ }
26
+ }
27
+
28
+ .report-quality-gate-result-icon {
29
+ flex: 0 0 auto;
30
+ margin-top: 3px;
31
+ color: var(--bg-support-capella);
32
+ }
33
+
34
+ .report-quality-gate-result-content {
35
+ flex: 1 1 auto;
36
+
37
+ & > * + * {
38
+ margin-top: 4px;
39
+ }
40
+ }
41
+
42
+ .report-quality-gate-result-error {
43
+ margin-top: 8px;
44
+ }
@@ -0,0 +1,55 @@
1
+ import { DropdownButton, Menu, SvgIcon, allureIcons } from "@allurereport/web-components";
2
+ import { useI18n } from "@/stores";
3
+ import { availableSections, currentSection, setSection } from "@/stores/sections";
4
+ import * as styles from "./styles.scss";
5
+
6
+ export type SectionItem = {
7
+ name: string;
8
+ logo: string;
9
+ };
10
+
11
+ const defaultSection: SectionItem = { name: "report", logo: allureIcons.reportLogo };
12
+
13
+ const sectionMap: Record<string, SectionItem> = {
14
+ default: defaultSection,
15
+ charts: { name: "charts", logo: allureIcons.lineChartsBarChartSquare },
16
+ timeline: { name: "timeline", logo: allureIcons.lineChartsTimeline },
17
+ };
18
+
19
+ export const SectionPicker = () => {
20
+ const selectedSection = sectionMap[currentSection.value] || defaultSection;
21
+ const { t } = useI18n("sections");
22
+
23
+ return (
24
+ <Menu
25
+ size="m"
26
+ placement={"bottom-start"}
27
+ menuTrigger={({ isOpened, onClick }) => (
28
+ <DropdownButton
29
+ style="ghost"
30
+ size="m"
31
+ text={t(selectedSection.name)}
32
+ icon={selectedSection.logo}
33
+ isExpanded={isOpened}
34
+ onClick={onClick}
35
+ iconSize={"xs"}
36
+ />
37
+ )}
38
+ >
39
+ <Menu.Section>
40
+ {["default", ...availableSections.value].map((value) => (
41
+ <Menu.ItemWithCheckmark
42
+ onClick={() => setSection(value)}
43
+ key={value}
44
+ isChecked={currentSection.value === value}
45
+ >
46
+ <div className={styles["menu-item"]}>
47
+ <SvgIcon id={sectionMap[value]?.logo} size={"s"} />
48
+ {t(sectionMap[value]?.name) || value}
49
+ </div>
50
+ </Menu.ItemWithCheckmark>
51
+ ))}
52
+ </Menu.Section>
53
+ </Menu>
54
+ );
55
+ };
@@ -0,0 +1,5 @@
1
+ .menu-item {
2
+ display: flex;
3
+ gap: 4px;
4
+ align-items: center;
5
+ }
@@ -0,0 +1,16 @@
1
+ import type { VNode } from "preact";
2
+ import { Charts } from "@/components/Charts";
3
+ import { Report } from "@/components/Report";
4
+ import { currentSection } from "@/stores/sections";
5
+ import { Timeline } from "../Timeline";
6
+ import * as styles from "./styles.scss";
7
+
8
+ export const SectionSwitcher = () => {
9
+ const sectionMap: Record<string, VNode> = {
10
+ report: <Report />,
11
+ charts: <Charts />,
12
+ timeline: <Timeline />,
13
+ };
14
+
15
+ return <div className={styles.layout}>{sectionMap[currentSection.value] || sectionMap.report}</div>;
16
+ };
@@ -0,0 +1,4 @@
1
+ .layout {
2
+ flex: 1 1 auto;
3
+ overflow: hidden;
4
+ }
File without changes
@@ -0,0 +1,52 @@
1
+ import type { JSX } from "preact";
2
+ import { useEffect, useMemo, useRef } from "preact/hooks";
3
+ import Split from "split.js";
4
+ import * as styles from "./styles.scss";
5
+
6
+ const SideBySide = ({ left, right }: { left: JSX.Element; right: JSX.Element }) => {
7
+ const containerRef = useRef<HTMLDivElement>(null);
8
+
9
+ const leftContent = useMemo(() => left, [left]);
10
+ const rightContent = useMemo(() => right, [right]);
11
+
12
+ useEffect(() => {
13
+ const sizes = JSON.parse(localStorage.getItem("sideBySidePosition") || "[50, 50]");
14
+
15
+ const splitter = Split([`.${styles["side-left"]}`, `.${styles["side-right"]}`], {
16
+ sizes,
17
+ gutterSize: 7,
18
+ gutter: (): HTMLElement => {
19
+ const gutter = document.createElement("div");
20
+ gutter.className = `${styles.gutter}`;
21
+ gutter.addEventListener("dblclick", () => {
22
+ const currentSizes = splitter.getSizes();
23
+ if (JSON.stringify(currentSizes) === "[50,50]") {
24
+ splitter.setSizes([30, 70]);
25
+ localStorage.setItem("sideBySidePosition", JSON.stringify([30, 70]));
26
+ return;
27
+ }
28
+ splitter.setSizes([50, 50]);
29
+ localStorage.setItem("sideBySidePosition", JSON.stringify([50, 50]));
30
+ });
31
+ return gutter;
32
+ },
33
+ onDragEnd: () => {
34
+ const newSizes = splitter.getSizes();
35
+ localStorage.setItem("sideBySidePosition", JSON.stringify(newSizes));
36
+ },
37
+ });
38
+
39
+ return () => {
40
+ splitter.destroy();
41
+ };
42
+ }, []);
43
+
44
+ return (
45
+ <div class={styles.side} ref={containerRef}>
46
+ <div class={styles["side-left"]}>{leftContent}</div>
47
+ <div class={styles["side-right"]}>{rightContent}</div>
48
+ </div>
49
+ );
50
+ };
51
+
52
+ export default SideBySide;