@allurereport/web-classic 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 (579) hide show
  1. package/.babelrc.js +46 -0
  2. package/.eslintrc.cjs +16 -119
  3. package/dist/multi/10.app-897d4cad2ca206583e32.js +1 -0
  4. package/dist/multi/222.app-897d4cad2ca206583e32.js +1 -0
  5. package/dist/multi/26.app-897d4cad2ca206583e32.js +1 -0
  6. package/dist/multi/302.app-897d4cad2ca206583e32.js +1 -0
  7. package/dist/multi/304.app-897d4cad2ca206583e32.js +1 -0
  8. package/dist/multi/369.app-897d4cad2ca206583e32.js +1 -0
  9. package/dist/multi/389.app-897d4cad2ca206583e32.js +1 -0
  10. package/dist/multi/498.app-897d4cad2ca206583e32.js +1 -0
  11. package/dist/multi/60.app-897d4cad2ca206583e32.js +1 -0
  12. package/dist/multi/643.app-897d4cad2ca206583e32.js +1 -0
  13. package/dist/multi/671.app-897d4cad2ca206583e32.js +1 -0
  14. package/dist/multi/725.app-897d4cad2ca206583e32.js +1 -0
  15. package/dist/multi/770.app-897d4cad2ca206583e32.js +1 -0
  16. package/dist/multi/848.app-897d4cad2ca206583e32.js +1 -0
  17. package/dist/multi/853.app-897d4cad2ca206583e32.js +1 -0
  18. package/dist/multi/872.app-897d4cad2ca206583e32.js +1 -0
  19. package/dist/multi/895.app-897d4cad2ca206583e32.js +1 -0
  20. package/dist/multi/920.app-897d4cad2ca206583e32.js +1 -0
  21. package/dist/multi/979.app-897d4cad2ca206583e32.js +1 -0
  22. package/dist/multi/991.app-897d4cad2ca206583e32.js +1 -0
  23. package/dist/multi/JetBrainsMono_vf.woff +0 -0
  24. package/dist/multi/JetBrainsMono_vf.woff2 +0 -0
  25. package/dist/multi/app-897d4cad2ca206583e32.js +2 -0
  26. package/dist/multi/app-897d4cad2ca206583e32.js.LICENSE.txt +25 -0
  27. package/dist/multi/manifest.json +26 -25
  28. package/dist/multi/pt-root-ui_vf.woff +0 -0
  29. package/dist/multi/pt-root-ui_vf.woff2 +0 -0
  30. package/dist/multi/styles-cf5cd8299b71a6d78e3e.css +284 -0
  31. package/dist/single/app-db9badbaf3040ca25425.js +2 -0
  32. package/dist/single/app-db9badbaf3040ca25425.js.LICENSE.txt +25 -0
  33. package/dist/single/manifest.json +1 -8
  34. package/package.json +50 -49
  35. package/postcss.config.js +5 -0
  36. package/src/assets/scss/_common.scss +142 -0
  37. package/src/assets/scss/code.scss +71 -0
  38. package/src/assets/scss/day.scss +51 -0
  39. package/src/assets/scss/fonts.scss +3 -0
  40. package/src/assets/scss/index.scss +9 -0
  41. package/src/assets/scss/night.scss +61 -0
  42. package/src/assets/scss/palette.scss +393 -0
  43. package/src/assets/scss/theme.scss +326 -0
  44. package/src/assets/scss/typography.scss +218 -0
  45. package/src/assets/scss/vars.scss +8 -0
  46. package/src/components/ArrowButton/index.tsx +36 -0
  47. package/src/components/ArrowButton/styles.scss +35 -0
  48. package/src/components/BaseLayout/index.tsx +23 -0
  49. package/src/components/BaseLayout/styles.scss +63 -0
  50. package/src/components/Behaviors/BehaviorsList.tsx +67 -0
  51. package/src/components/Behaviors/index.tsx +60 -0
  52. package/src/components/Behaviors/styles.scss +196 -0
  53. package/src/components/Categories/CategoriesList.tsx +67 -0
  54. package/src/components/Categories/index.tsx +60 -0
  55. package/src/components/Categories/styles.scss +196 -0
  56. package/src/components/Footer/FooterLogo.tsx +15 -0
  57. package/src/components/Footer/FooterVersion.tsx +33 -0
  58. package/src/components/Footer/index.tsx +13 -0
  59. package/src/components/Footer/styles.scss +14 -0
  60. package/src/components/Graphs/index.tsx +2 -0
  61. package/src/components/Header/index.tsx +14 -0
  62. package/src/components/Header/styles.scss +26 -0
  63. package/src/components/HeaderActions/Filters.tsx +90 -0
  64. package/src/components/HeaderActions/HeaderActions.tsx +58 -0
  65. package/src/components/HeaderActions/SortBy.tsx +128 -0
  66. package/src/components/HeaderActions/styles.scss +82 -0
  67. package/src/components/LanguagePicker/index.tsx +41 -0
  68. package/src/components/LanguagePicker/styles.scss +3 -0
  69. package/src/components/MainReport/index.tsx +19 -0
  70. package/src/components/Metadata/index.tsx +121 -0
  71. package/src/components/Metadata/styles.scss +146 -0
  72. package/src/components/MetadataButton/index.tsx +32 -0
  73. package/src/components/MetadataButton/styles.scss +53 -0
  74. package/src/components/Modal/index.tsx +174 -0
  75. package/src/components/Modal/styles.scss +126 -0
  76. package/src/components/Overview/Overview.module.scss +29 -0
  77. package/src/components/Overview/index.tsx +105 -0
  78. package/src/components/Packages/PackagesList.tsx +67 -0
  79. package/src/components/Packages/index.tsx +59 -0
  80. package/src/components/Packages/styles.scss +196 -0
  81. package/src/components/ReportBody/Filters.tsx +92 -0
  82. package/src/components/ReportBody/HeaderActions.tsx +21 -0
  83. package/src/components/ReportBody/SortBy.tsx +132 -0
  84. package/src/components/ReportBody/context.tsx +106 -0
  85. package/src/components/ReportBody/index.tsx +69 -0
  86. package/src/components/ReportBody/styles.scss +64 -0
  87. package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  88. package/src/components/ReportHeader/ReportHeaderLogo.tsx +14 -0
  89. package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
  90. package/src/components/ReportHeader/index.tsx +33 -0
  91. package/src/components/ReportHeader/styles.scss +49 -0
  92. package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
  93. package/src/components/ReportMetadata/MetadataSummary.tsx +80 -0
  94. package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
  95. package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
  96. package/src/components/ReportMetadata/index.tsx +46 -0
  97. package/src/components/ReportMetadata/styles.scss +99 -0
  98. package/src/components/SideBySide/index.tsx +54 -0
  99. package/src/components/SideBySide/styles.scss +59 -0
  100. package/src/components/SideNav/SideNav.tsx +78 -0
  101. package/src/components/{side-nav → SideNav}/styles.scss +54 -46
  102. package/src/components/Suites/index.tsx +62 -0
  103. package/src/components/Suites/styles.scss +10 -0
  104. package/src/components/Tabs/index.tsx +33 -0
  105. package/src/components/Tabs/styles.scss +56 -0
  106. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  107. package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  108. package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
  109. package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
  110. package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
  111. package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
  112. package/src/components/TestResult/TestResultEmpty/index.tsx +33 -0
  113. package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
  114. package/src/components/TestResult/TestResultError/index.tsx +48 -0
  115. package/src/components/TestResult/TestResultError/styles.scss +51 -0
  116. package/src/components/TestResult/TestResultHeader/index.tsx +53 -0
  117. package/src/components/TestResult/TestResultHeader/styles.scss +43 -0
  118. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +67 -0
  119. package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
  120. package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
  121. package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
  122. package/src/components/TestResult/TestResultInfo/index.tsx +79 -0
  123. package/src/components/TestResult/TestResultInfo/styles.scss +50 -0
  124. package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
  125. package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
  126. package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
  127. package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
  128. package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
  129. package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
  130. package/src/components/TestResult/TestResultOverview.tsx +40 -0
  131. package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
  132. package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
  133. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
  134. package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  135. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +65 -0
  136. package/src/components/TestResult/TestResultRetriesView/index.tsx +27 -0
  137. package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
  138. package/src/components/TestResult/TestResultSetup/index.tsx +49 -0
  139. package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
  140. package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
  141. package/src/components/TestResult/TestResultStatus/index.tsx +26 -0
  142. package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
  143. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +38 -0
  144. package/src/components/TestResult/TestResultSteps/attachment.tsx +68 -0
  145. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +20 -0
  146. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +32 -0
  147. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
  148. package/src/components/TestResult/TestResultSteps/index.tsx +49 -0
  149. package/src/components/TestResult/TestResultSteps/styles.scss +221 -0
  150. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +77 -0
  151. package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
  152. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +78 -0
  153. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
  154. package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  155. package/src/components/TestResult/TestResultTabs/index.tsx +59 -0
  156. package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
  157. package/src/components/TestResult/TestResultTeardown/index.tsx +49 -0
  158. package/src/components/{testresult → TestResult}/TestResultView.js +1 -1
  159. package/src/components/TestResult/index.tsx +54 -0
  160. package/src/components/TestResultView/index.tsx +31 -0
  161. package/src/components/ThemeButton/ThemeButton.tsx +20 -0
  162. package/src/components/Timeline/index.tsx +2 -0
  163. package/src/components/Tree/Tree.tsx +76 -0
  164. package/src/components/Tree/TreeHeader.tsx +82 -0
  165. package/src/components/Tree/TreeItem.tsx +49 -0
  166. package/src/components/Tree/TreeItemIcon.tsx +32 -0
  167. package/src/components/Tree/index.tsx +60 -0
  168. package/src/components/Tree/styles.scss +185 -0
  169. package/src/index.html +27 -4
  170. package/src/index.tsx +60 -0
  171. package/src/stores/behaviors.ts +127 -0
  172. package/src/stores/categories.ts +127 -0
  173. package/src/stores/chart.ts +32 -0
  174. package/src/stores/charts.ts +22 -0
  175. package/src/stores/envInfo.ts +34 -0
  176. package/src/stores/index.ts +4 -0
  177. package/src/stores/locale.ts +84 -0
  178. package/src/stores/packages.ts +127 -0
  179. package/src/stores/router.ts +55 -0
  180. package/src/stores/stats.ts +36 -0
  181. package/src/stores/tabs.ts +7 -0
  182. package/src/stores/testResults.ts +66 -0
  183. package/src/stores/theme.ts +30 -0
  184. package/src/stores/tree.ts +127 -0
  185. package/src/stores/trend.ts +36 -0
  186. package/src/stores/types.ts +5 -0
  187. package/src/translations/am.json +128 -0
  188. package/src/translations/az.json +116 -205
  189. package/src/translations/br.json +9 -0
  190. package/src/translations/constants.ts +124 -0
  191. package/src/translations/de.json +113 -190
  192. package/src/translations/en.json +118 -203
  193. package/src/translations/es.json +106 -196
  194. package/src/translations/fr.json +107 -205
  195. package/src/translations/he.json +104 -190
  196. package/src/translations/it.json +119 -0
  197. package/src/translations/ja.json +104 -195
  198. package/src/translations/ka.json +119 -0
  199. package/src/translations/kr.json +104 -195
  200. package/src/translations/nl.json +107 -205
  201. package/src/translations/pl.json +105 -208
  202. package/src/translations/pt.json +119 -0
  203. package/src/translations/ru.json +102 -200
  204. package/src/translations/sv.json +107 -210
  205. package/src/translations/tr.json +107 -205
  206. package/src/translations/zh.json +105 -177
  207. package/src/types/globals.d.ts +13 -0
  208. package/src/types/window.d.ts +8 -0
  209. package/src/utils/attachments.ts +156 -0
  210. package/src/utils/copyToClipboard.ts +16 -0
  211. package/src/utils/isMac.ts +8 -0
  212. package/src/utils/navigate.ts +7 -0
  213. package/src/utils/statuses.ts +55 -0
  214. package/src/utils/time.ts +17 -0
  215. package/src/utils/treeFilters.ts +139 -0
  216. package/test/dummy.test.ts +7 -0
  217. package/test/utils/treeFilters.test.ts +448 -0
  218. package/tsconfig.json +25 -0
  219. package/types.d.ts +83 -1
  220. package/vitest.config.ts +18 -0
  221. package/webpack.config.js +42 -56
  222. package/.babelrc.cjs +0 -18
  223. package/dist/multi/154.app-4abea52a.js +0 -1
  224. package/dist/multi/216.app-4abea52a.js +0 -1
  225. package/dist/multi/232.app-4abea52a.js +0 -1
  226. package/dist/multi/250.app-4abea52a.js +0 -1
  227. package/dist/multi/256.app-4abea52a.js +0 -1
  228. package/dist/multi/301.app-4abea52a.js +0 -1
  229. package/dist/multi/323.app-4abea52a.js +0 -1
  230. package/dist/multi/353.app-4abea52a.js +0 -1
  231. package/dist/multi/411d15fc5bb62472eea6ead4fb276ca9.ico +0 -0
  232. package/dist/multi/564.app-4abea52a.js +0 -1
  233. package/dist/multi/594.app-4abea52a.js +0 -1
  234. package/dist/multi/623.app-4abea52a.js +0 -1
  235. package/dist/multi/7.app-4abea52a.js +0 -1
  236. package/dist/multi/729.app-4abea52a.js +0 -1
  237. package/dist/multi/783.app-4abea52a.js +0 -1
  238. package/dist/multi/826.app-4abea52a.js +0 -1
  239. package/dist/multi/925.app-4abea52a.js +0 -1
  240. package/dist/multi/app-4abea52a.js +0 -2
  241. package/dist/multi/app-4abea52a.js.LICENSE.txt +0 -29
  242. package/dist/multi/checkmark-c8e83eb1.svg +0 -8
  243. package/dist/multi/sort-down-icon-2f1625c8.svg +0 -8
  244. package/dist/multi/sort-icon-dc2db9af.svg +0 -8
  245. package/dist/multi/sort-up-icon-e10d3fa9.svg +0 -8
  246. package/dist/multi/sprite.svg +0 -4
  247. package/dist/multi/styles-4abea52a.css +0 -558
  248. package/dist/multi/vertical-5e6d1df4.png +0 -0
  249. package/dist/single/411d15fc5bb62472eea6ead4fb276ca9.ico +0 -0
  250. package/dist/single/app-69c4b948.js +0 -2
  251. package/dist/single/app-69c4b948.js.LICENSE.txt +0 -29
  252. package/dist/single/checkmark-c8e83eb1.svg +0 -8
  253. package/dist/single/sort-down-icon-2f1625c8.svg +0 -8
  254. package/dist/single/sort-icon-dc2db9af.svg +0 -8
  255. package/dist/single/sort-up-icon-e10d3fa9.svg +0 -8
  256. package/dist/single/sprite.svg +0 -4
  257. package/dist/single/styles-69c4b948.css +0 -558
  258. package/src/app.js +0 -69
  259. package/src/assets/icons/allure-logo.svg +0 -45
  260. package/src/assets/icons/bamboo.svg +0 -31
  261. package/src/assets/icons/bitbucket.svg +0 -10
  262. package/src/assets/icons/bomb.svg +0 -7
  263. package/src/assets/icons/broken.svg +0 -10
  264. package/src/assets/icons/bug.svg +0 -10
  265. package/src/assets/icons/chevron-down.svg +0 -10
  266. package/src/assets/icons/chevron-left.svg +0 -10
  267. package/src/assets/icons/chevron-right-fat.svg +0 -10
  268. package/src/assets/icons/chevron-right.svg +0 -10
  269. package/src/assets/icons/chevron-up.svg +0 -10
  270. package/src/assets/icons/circleci.svg +0 -1
  271. package/src/assets/icons/close.svg +0 -10
  272. package/src/assets/icons/collapse.svg +0 -5
  273. package/src/assets/icons/compare.svg +0 -10
  274. package/src/assets/icons/copy.svg +0 -11
  275. package/src/assets/icons/csv.svg +0 -13
  276. package/src/assets/icons/download.svg +0 -11
  277. package/src/assets/icons/draggable.svg +0 -15
  278. package/src/assets/icons/expand.svg +0 -5
  279. package/src/assets/icons/failed.svg +0 -10
  280. package/src/assets/icons/file.svg +0 -3
  281. package/src/assets/icons/folder.svg +0 -10
  282. package/src/assets/icons/github.svg +0 -4
  283. package/src/assets/icons/gitlab.svg +0 -12
  284. package/src/assets/icons/graphs.svg +0 -11
  285. package/src/assets/icons/history.svg +0 -11
  286. package/src/assets/icons/image.svg +0 -3
  287. package/src/assets/icons/info.svg +0 -12
  288. package/src/assets/icons/jenkins.svg +0 -327
  289. package/src/assets/icons/jobs.svg +0 -12
  290. package/src/assets/icons/link.svg +0 -11
  291. package/src/assets/icons/list.svg +0 -13
  292. package/src/assets/icons/maximize.svg +0 -11
  293. package/src/assets/icons/new-broken.svg +0 -6
  294. package/src/assets/icons/new-failed.svg +0 -6
  295. package/src/assets/icons/new-passed.svg +0 -5
  296. package/src/assets/icons/overview.svg +0 -5
  297. package/src/assets/icons/passed.svg +0 -10
  298. package/src/assets/icons/pdf.svg +0 -13
  299. package/src/assets/icons/refresh.svg +0 -4
  300. package/src/assets/icons/retries.svg +0 -11
  301. package/src/assets/icons/save.svg +0 -10
  302. package/src/assets/icons/skipped.svg +0 -3
  303. package/src/assets/icons/sort-down.svg +0 -10
  304. package/src/assets/icons/sort-up.svg +0 -10
  305. package/src/assets/icons/sort.svg +0 -11
  306. package/src/assets/icons/table.svg +0 -10
  307. package/src/assets/icons/task.svg +0 -11
  308. package/src/assets/icons/teamcity.svg +0 -40
  309. package/src/assets/icons/timeline.svg +0 -12
  310. package/src/assets/icons/tree.svg +0 -10
  311. package/src/assets/icons/txt.svg +0 -11
  312. package/src/assets/icons/unknown.svg +0 -10
  313. package/src/behaviors/ClipboardBehavior.js +0 -34
  314. package/src/behaviors/DownloadBehavior.js +0 -42
  315. package/src/behaviors/GaBehavior.js +0 -27
  316. package/src/behaviors/LoadBehavior.js +0 -18
  317. package/src/behaviors/TooltipBehavior.js +0 -25
  318. package/src/behaviors/index.js +0 -7
  319. package/src/blocks/alert/styles.scss +0 -8
  320. package/src/blocks/arrow/styles.scss +0 -21
  321. package/src/blocks/attachment-row/attachment-row.hbs +0 -34
  322. package/src/blocks/attachment-row/styles.scss +0 -71
  323. package/src/blocks/bar/styles.scss +0 -22
  324. package/src/blocks/button/styles.scss +0 -60
  325. package/src/blocks/clipboard-copy/clipboard-copy.hbs +0 -5
  326. package/src/blocks/executor-icon/bamboo.svg +0 -31
  327. package/src/blocks/executor-icon/bitbucket.svg +0 -10
  328. package/src/blocks/executor-icon/circleci.svg +0 -1
  329. package/src/blocks/executor-icon/default-icon.png +0 -0
  330. package/src/blocks/executor-icon/github.svg +0 -4
  331. package/src/blocks/executor-icon/gitlab.svg +0 -12
  332. package/src/blocks/executor-icon/jenkins.svg +0 -327
  333. package/src/blocks/executor-icon/styles.scss +0 -15
  334. package/src/blocks/executor-icon/teamcity.svg +0 -40
  335. package/src/blocks/island/styles.scss +0 -7
  336. package/src/blocks/label/styles.scss +0 -15
  337. package/src/blocks/link/styles.scss +0 -10
  338. package/src/blocks/pane/styles.scss +0 -52
  339. package/src/blocks/pane-header/pane-header.hbs +0 -15
  340. package/src/blocks/parameters-table/parameters-table.hbs +0 -10
  341. package/src/blocks/parameters-table/styles.scss +0 -22
  342. package/src/blocks/spinner/styles.scss +0 -30
  343. package/src/blocks/splash/styles.scss +0 -13
  344. package/src/blocks/status-details/status-details.hbs +0 -13
  345. package/src/blocks/status-details/styles.scss +0 -32
  346. package/src/blocks/step-stats/step-stats.hbs +0 -15
  347. package/src/blocks/step-stats/styles.scss +0 -19
  348. package/src/blocks/table/sort-down-icon.svg +0 -1
  349. package/src/blocks/table/sort-icon.svg +0 -1
  350. package/src/blocks/table/sort-up-icon.svg +0 -1
  351. package/src/blocks/table/sortable-col.hbs +0 -4
  352. package/src/blocks/table/styles.scss +0 -64
  353. package/src/blocks/tabs/styles.scss +0 -29
  354. package/src/blocks/tabs/tabs.hbs +0 -5
  355. package/src/blocks/text/styles.scss +0 -5
  356. package/src/blocks/widget/draggable.svg +0 -1
  357. package/src/blocks/widget/styles.scss +0 -76
  358. package/src/components/attachment/AttachmentView.hbs +0 -58
  359. package/src/components/attachment/AttachmentView.js +0 -90
  360. package/src/components/attachment/styles.scss +0 -78
  361. package/src/components/empty/EmptyView.hbs +0 -3
  362. package/src/components/empty/EmptyView.js +0 -18
  363. package/src/components/empty/styles.scss +0 -4
  364. package/src/components/error-splash/ErrorSplashView.hbs +0 -4
  365. package/src/components/error-splash/ErrorSplashView.js +0 -19
  366. package/src/components/error-splash/styles.scss +0 -4
  367. package/src/components/graph-base/BaseChartView.hbs +0 -5
  368. package/src/components/graph-base/BaseChartView.js +0 -78
  369. package/src/components/graph-base/styles.scss +0 -66
  370. package/src/components/graph-duration-chart/DurationChartView.js +0 -100
  371. package/src/components/graph-pie-chart/PieChartView.js +0 -155
  372. package/src/components/graph-severity-chart/SeverityChartView.js +0 -100
  373. package/src/components/graph-trend-chart/TrendChartView.js +0 -202
  374. package/src/components/graph-trend-chart/styles.scss +0 -16
  375. package/src/components/graph-trend-chart/trend-tooltip.hbs +0 -9
  376. package/src/components/language-select/LanguageSelectView.hbs +0 -5
  377. package/src/components/language-select/LanguageSelectView.js +0 -42
  378. package/src/components/language-select/checkmark.svg +0 -1
  379. package/src/components/language-select/styles.scss +0 -34
  380. package/src/components/loader/LoaderView.hbs +0 -6
  381. package/src/components/loader/LoaderView.js +0 -21
  382. package/src/components/loader/styles.scss +0 -26
  383. package/src/components/marks-toggle/MarksToggleView.hbs +0 -14
  384. package/src/components/marks-toggle/MarksToggleView.js +0 -41
  385. package/src/components/marks-toggle/styles.scss +0 -38
  386. package/src/components/modal/styles.scss +0 -31
  387. package/src/components/node-search/NodeSearchView.hbs +0 -4
  388. package/src/components/node-search/NodeSearchView.js +0 -32
  389. package/src/components/node-search/styles.scss +0 -29
  390. package/src/components/node-sorter/NodeSorterView.hbs +0 -22
  391. package/src/components/node-sorter/NodeSorterView.js +0 -43
  392. package/src/components/node-sorter/styles.scss +0 -26
  393. package/src/components/popover/PopoverView.js +0 -8
  394. package/src/components/popover/styles.scss +0 -32
  395. package/src/components/side-by-side/SideBySideView.hbs +0 -2
  396. package/src/components/side-by-side/SideBySideView.js +0 -42
  397. package/src/components/side-by-side/styles.scss +0 -59
  398. package/src/components/side-by-side/vertical.png +0 -0
  399. package/src/components/status-toggle/StatusToggleView.hbs +0 -16
  400. package/src/components/status-toggle/StatusToggleView.js +0 -42
  401. package/src/components/status-toggle/styles.scss +0 -35
  402. package/src/components/testresult-execution/TestResultExecutionView.hbs +0 -13
  403. package/src/components/testresult-execution/TestResultExecutionView.js +0 -85
  404. package/src/components/testresult-execution/stages-block.hbs +0 -47
  405. package/src/components/testresult-execution/steps-list.hbs +0 -31
  406. package/src/components/testresult-execution/styles.scss +0 -70
  407. package/src/components/testresult-overview/TestResultOverviewView.hbs +0 -8
  408. package/src/components/testresult-overview/TestResultOverviewView.js +0 -46
  409. package/src/components/testresult-overview/styles.scss +0 -22
  410. package/src/components/testresult-tree/TestResultTreeView.js +0 -60
  411. package/src/components/tooltip/TooltipView.js +0 -111
  412. package/src/components/tooltip/styles.scss +0 -43
  413. package/src/components/tree/TreeView.hbs +0 -9
  414. package/src/components/tree/TreeView.js +0 -200
  415. package/src/components/tree/styles.scss +0 -141
  416. package/src/components/tree/tree-group.hbs +0 -36
  417. package/src/components/tree/tree-leaf.hbs +0 -53
  418. package/src/components/tree/tree-time.hbs +0 -6
  419. package/src/components/tree-view-container/TreeViewContainer.hbs +0 -34
  420. package/src/components/tree-view-container/TreeViewContainer.js +0 -103
  421. package/src/components/tree-view-container/styles.scss +0 -38
  422. package/src/components/widget-status/WidgetStatusView.hbs +0 -21
  423. package/src/components/widget-status/WidgetStatusView.js +0 -17
  424. package/src/components/widgets-grid/WidgetsGridView.js +0 -90
  425. package/src/components/widgets-grid/styles.scss +0 -34
  426. package/src/data/localstorage/LocalStorageModel.js +0 -23
  427. package/src/data/testresult/TestResultModel.js +0 -36
  428. package/src/data/tree/TreeCollection.js +0 -153
  429. package/src/data/tree/comparator.js +0 -63
  430. package/src/data/tree/filter.js +0 -66
  431. package/src/data/trend/TrendCollection.js +0 -36
  432. package/src/data/widgets/WidgetsModel.js +0 -25
  433. package/src/decorators/index.js +0 -53
  434. package/src/helpers/allure-icon.js +0 -228
  435. package/src/helpers/and.js +0 -3
  436. package/src/helpers/angle.js +0 -15
  437. package/src/helpers/arrow.js +0 -17
  438. package/src/helpers/b.js +0 -6
  439. package/src/helpers/concat.js +0 -3
  440. package/src/helpers/date.js +0 -11
  441. package/src/helpers/default.js +0 -8
  442. package/src/helpers/duration.js +0 -60
  443. package/src/helpers/eq.js +0 -3
  444. package/src/helpers/fileicon.js +0 -5
  445. package/src/helpers/filesize.js +0 -8
  446. package/src/helpers/gt.js +0 -3
  447. package/src/helpers/inc.js +0 -3
  448. package/src/helpers/is-def.js +0 -3
  449. package/src/helpers/job-icon.js +0 -8
  450. package/src/helpers/linky.js +0 -7
  451. package/src/helpers/not.js +0 -3
  452. package/src/helpers/or.js +0 -3
  453. package/src/helpers/sort-class.js +0 -6
  454. package/src/helpers/statistic-bar.js +0 -12
  455. package/src/helpers/status-bar.js +0 -14
  456. package/src/helpers/t.js +0 -5
  457. package/src/helpers/text-with-links.js +0 -18
  458. package/src/helpers/time.js +0 -18
  459. package/src/helpers/timeago.js +0 -10
  460. package/src/layouts/application/AppLayout.hbs +0 -2
  461. package/src/layouts/application/AppLayout.js +0 -50
  462. package/src/layouts/application/styles.scss +0 -17
  463. package/src/layouts/error/ErrorLayout.js +0 -11
  464. package/src/layouts/overview/OverviewLayout.js +0 -8
  465. package/src/layouts/testresult/TestResultLayout.js +0 -43
  466. package/src/layouts/tree/TreeLayout.js +0 -45
  467. package/src/pluginApi.js +0 -26
  468. package/src/plugins/.eslintrc +0 -5
  469. package/src/plugins/default/index.js +0 -11
  470. package/src/plugins/screen-diff/index.js +0 -186
  471. package/src/plugins/screen-diff/styles.css +0 -30
  472. package/src/plugins/tab-behaviors/index.js +0 -239
  473. package/src/plugins/tab-category/index.js +0 -15
  474. package/src/plugins/tab-graph/GraphCollection.js +0 -12
  475. package/src/plugins/tab-graph/GraphLayout.js +0 -17
  476. package/src/plugins/tab-graph/index.js +0 -8
  477. package/src/plugins/tab-packages/index.js +0 -137
  478. package/src/plugins/tab-suites/index.js +0 -15
  479. package/src/plugins/tab-timeline/TimelineLayout.js +0 -18
  480. package/src/plugins/tab-timeline/TimelineView.hbs +0 -17
  481. package/src/plugins/tab-timeline/TimelineView.js +0 -250
  482. package/src/plugins/tab-timeline/index.js +0 -12
  483. package/src/plugins/tab-timeline/styles.scss +0 -76
  484. package/src/plugins/testresult-category/CategoryView.hbs +0 -6
  485. package/src/plugins/testresult-category/CategoryView.js +0 -17
  486. package/src/plugins/testresult-category/index.js +0 -3
  487. package/src/plugins/testresult-description/DescriptionView.hbs +0 -4
  488. package/src/plugins/testresult-description/DescriptionView.js +0 -16
  489. package/src/plugins/testresult-description/index.js +0 -3
  490. package/src/plugins/testresult-duration/DurationView.hbs +0 -7
  491. package/src/plugins/testresult-duration/DurationView.js +0 -16
  492. package/src/plugins/testresult-duration/index.js +0 -3
  493. package/src/plugins/testresult-history/HistoryView.hbs +0 -27
  494. package/src/plugins/testresult-history/HistoryView.js +0 -33
  495. package/src/plugins/testresult-history/index.js +0 -3
  496. package/src/plugins/testresult-history/styles.scss +0 -10
  497. package/src/plugins/testresult-links/LinksView.hbs +0 -17
  498. package/src/plugins/testresult-links/LinksView.js +0 -17
  499. package/src/plugins/testresult-links/index.js +0 -3
  500. package/src/plugins/testresult-links/styles.scss +0 -19
  501. package/src/plugins/testresult-owner/OwnerView.hbs +0 -4
  502. package/src/plugins/testresult-owner/OwnerView.js +0 -17
  503. package/src/plugins/testresult-owner/index.js +0 -3
  504. package/src/plugins/testresult-parameters/ParametersView.hbs +0 -13
  505. package/src/plugins/testresult-parameters/ParametersView.js +0 -22
  506. package/src/plugins/testresult-parameters/index.js +0 -3
  507. package/src/plugins/testresult-parameters/styles.scss +0 -8
  508. package/src/plugins/testresult-retries/RetriesView.hbs +0 -13
  509. package/src/plugins/testresult-retries/RetriesView.js +0 -28
  510. package/src/plugins/testresult-retries/index.js +0 -3
  511. package/src/plugins/testresult-retries/styles.scss +0 -11
  512. package/src/plugins/testresult-severity/SeverityView.hbs +0 -4
  513. package/src/plugins/testresult-severity/SeverityView.js +0 -17
  514. package/src/plugins/testresult-severity/index.js +0 -3
  515. package/src/plugins/testresult-tags/TagsView.hbs +0 -5
  516. package/src/plugins/testresult-tags/TagsView.js +0 -17
  517. package/src/plugins/testresult-tags/index.js +0 -3
  518. package/src/plugins/widget-categories/index.js +0 -12
  519. package/src/plugins/widget-categories-trend/CategoriesTrendWidgetView.hbs +0 -4
  520. package/src/plugins/widget-categories-trend/CategoriesTrendWidgetView.js +0 -33
  521. package/src/plugins/widget-categories-trend/index.js +0 -4
  522. package/src/plugins/widget-categories-trend/styles.scss +0 -6
  523. package/src/plugins/widget-duration/DurationWidgetView.hbs +0 -4
  524. package/src/plugins/widget-duration/DurationWidgetView.js +0 -23
  525. package/src/plugins/widget-duration/index.js +0 -3
  526. package/src/plugins/widget-duration-trend/DurationTrendWidgetView.hbs +0 -4
  527. package/src/plugins/widget-duration-trend/DurationTrendWidgetView.js +0 -49
  528. package/src/plugins/widget-duration-trend/index.js +0 -4
  529. package/src/plugins/widget-duration-trend/styles.scss +0 -6
  530. package/src/plugins/widget-environment/EnvironmentWidget.hbs +0 -27
  531. package/src/plugins/widget-environment/EnvironmentWidget.js +0 -25
  532. package/src/plugins/widget-environment/index.js +0 -3
  533. package/src/plugins/widget-executor/ExecutorsWidgetView.hbs +0 -40
  534. package/src/plugins/widget-executor/ExecutorsWidgetView.js +0 -8
  535. package/src/plugins/widget-executor/index.js +0 -3
  536. package/src/plugins/widget-history-trend/HistoryTrendWidgetView.hbs +0 -4
  537. package/src/plugins/widget-history-trend/HistoryTrendWidgetView.js +0 -30
  538. package/src/plugins/widget-history-trend/index.js +0 -6
  539. package/src/plugins/widget-history-trend/styles.scss +0 -6
  540. package/src/plugins/widget-launch/LaunchesWidgetView.hbs +0 -23
  541. package/src/plugins/widget-launch/LaunchesWidgetView.js +0 -8
  542. package/src/plugins/widget-launch/index.js +0 -3
  543. package/src/plugins/widget-retry-trend/RetryTrendWidgetView.hbs +0 -4
  544. package/src/plugins/widget-retry-trend/RetryTrendWidgetView.js +0 -33
  545. package/src/plugins/widget-retry-trend/index.js +0 -4
  546. package/src/plugins/widget-retry-trend/styles.scss +0 -6
  547. package/src/plugins/widget-severity/SeverityWidgetView.hbs +0 -4
  548. package/src/plugins/widget-severity/SeverityWidgetView.js +0 -23
  549. package/src/plugins/widget-severity/index.js +0 -3
  550. package/src/plugins/widget-status/StatusWidgetView.hbs +0 -4
  551. package/src/plugins/widget-status/StatusWidgetView.js +0 -44
  552. package/src/plugins/widget-status/index.js +0 -3
  553. package/src/plugins/widget-suites/index.js +0 -12
  554. package/src/plugins/widget-summary/SummaryWidgetView.hbs +0 -20
  555. package/src/plugins/widget-summary/SummaryWidgetView.js +0 -33
  556. package/src/plugins/widget-summary/index.js +0 -3
  557. package/src/plugins/widget-summary/styles.scss +0 -14
  558. package/src/router.js +0 -52
  559. package/src/utils/arrays.js +0 -3
  560. package/src/utils/attachmentType.js +0 -101
  561. package/src/utils/clipboard.js +0 -38
  562. package/src/utils/escape.js +0 -5
  563. package/src/utils/gtag.js +0 -8
  564. package/src/utils/highlight.js +0 -14
  565. package/src/utils/hotkeys.js +0 -25
  566. package/src/utils/loading.js +0 -9
  567. package/src/utils/marks.js +0 -1
  568. package/src/utils/pluginsRegistry.js +0 -56
  569. package/src/utils/settings.js +0 -4
  570. package/src/utils/settingsFactory.js +0 -149
  571. package/src/utils/sorting.js +0 -21
  572. package/src/utils/translation.js +0 -63
  573. package/webpack/utils.js +0 -10
  574. /package/src/components/{modal → Modal}/ModalView.hbs +0 -0
  575. /package/src/components/{modal → Modal}/ModalView.js +0 -0
  576. /package/src/components/{side-nav → SideNav}/SideNavView.hbs +0 -0
  577. /package/src/components/{side-nav → SideNav}/SideNavView.js +0 -0
  578. /package/src/components/{testresult → TestResult}/TestResultView.hbs +0 -0
  579. /package/src/components/{testresult → TestResult}/styles.scss +0 -0
@@ -0,0 +1,84 @@
1
+ import { getReportOptions } from "@allurereport/web-commons";
2
+ import { computed, signal } from "@preact/signals";
3
+ import i18next, { type TOptions } from "i18next";
4
+ import { DEFAULT_LOCALE, LANG_LOCALE, type LangLocale } from "@/translations/constants";
5
+ import type { ClassicReportOptions } from "../../types.js";
6
+
7
+ const { reportLanguage } = getReportOptions<ClassicReportOptions>() ?? {};
8
+
9
+ const namespaces = [
10
+ "empty",
11
+ "execution",
12
+ "filters",
13
+ "search",
14
+ "severity",
15
+ "sort-by",
16
+ "sort-by.directions",
17
+ "sort-by.values",
18
+ "statuses",
19
+ "tabs",
20
+ "testSummary",
21
+ "ui",
22
+ "welcome",
23
+ "controls",
24
+ "errors",
25
+ "nav",
26
+ "charts",
27
+ ];
28
+
29
+ export const currentLocale = signal<LangLocale>("" as LangLocale);
30
+
31
+ export const currentLocaleIso = computed(() => {
32
+ const locale = currentLocale.value;
33
+
34
+ return LANG_LOCALE[locale].iso;
35
+ });
36
+
37
+ export const currentLocaleIsRTL = computed(() => {
38
+ return ["ar", "he", "fa"].includes(currentLocale.value as string);
39
+ });
40
+
41
+ export const getLocale = () => {
42
+ const locale = localStorage.getItem("currentLocale") || reportLanguage || DEFAULT_LOCALE;
43
+ setLocale(locale as LangLocale);
44
+ };
45
+
46
+ i18next
47
+ .use({
48
+ type: "backend",
49
+ read: async (
50
+ language: LangLocale,
51
+ namespace: string,
52
+ callback: (errorValue: unknown, translations: Record<string, string> | null) => void,
53
+ ) => {
54
+ try {
55
+ const resources = await import(`@/translations/${language}.json`);
56
+ callback(null, (resources[namespace] as Record<string, string>) || null);
57
+ } catch (error) {
58
+ callback(error, null);
59
+ }
60
+ },
61
+ })
62
+ .init({
63
+ lng: currentLocale.value,
64
+ fallbackLng: "en",
65
+ ns: namespaces,
66
+ interpolation: {
67
+ escapeValue: false,
68
+ },
69
+ });
70
+
71
+ export const useI18n = (namespace?: string) => {
72
+ const t = computed(() => (key: string, options?: TOptions) => i18next.t(key, { ns: namespace, ...options }));
73
+
74
+ return {
75
+ t: t.value,
76
+ currentLocale: currentLocale.value,
77
+ };
78
+ };
79
+
80
+ export const setLocale = async (locale: LangLocale) => {
81
+ await i18next.changeLanguage(locale);
82
+ localStorage.setItem("currentLocale", locale);
83
+ currentLocale.value = locale;
84
+ };
@@ -0,0 +1,127 @@
1
+ import { fetchReportJsonData } from "@allurereport/web-commons";
2
+ import { computed, signal } from "@preact/signals";
3
+ import type { ClassicStatus, ClassicTree, ClassicTreeGroup } from "types";
4
+ import type { StoreSignalState } from "@/stores/types";
5
+ import { createRecursiveTree, isRecursiveTreeEmpty } from "@/utils/treeFilters";
6
+
7
+ export type TreeSortBy = "order" | "duration" | "status" | "alphabet";
8
+ export type TreeDirection = "asc" | "desc";
9
+ export type TreeFilters = "flaky" | "retry" | "new";
10
+ export type TreeFiltersState = {
11
+ query: string;
12
+ status: ClassicStatus;
13
+ filter: Record<TreeFilters, boolean>;
14
+ sortBy: TreeSortBy;
15
+ direction: TreeDirection;
16
+ };
17
+
18
+ export const packagesStore = signal<StoreSignalState<ClassicTree>>({
19
+ loading: true,
20
+ error: undefined,
21
+ data: undefined,
22
+ });
23
+
24
+ export const noTests = computed(() => !Object.keys(packagesStore?.value?.data?.leavesById).length);
25
+
26
+ export const packagesFiltersStore = signal<TreeFiltersState>({
27
+ query: "",
28
+ status: "total",
29
+ filter: {
30
+ flaky: false,
31
+ retry: false,
32
+ new: false,
33
+ },
34
+ sortBy: "order",
35
+ direction: "asc",
36
+ });
37
+
38
+ export const filteredPackages = computed(() => {
39
+ const { root, leavesById, groupsById } = packagesStore.value.data;
40
+
41
+ return createRecursiveTree({
42
+ group: root as ClassicTreeGroup,
43
+ leavesById,
44
+ groupsById,
45
+ filterOptions: packagesFiltersStore.value,
46
+ });
47
+ });
48
+
49
+ export const noTestsFound = computed(() => {
50
+ return isRecursiveTreeEmpty(filteredPackages.value);
51
+ });
52
+
53
+ export const clearPackagesFilters = () => {
54
+ packagesFiltersStore.value = {
55
+ query: "",
56
+ status: "total",
57
+ filter: {
58
+ flaky: false,
59
+ retry: false,
60
+ new: false,
61
+ },
62
+ sortBy: "order",
63
+ direction: "asc",
64
+ };
65
+ };
66
+
67
+ export const setPackagesQuery = (query: string) => {
68
+ packagesFiltersStore.value = {
69
+ ...packagesFiltersStore.value,
70
+ query,
71
+ };
72
+ };
73
+
74
+ export const setPackagesStatus = (status: ClassicStatus) => {
75
+ packagesFiltersStore.value = {
76
+ ...packagesFiltersStore.value,
77
+ status,
78
+ };
79
+ };
80
+
81
+ export const setPackagesSortBy = (sortBy: TreeSortBy) => {
82
+ packagesFiltersStore.value = {
83
+ ...packagesFiltersStore.value,
84
+ sortBy,
85
+ };
86
+ };
87
+
88
+ export const setPackagesDirection = (direction: TreeDirection) => {
89
+ packagesFiltersStore.value = {
90
+ ...packagesFiltersStore.value,
91
+ direction,
92
+ };
93
+ };
94
+
95
+ export const setPackagesFilter = (filterKey: TreeFilters, value: boolean) => {
96
+ packagesFiltersStore.value = {
97
+ ...packagesFiltersStore.value,
98
+ filter: {
99
+ ...packagesFiltersStore.value.filter,
100
+ [filterKey]: value,
101
+ },
102
+ };
103
+ };
104
+
105
+ export const fetchPackagesData = async () => {
106
+ packagesStore.value = {
107
+ ...packagesStore.value,
108
+ loading: true,
109
+ error: undefined,
110
+ };
111
+
112
+ try {
113
+ const res = await fetchReportJsonData<ClassicTree>("widgets/packages.json", { bustCache: true });
114
+
115
+ packagesStore.value = {
116
+ data: res,
117
+ error: undefined,
118
+ loading: false,
119
+ };
120
+ } catch (e) {
121
+ packagesStore.value = {
122
+ ...packagesStore.value,
123
+ error: e.message,
124
+ loading: false,
125
+ };
126
+ }
127
+ };
@@ -0,0 +1,55 @@
1
+ import { computed, signal } from "@preact/signals";
2
+
3
+ type NavigateToString = string;
4
+ type NavigateToObject = {
5
+ tabName?: string;
6
+ params?: {
7
+ id?: string | null;
8
+ testResultId?: string | null;
9
+ };
10
+ };
11
+
12
+ const parseHash = () => {
13
+ const hash = globalThis.location.hash.slice(1);
14
+ const [tabName, ...params] = hash.split("/");
15
+ return {
16
+ tabName: tabName,
17
+ params: { id: params[0] || null, testResultId: params[1] || null },
18
+ };
19
+ };
20
+
21
+ export const route = signal(parseHash());
22
+
23
+ export const handleHashChange = () => {
24
+ const newRoute = parseHash();
25
+
26
+ if (
27
+ newRoute.tabName !== route.value.tabName ||
28
+ newRoute.params.id !== route.value.params.id ||
29
+ newRoute.params.testResultId !== route.value.params.testResultId
30
+ ) {
31
+ route.value = newRoute;
32
+ }
33
+ };
34
+
35
+ export const navigateTo = (path: NavigateToString | NavigateToObject) => {
36
+ let newHash = "";
37
+
38
+ if (typeof path === "string") {
39
+ newHash = path.startsWith("#") ? path.slice(1) : path;
40
+ } else {
41
+ const { tabName = "overview", params = {} } = path;
42
+ const { id = null, testResultId = null } = params;
43
+ newHash = `${tabName}/${id || ""}/${testResultId || ""}`;
44
+ }
45
+
46
+ history.pushState(null, "", `#${newHash}`);
47
+
48
+ handleHashChange();
49
+ };
50
+
51
+ export const openInNewTab = (path: string) => {
52
+ window.open(`#${path}`, "_blank");
53
+ };
54
+
55
+ export const activeTab = computed(() => route.value.tabName);
@@ -0,0 +1,36 @@
1
+ import type { Statistic } from "@allurereport/core-api";
2
+ import { fetchReportJsonData } from "@allurereport/web-commons";
3
+ import { signal } from "@preact/signals";
4
+ import type { StoreSignalState } from "@/stores/types";
5
+
6
+ export const statsStore = signal<StoreSignalState<Statistic>>({
7
+ loading: true,
8
+ error: undefined,
9
+ data: {
10
+ total: 0,
11
+ },
12
+ });
13
+
14
+ export const fetchStats = async () => {
15
+ statsStore.value = {
16
+ ...statsStore.value,
17
+ loading: true,
18
+ error: undefined,
19
+ };
20
+
21
+ try {
22
+ const res = await fetchReportJsonData<Statistic>("widgets/allure_statistic.json", { bustCache: true });
23
+
24
+ statsStore.value = {
25
+ data: res,
26
+ error: undefined,
27
+ loading: false,
28
+ };
29
+ } catch (err) {
30
+ statsStore.value = {
31
+ data: { total: 0 },
32
+ error: err.message,
33
+ loading: false,
34
+ };
35
+ }
36
+ };
@@ -0,0 +1,7 @@
1
+ import { signal } from "@preact/signals";
2
+
3
+ export const currentTab = signal<string | undefined>("total");
4
+
5
+ export const setCurrentTab = (tab: string) => {
6
+ currentTab.value = tab;
7
+ };
@@ -0,0 +1,66 @@
1
+ import { fetchReportJsonData } from "@allurereport/web-commons";
2
+ import { signal } from "@preact/signals";
3
+ import { type ClassicTestResult } from "types";
4
+ import { type StoreSignalState } from "./types";
5
+
6
+ export type TestResultsStoreState = Record<string, ClassicTestResult>;
7
+
8
+ export type TestResultNavStoreState = string[];
9
+
10
+ export const testResultStore = signal<StoreSignalState<TestResultsStoreState>>({
11
+ loading: true,
12
+ error: undefined,
13
+ data: undefined,
14
+ });
15
+
16
+ export const testResultNavStore = signal<StoreSignalState<TestResultNavStoreState>>({
17
+ loading: true,
18
+ error: undefined,
19
+ data: undefined,
20
+ });
21
+
22
+ export const fetchTestResultNav = async () => {
23
+ try {
24
+ const data = await fetchReportJsonData<string[]>("widgets/nav.json", { bustCache: true });
25
+
26
+ testResultNavStore.value = {
27
+ data,
28
+ error: undefined,
29
+ loading: false,
30
+ };
31
+ } catch (err) {
32
+ testResultNavStore.value = {
33
+ ...testResultNavStore.value,
34
+ error: err.message,
35
+ loading: false,
36
+ };
37
+ }
38
+ };
39
+
40
+ export const fetchTestResult = async (testResultId: string) => {
41
+ if (!testResultId) {
42
+ return;
43
+ }
44
+
45
+ testResultStore.value = {
46
+ ...testResultStore.value,
47
+ loading: true,
48
+ error: undefined,
49
+ };
50
+
51
+ try {
52
+ const data = await fetchReportJsonData<ClassicTestResult>(`data/test-results/${testResultId}.json`);
53
+
54
+ testResultStore.value = {
55
+ data: { ...testResultStore.value.data, [testResultId]: data },
56
+ error: undefined,
57
+ loading: false,
58
+ };
59
+ } catch (err) {
60
+ testResultStore.value = {
61
+ ...testResultStore.value,
62
+ error: err.message,
63
+ loading: false,
64
+ };
65
+ }
66
+ };
@@ -0,0 +1,30 @@
1
+ import { getReportOptions } from "@allurereport/web-commons";
2
+ import type { Theme } from "@allurereport/web-components";
3
+ import { signal } from "@preact/signals";
4
+ import type { ClassicReportOptions } from "../../types.js";
5
+
6
+ export const themeStore = signal<Theme>("auto");
7
+
8
+ export const setTheme = (mode: "light" | "dark" | "auto") => {
9
+ themeStore.value = mode;
10
+
11
+ try {
12
+ window.localStorage.setItem("theme", mode);
13
+ } catch {}
14
+
15
+ document.documentElement.setAttribute("data-theme", mode);
16
+ };
17
+
18
+ export const toggleTheme = () => {
19
+ const order = ["light", "dark", "auto"];
20
+ const current = themeStore.value;
21
+ const next = order[(order.indexOf(current) + 1) % order.length] as Theme;
22
+ setTheme(next);
23
+ };
24
+
25
+ export const getTheme = () => {
26
+ const { theme } = getReportOptions<ClassicReportOptions>() ?? {};
27
+ const themeFromLS = (window.localStorage.getItem("theme") as Theme | null) || (theme as Theme);
28
+
29
+ setTheme(themeFromLS);
30
+ };
@@ -0,0 +1,127 @@
1
+ import { fetchReportJsonData } from "@allurereport/web-commons";
2
+ import { computed, signal } from "@preact/signals";
3
+ import type { ClassicStatus, ClassicTree, ClassicTreeGroup } from "types";
4
+ import type { StoreSignalState } from "@/stores/types";
5
+ import { createRecursiveTree, isRecursiveTreeEmpty } from "@/utils/treeFilters";
6
+
7
+ export type TreeSortBy = "order" | "duration" | "status" | "alphabet";
8
+ export type TreeDirection = "asc" | "desc";
9
+ export type TreeFilters = "flaky" | "retry" | "new";
10
+ export type TreeFiltersState = {
11
+ query: string;
12
+ status: ClassicStatus;
13
+ filter: Record<TreeFilters, boolean>;
14
+ sortBy: TreeSortBy;
15
+ direction: TreeDirection;
16
+ };
17
+
18
+ export const treeStore = signal<StoreSignalState<ClassicTree>>({
19
+ loading: true,
20
+ error: undefined,
21
+ data: undefined,
22
+ });
23
+
24
+ export const noTests = computed(() => !Object.keys(treeStore?.value?.data?.leavesById).length);
25
+
26
+ export const treeFiltersStore = signal<TreeFiltersState>({
27
+ query: "",
28
+ status: "total",
29
+ filter: {
30
+ flaky: false,
31
+ retry: false,
32
+ new: false,
33
+ },
34
+ sortBy: "order",
35
+ direction: "asc",
36
+ });
37
+
38
+ export const filteredTree = computed(() => {
39
+ const { root, leavesById, groupsById } = treeStore.value.data;
40
+
41
+ return createRecursiveTree({
42
+ group: root as ClassicTreeGroup,
43
+ leavesById,
44
+ groupsById,
45
+ filterOptions: treeFiltersStore.value,
46
+ });
47
+ });
48
+
49
+ export const noTestsFound = computed(() => {
50
+ return isRecursiveTreeEmpty(filteredTree.value);
51
+ });
52
+
53
+ export const clearTreeFilters = () => {
54
+ treeFiltersStore.value = {
55
+ query: "",
56
+ status: "total",
57
+ filter: {
58
+ flaky: false,
59
+ retry: false,
60
+ new: false,
61
+ },
62
+ sortBy: "order",
63
+ direction: "asc",
64
+ };
65
+ };
66
+
67
+ export const setTreeQuery = (query: string) => {
68
+ treeFiltersStore.value = {
69
+ ...treeFiltersStore.value,
70
+ query,
71
+ };
72
+ };
73
+
74
+ export const setTreeStatus = (status: ClassicStatus) => {
75
+ treeFiltersStore.value = {
76
+ ...treeFiltersStore.value,
77
+ status,
78
+ };
79
+ };
80
+
81
+ export const setTreeSortBy = (sortBy: TreeSortBy) => {
82
+ treeFiltersStore.value = {
83
+ ...treeFiltersStore.value,
84
+ sortBy,
85
+ };
86
+ };
87
+
88
+ export const setTreeDirection = (direction: TreeDirection) => {
89
+ treeFiltersStore.value = {
90
+ ...treeFiltersStore.value,
91
+ direction,
92
+ };
93
+ };
94
+
95
+ export const setTreeFilter = (filterKey: TreeFilters, value: boolean) => {
96
+ treeFiltersStore.value = {
97
+ ...treeFiltersStore.value,
98
+ filter: {
99
+ ...treeFiltersStore.value.filter,
100
+ [filterKey]: value,
101
+ },
102
+ };
103
+ };
104
+
105
+ export const fetchTreeData = async () => {
106
+ treeStore.value = {
107
+ ...treeStore.value,
108
+ loading: true,
109
+ error: undefined,
110
+ };
111
+
112
+ try {
113
+ const res = await fetchReportJsonData<ClassicTree>("widgets/tree.json", { bustCache: true });
114
+
115
+ treeStore.value = {
116
+ data: res,
117
+ error: undefined,
118
+ loading: false,
119
+ };
120
+ } catch (e) {
121
+ treeStore.value = {
122
+ ...treeStore.value,
123
+ error: e.message,
124
+ loading: false,
125
+ };
126
+ }
127
+ };
@@ -0,0 +1,36 @@
1
+ import { createCharts, fetchReportJsonData } from "@allurereport/web-commons";
2
+ import type { ChartsData, ChartsResponse, UIChartsData } from "@allurereport/web-commons";
3
+ import { signal } from "@preact/signals";
4
+ import type { StoreSignalState } from "@/stores/types";
5
+
6
+ export const trendStore = signal<StoreSignalState<UIChartsData>>({
7
+ loading: true,
8
+ error: undefined,
9
+ data: undefined,
10
+ });
11
+
12
+ export const fetchTrendData = async () => {
13
+ trendStore.value = {
14
+ ...trendStore.value,
15
+ loading: true,
16
+ error: undefined,
17
+ };
18
+
19
+ try {
20
+ const res = await fetchReportJsonData<ChartsResponse>("widgets/charts.json", { bustCache: true });
21
+
22
+ const data = "general" in res && "byEnv" in res ? res.general : res;
23
+
24
+ trendStore.value = {
25
+ data: createCharts(data as ChartsData),
26
+ error: undefined,
27
+ loading: false,
28
+ };
29
+ } catch (err) {
30
+ trendStore.value = {
31
+ data: undefined,
32
+ error: err.message,
33
+ loading: false,
34
+ };
35
+ }
36
+ };
@@ -0,0 +1,5 @@
1
+ export interface StoreSignalState<T> {
2
+ error?: string;
3
+ loading: boolean;
4
+ data?: T;
5
+ }