@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
@@ -17,6 +17,7 @@ export const MetadataList: FunctionalComponent<MetadataProps & { columns?: numbe
17
17
  <div
18
18
  class={styles["report-metadata-list"]}
19
19
  style={{ gridTemplateColumns: `repeat(${columns}, ${100 / columns - 5}%)` }}
20
+ data-testid={"metadata-list"}
20
21
  >
21
22
  {envInfo?.map(({ name, values, value }) => (
22
23
  <MetadataKeyValue key={name} size={size} title={name} value={value} values={values} />
@@ -25,7 +26,7 @@ export const MetadataList: FunctionalComponent<MetadataProps & { columns?: numbe
25
26
  );
26
27
  };
27
28
 
28
- export const TestResultMetadataList: FunctionalComponent<MetadataProps> = ({ groupedLabels, size = "m" }) => {
29
+ export const TrMetadataList: FunctionalComponent<MetadataProps> = ({ groupedLabels, size = "m" }) => {
29
30
  return (
30
31
  <div class={styles["report-metadata-list"]}>
31
32
  {groupedLabels &&
@@ -97,22 +98,23 @@ const MetadataKeyValue: FunctionalComponent<{
97
98
  size?: "s" | "m";
98
99
  }> = ({ title, value, values, size = "m" }) => {
99
100
  return (
100
- <div className={styles["report-metadata-keyvalue"]}>
101
+ <div className={styles["report-metadata-keyvalue"]} data-testid={"metadata-item"}>
101
102
  <Text
102
103
  type={"ui"}
103
104
  size={size}
104
105
  className={clsx(styles["report-metadata-keyvalue-title"], styles[`report-metadata-${size}`])}
106
+ data-testid={"metadata-item-key"}
105
107
  >
106
108
  {title}
107
109
  </Text>
108
110
  {values?.length ? (
109
- <div className={styles["report-metadata-values"]}>
111
+ <div className={styles["report-metadata-values"]} data-testid={"metadata-item-value"}>
110
112
  {values.map((item) => (
111
113
  <MetaDataKeyLabel key={item} value={item} />
112
114
  ))}
113
115
  </div>
114
116
  ) : (
115
- <div className={styles["report-metadata-values"]}>
117
+ <div className={styles["report-metadata-values"]} data-testid={"metadata-item-value"}>
116
118
  <MetaDataKeyLabel value={value} />
117
119
  </div>
118
120
  )}
@@ -1,7 +1,6 @@
1
- import { Counter, Text } from "@allurereport/web-components";
1
+ import { ArrowButton, Counter, Text } from "@allurereport/web-components";
2
2
  import clsx from "clsx";
3
3
  import type { FunctionalComponent } from "preact";
4
- import { ArrowButton } from "@/components/ArrowButton";
5
4
  import * as styles from "./styles.scss";
6
5
 
7
6
  interface MetadataButtonProps {
@@ -11,22 +10,31 @@ interface MetadataButtonProps {
11
10
  title?: string;
12
11
  }
13
12
 
14
- export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({ isOpened, setIsOpen, counter, title }) => {
13
+ export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({
14
+ isOpened,
15
+ setIsOpen,
16
+ counter,
17
+ title,
18
+ ...rest
19
+ }) => {
15
20
  return (
16
- <div
21
+ <button
22
+ {...rest}
17
23
  className={clsx(styles["report-metadata-header"], isOpened && styles["report-metadata-header-opened"])}
24
+ type={"button"}
18
25
  onClick={() => setIsOpen(!isOpened)}
19
26
  >
20
27
  <Text size={"m"} bold>
21
28
  {title}
22
29
  </Text>
23
- {counter && <Counter count={counter} size="s" />}
30
+ {!!counter && <Counter count={counter} size="s" />}
24
31
  <ArrowButton
25
32
  isOpened={isOpened}
26
33
  iconSize={"s"}
27
34
  buttonSize={"s"}
28
35
  className={styles["report-metadata-header-arrow"]}
36
+ tag={"div"}
29
37
  />
30
- </div>
38
+ </button>
31
39
  );
32
40
  };
@@ -8,6 +8,9 @@
8
8
  }
9
9
 
10
10
  .report-metadata-header {
11
+ border: none;
12
+ background: none;
13
+ padding: 0;
11
14
  width: max-content;
12
15
  display: flex;
13
16
  align-items: center;
@@ -1,174 +1,22 @@
1
- import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
- import { Button, Heading, IconButton, TooltipWrapper, allureIcons } from "@allurereport/web-components";
3
- import { signal } from "@preact/signals";
4
- import type { FunctionalComponent, VNode } from "preact";
5
- import { useEffect } from "preact/hooks";
6
- import Prism from "prismjs";
7
- import type { AllureAwesomeTestResult } from "types";
8
- import { Attachment } from "@/components/TestResult/TestResultSteps/attachment";
9
- import { attachmentType, downloadAttachment, openAttachmentInNewTab } from "@/utils/attachments";
10
- import * as styles from "./styles.scss";
1
+ import { Modal, type ModalTranslations } from "@allurereport/web-components";
2
+ import { useI18n } from "@/stores";
3
+ import { isModalOpen, modalData } from "@/stores/modal";
11
4
 
12
- export const isModalOpen = signal(false);
5
+ export const ModalComponent = () => {
6
+ const { t } = useI18n("controls");
13
7
 
14
- interface ModalDataProps {
15
- data: AttachmentTestStepResult;
16
- component: VNode;
17
- preview?: boolean;
18
- }
19
-
20
- export const modalData = signal<ModalDataProps>({
21
- data: null,
22
- preview: false,
23
- component: null,
24
- });
25
-
26
- const openModal = ({ data, component, preview }: ModalDataProps) => {
27
- modalData.value = {
28
- data,
29
- component,
30
- preview,
31
- };
32
- isModalOpen.value = true;
33
- };
34
-
35
- const closeModal = () => {
36
- isModalOpen.value = false;
37
- };
38
-
39
- const ModalThumb: FunctionalComponent<{ item: AttachmentTestStepResult }> = ({ item, children }) => {
40
- const isActiveThumb = modalData.value.data?.link?.id === item.link?.id;
41
-
42
- const showAttach = (showedItem: AttachmentTestStepResult) => {
43
- openModal({
44
- data: showedItem,
45
- component: <Attachment item={showedItem} key={showedItem.link?.id} />,
46
- });
8
+ const translations: ModalTranslations = {
9
+ tooltipDownload: t("downloadAttachment"),
10
+ tooltipPreview: t("previewAttachment"),
11
+ openInNewTabButton: t("openInNewTab"),
47
12
  };
48
13
 
49
14
  return (
50
- <div className={`${styles["modal-thumb"]} ${isActiveThumb ? styles.active : ""}`} onClick={() => showAttach(item)}>
51
- {children}
52
- </div>
53
- );
54
- };
55
-
56
- export type ModalGalleryProps = {
57
- attachments: AttachmentTestStepResult[];
58
- };
59
-
60
- const ModalGallery: FunctionalComponent<ModalGalleryProps> = ({ attachments = [] }) => {
61
- const filteredAttachments = attachments.filter(({ link: { contentType } }: AttachmentTestStepResult) => {
62
- const type = attachmentType(contentType).type;
63
-
64
- return !["archive", null].includes(type as string);
65
- });
66
-
67
- return (
68
- <div className={styles["modal-gallery"]}>
69
- {filteredAttachments.map((item, index) => (
70
- <ModalThumb item={item} key={index}>
71
- <Attachment item={item} />
72
- </ModalThumb>
73
- ))}
74
- </div>
15
+ <Modal
16
+ {...modalData.value}
17
+ translations={translations}
18
+ isModalOpen={isModalOpen.value}
19
+ closeModal={() => (isModalOpen.value = false)}
20
+ />
75
21
  );
76
22
  };
77
-
78
- export type ModalProps = {
79
- testResult: AllureAwesomeTestResult;
80
- };
81
-
82
- const Modal: FunctionalComponent<ModalProps> = ({ testResult }) => {
83
- const { link } = modalData.value.data || {};
84
- const attachName = link?.name ? `${link?.name}` : `${link?.id}${link?.ext}`;
85
-
86
- useEffect(() => {
87
- Prism.highlightAll();
88
-
89
- if (isModalOpen.value) {
90
- document.body.style.overflow = "hidden";
91
- } else {
92
- document.body.style.overflow = "";
93
- }
94
-
95
- return () => {
96
- document.body.style.overflow = "";
97
- };
98
- }, []);
99
-
100
- const isImageAttachment = link?.contentType?.startsWith("image");
101
- const isHtmlAttachment = link?.contentType === "text/html";
102
- const downloadData = async (e: Event) => {
103
- e.stopPropagation();
104
- const { id, ext, contentType } = link || {};
105
- if (id && ext && contentType) {
106
- await downloadAttachment(id, ext, contentType);
107
- }
108
- };
109
- const openInNewWindow = async () => {
110
- const { id, ext, contentType } = link || {};
111
- await openAttachmentInNewTab(id, ext, contentType);
112
- };
113
-
114
- if (!isModalOpen.value) {
115
- return null;
116
- }
117
-
118
- return (
119
- <div className={styles["modal-overlay"]} onClick={closeModal}>
120
- <div className={styles["modal-content"]} onClick={(e) => e.stopPropagation()}>
121
- <div className={`${styles["modal-wrapper"]}`}>
122
- <div className={styles["modal-top"]}>
123
- <Heading size={"s"}>{attachName}</Heading>
124
- <div className={styles["modal-buttons"]}>
125
- {isImageAttachment && (
126
- <Button
127
- style={"outline"}
128
- onClick={openInNewWindow}
129
- icon={allureIcons.lineGeneralLinkExternal}
130
- text={"Open in new tab"}
131
- />
132
- )}
133
- {isHtmlAttachment && (
134
- <TooltipWrapper tooltipText={"Preview attachment"}>
135
- <IconButton
136
- style={"outline"}
137
- size={"m"}
138
- iconSize={"s"}
139
- icon={modalData.value.preview ? allureIcons.viewOff : allureIcons.view}
140
- onClick={() => {
141
- modalData.value = {
142
- ...modalData.value,
143
- preview: !modalData.value.preview,
144
- };
145
- }}
146
- />
147
- </TooltipWrapper>
148
- )}
149
- <TooltipWrapper tooltipText={"Download attachment"}>
150
- <IconButton
151
- style={"outline"}
152
- size={"m"}
153
- iconSize={"s"}
154
- icon={allureIcons.lineGeneralDownloadCloud}
155
- onClick={(e: MouseEvent) => downloadData(e)}
156
- />
157
- </TooltipWrapper>
158
- <IconButton iconSize={"m"} style={"ghost"} onClick={closeModal} icon={allureIcons.lineGeneralXClose} />
159
- </div>
160
- </div>
161
- <div className={styles["modal-data"]}>
162
- <div className={styles["modal-data-component"]} key={modalData.value?.data?.link?.id}>
163
- {modalData.value?.component}
164
- </div>
165
- </div>
166
- </div>
167
- <ModalGallery attachments={testResult.attachments} />
168
- </div>
169
- </div>
170
- );
171
- };
172
-
173
- export { openModal, closeModal };
174
- export default Modal;
@@ -0,0 +1,70 @@
1
+ import { Text } from "@allurereport/web-components";
2
+ import { type ComponentChildren, createContext } from "preact";
3
+ import { useContext, useState } from "preact/hooks";
4
+ import * as styles from "./styles.scss";
5
+
6
+ type NavTabsContextT = {
7
+ currentTab: string | undefined;
8
+ setCurrentTab: (id: string) => void;
9
+ };
10
+
11
+ const NavTabsContext = createContext<NavTabsContextT | null>(null);
12
+
13
+ export const useNavTabsContext = () => {
14
+ const context = useContext(NavTabsContext);
15
+
16
+ if (!context) {
17
+ throw new Error("NavTabs components must be used within a NavTabs component");
18
+ }
19
+
20
+ return context;
21
+ };
22
+
23
+ export const NavTabsProvider = (props: { initialTab?: string; children: ComponentChildren }) => {
24
+ const { children, initialTab } = props;
25
+ const [currentTab, setCurrentTab] = useState<string | undefined>(initialTab);
26
+
27
+ return <NavTabsContext.Provider value={{ currentTab, setCurrentTab }}>{children}</NavTabsContext.Provider>;
28
+ };
29
+
30
+ export const NavTabs = (props: { children: ComponentChildren; initialTab?: string }) => {
31
+ return <NavTabsProvider {...props} />;
32
+ };
33
+
34
+ export const NavTabsList = (props: { children: ComponentChildren }) => {
35
+ return <div className={styles.tabsList}>{props.children}</div>;
36
+ };
37
+
38
+ export const NavTab = (props: {
39
+ "id": string;
40
+ "children": ComponentChildren;
41
+ "onClick"?: () => void;
42
+ "data-testid"?: string;
43
+ "isCurrentTab"?: boolean;
44
+ }) => {
45
+ const { currentTab, setCurrentTab } = useNavTabsContext();
46
+ const { id, children, onClick, "data-testid": dataTestId, "isCurrentTab": overrideIsCurrentTab } = props;
47
+ const isCurrentTab = overrideIsCurrentTab !== undefined ? overrideIsCurrentTab : currentTab === id;
48
+ const handleTabClick = () => {
49
+ if (onClick) {
50
+ onClick();
51
+ } else if (isCurrentTab) {
52
+ return;
53
+ } else {
54
+ setCurrentTab(id);
55
+ }
56
+ };
57
+
58
+ return (
59
+ <button
60
+ className={styles.tab}
61
+ onClick={handleTabClick}
62
+ data-testid={dataTestId || `nav-tab-${id}`}
63
+ aria-current={isCurrentTab ? true : undefined}
64
+ >
65
+ <Text type="paragraph" size="m">
66
+ {children}
67
+ </Text>
68
+ </button>
69
+ );
70
+ };
@@ -37,9 +37,6 @@
37
37
  border-bottom: 2px solid transparent;
38
38
  }
39
39
 
40
- &[disabled] {
41
- opacity: 0.5;
42
- }
43
40
  &[aria-current] {
44
41
  background-color: var(--bg-base-primary);
45
42
  cursor: default;
@@ -0,0 +1,7 @@
1
+ import { BaseLayout } from "@/components/BaseLayout";
2
+ import { SplitLayout } from "@/components/SplitLayout";
3
+ import { isSplitMode } from "@/stores/layout";
4
+
5
+ export const Report = () => {
6
+ return isSplitMode.value ? <SplitLayout /> : <BaseLayout />;
7
+ };
@@ -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
@@ -24,66 +63,8 @@ export const Filters = () => {
24
63
  </div>
25
64
  )}
26
65
  >
27
- <Menu.Section>
28
- <Menu.Item
29
- closeMenuOnClick={false}
30
- ariaLabel={t("enable-filter", { filter: t("flaky") })}
31
- onClick={() => {
32
- setTreeFilter("flaky", !flaky);
33
- }}
34
- leadingIcon={allureIcons.lineGeneralZap}
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>
66
+ <Menu.Section data-testid="filters-menu">
67
+ {MENU_KEYS.map((key: TreeFilters) => renderFilterItem(key, treeFiltersStore.value.filter[key]))}
87
68
  </Menu.Section>
88
69
  </Menu>
89
70
  );
@@ -1,10 +1,10 @@
1
- import { statusesList } from "@allurereport/core-api";
1
+ import { capitalize, statusesList } from "@allurereport/core-api";
2
2
  import { Counter, Loadable } from "@allurereport/web-components";
3
- import { statsStore } from "@/stores";
3
+ import { reportStatsStore, statsByEnvStore } from "@/stores";
4
+ import { currentEnvironment } from "@/stores/env";
4
5
  import { useI18n } from "@/stores/locale";
5
- import { treeFiltersStore } from "@/stores/tree";
6
- import { capitalize } from "@/utils/capitalize";
7
- import { Tab, Tabs, TabsList } from "../Tabs";
6
+ import { setTreeStatus, treeFiltersStore } from "@/stores/tree";
7
+ import { Tab, Tabs, TabsList, useTabsContext } from "../Tabs";
8
8
  import { TreeList } from "../Tree";
9
9
  import { HeaderActions } from "./HeaderActions";
10
10
  import { SortBy } from "./SortBy";
@@ -15,27 +15,38 @@ const ALL_TAB = "total";
15
15
 
16
16
  const Header = () => {
17
17
  const { t } = useI18n("statuses");
18
+ const { currentTab, setCurrentTab } = useTabsContext();
19
+
18
20
  return (
19
21
  <header className={styles.header}>
20
22
  <HeaderActions />
21
23
  <div className={styles.headerRow}>
22
24
  <TabsList>
23
25
  <Loadable
24
- source={statsStore}
26
+ source={statsByEnvStore}
25
27
  renderData={(stats) => {
26
- const allStatuses = statusesList
27
- .map((status) => ({ status, value: stats[status] }))
28
- .filter(({ value }) => value)
29
- .map(({ status, value }) => (
30
- <Tab data-testid={`tab-${status}`} key={status} id={status}>
31
- {capitalize(t(status) ?? status)} <Counter count={value} size="s" status={status} />
32
- </Tab>
33
- ));
28
+ const currentEnv = stats[currentEnvironment.value] || reportStatsStore.value.data;
29
+ const statList = statusesList
30
+ .map((status) => {
31
+ return { status, value: currentEnv[status] };
32
+ })
33
+ .filter(({ value }) => value);
34
+ const isStatListHaveCurrentTab = statList.filter(({ status }) => status === currentTab);
35
+ if (!isStatListHaveCurrentTab.length && currentTab !== "total") {
36
+ setCurrentTab("total");
37
+ setTreeStatus("total");
38
+ }
39
+
40
+ const allStatuses = statList.map(({ status, value }) => (
41
+ <Tab data-testid={`tab-${status}`} key={status} id={status}>
42
+ {capitalize(t(status) ?? status)} <Counter count={value} size="s" status={status} />
43
+ </Tab>
44
+ ));
34
45
 
35
46
  return (
36
47
  <>
37
48
  <Tab data-testid="tab-all" id={ALL_TAB}>
38
- {capitalize(t("total"))} <Counter count={stats?.total ?? 0} size="s" />
49
+ {capitalize(t("total"))} <Counter count={currentEnv?.total ?? 0} size="s" />
39
50
  </Tab>
40
51
  {allStatuses}
41
52
  </>
@@ -1,9 +1,14 @@
1
1
  .header {
2
- padding: 24px;
3
- padding-bottom: 0;
2
+ padding: 24px 0 0;
4
3
  display: flex;
5
4
  flex-direction: column;
6
5
  gap: 12px;
6
+ position: sticky;
7
+ left: 0;
8
+ top: 0;
9
+ left: 0;
10
+ background: var(--bg-base-primary);
11
+ z-index: 1;
7
12
  }
8
13
 
9
14
  .headerRow {
@@ -17,7 +22,8 @@
17
22
  }
18
23
 
19
24
  .body {
20
- padding: 16px 24px;
25
+ padding: 16px 0;
26
+ min-height: 320px;
21
27
  }
22
28
 
23
29
  .headerActions {
@@ -0,0 +1,34 @@
1
+ import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
+ import { Loadable } from "@allurereport/web-components";
3
+ import { TrAttachmentView } from "@/components/TestResult/TrAttachmentsView";
4
+ import { useI18n } from "@/stores";
5
+ import { globalsStore } from "@/stores/globals";
6
+ import { AwesomeTestResult } from "../../../types";
7
+ import * as styles from "./styles.scss";
8
+
9
+ export const ReportGlobalAttachments = () => {
10
+ const { t } = useI18n("empty");
11
+
12
+ return (
13
+ <Loadable
14
+ source={globalsStore}
15
+ renderData={({ attachments }) => {
16
+ if (!attachments.length) {
17
+ return <div className={styles["report-global-attachments-empty"]}>{t("no-attachments-results")}</div>;
18
+ }
19
+
20
+ const attachmentSteps: AttachmentTestStepResult[] = attachments.map((attachment: any) => ({
21
+ link: attachment,
22
+ type: "attachment",
23
+ }));
24
+
25
+ return (
26
+ <TrAttachmentView
27
+ className={styles["report-global-attachments"]}
28
+ testResult={{ attachments: attachmentSteps } as AwesomeTestResult}
29
+ />
30
+ );
31
+ }}
32
+ />
33
+ );
34
+ };
@@ -0,0 +1,11 @@
1
+ .report-global-attachments {
2
+ padding-left: 0;
3
+ padding-right: 0;
4
+ }
5
+
6
+ .report-global-attachments-empty {
7
+ display: flex;
8
+ padding: 48px 0;
9
+ width: 100%;
10
+ justify-content: center;
11
+ }
@@ -0,0 +1,30 @@
1
+ import { Loadable } from "@allurereport/web-components";
2
+ import { TrError } from "@/components/TestResult/TrError";
3
+ import { useI18n } from "@/stores";
4
+ import { globalsStore } from "@/stores/globals";
5
+ import * as styles from "./styles.scss";
6
+
7
+ export const ReportGlobalErrors = () => {
8
+ const { t } = useI18n("empty");
9
+
10
+ return (
11
+ <Loadable
12
+ source={globalsStore}
13
+ renderData={({ errors }) => {
14
+ if (!errors.length) {
15
+ return <div className={styles["report-global-errors-empty"]}>{t("no-global-errors-results")}</div>;
16
+ }
17
+
18
+ return (
19
+ <ul className={styles["report-global-errors"]}>
20
+ {errors.map((error, i) => (
21
+ <li key={i} style={{ marginBottom: "8px" }}>
22
+ <TrError {...error} />
23
+ </li>
24
+ ))}
25
+ </ul>
26
+ );
27
+ }}
28
+ />
29
+ );
30
+ };