@allurereport/web-awesome 3.0.0-beta.3

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 (263) hide show
  1. package/.babelrc.js +46 -0
  2. package/.eslintrc.cjs +15 -0
  3. package/README.md +27 -0
  4. package/dist/multi/141.app-b6362ca0.js +1 -0
  5. package/dist/multi/222.app-b6362ca0.js +1 -0
  6. package/dist/multi/335.app-b6362ca0.js +1 -0
  7. package/dist/multi/34.app-b6362ca0.js +1 -0
  8. package/dist/multi/349.app-b6362ca0.js +1 -0
  9. package/dist/multi/378.app-b6362ca0.js +1 -0
  10. package/dist/multi/406.app-b6362ca0.js +1 -0
  11. package/dist/multi/476.app-b6362ca0.js +1 -0
  12. package/dist/multi/53.app-b6362ca0.js +1 -0
  13. package/dist/multi/584.app-b6362ca0.js +1 -0
  14. package/dist/multi/690.app-b6362ca0.js +1 -0
  15. package/dist/multi/747.app-b6362ca0.js +1 -0
  16. package/dist/multi/767.app-b6362ca0.js +1 -0
  17. package/dist/multi/816.app-b6362ca0.js +1 -0
  18. package/dist/multi/83.app-b6362ca0.js +1 -0
  19. package/dist/multi/873.app-b6362ca0.js +1 -0
  20. package/dist/multi/920.app-b6362ca0.js +1 -0
  21. package/dist/multi/991.app-b6362ca0.js +1 -0
  22. package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
  23. package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
  24. package/dist/multi/app-b6362ca0.js +2 -0
  25. package/dist/multi/app-b6362ca0.js.LICENSE.txt +16 -0
  26. package/dist/multi/manifest.json +26 -0
  27. package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
  28. package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
  29. package/dist/multi/styles-b6362ca0.css +363 -0
  30. package/dist/single/app-57ae0a60.js +2 -0
  31. package/dist/single/app-57ae0a60.js.LICENSE.txt +16 -0
  32. package/dist/single/manifest.json +3 -0
  33. package/package.json +93 -0
  34. package/postcss.config.js +5 -0
  35. package/src/assets/fonts/JetBrainsMono_vf.woff +0 -0
  36. package/src/assets/fonts/JetBrainsMono_vf.woff2 +0 -0
  37. package/src/assets/fonts/pt-root-ui_vf.woff +0 -0
  38. package/src/assets/fonts/pt-root-ui_vf.woff2 +0 -0
  39. package/src/assets/scss/_common.scss +134 -0
  40. package/src/assets/scss/code.css +71 -0
  41. package/src/assets/scss/day.scss +51 -0
  42. package/src/assets/scss/fonts.scss +21 -0
  43. package/src/assets/scss/index.scss +9 -0
  44. package/src/assets/scss/mixins.scss +26 -0
  45. package/src/assets/scss/night.scss +61 -0
  46. package/src/assets/scss/palette.scss +393 -0
  47. package/src/assets/scss/theme.scss +117 -0
  48. package/src/assets/scss/typography.scss +218 -0
  49. package/src/assets/scss/vars.scss +8 -0
  50. package/src/assets/svg/arrows-chevron-down.svg +5 -0
  51. package/src/assets/svg/github.svg +5 -0
  52. package/src/assets/svg/line-alerts-notification-box.svg +3 -0
  53. package/src/assets/svg/line-arrows-chevron-down-double.svg +3 -0
  54. package/src/assets/svg/line-arrows-chevron-down.svg +3 -0
  55. package/src/assets/svg/line-arrows-chevron-right.svg +3 -0
  56. package/src/assets/svg/line-arrows-chevron-up-double.svg +3 -0
  57. package/src/assets/svg/line-arrows-chevron-up.svg +3 -0
  58. package/src/assets/svg/line-arrows-corner-down-right.svg +3 -0
  59. package/src/assets/svg/line-arrows-expand-3.svg +3 -0
  60. package/src/assets/svg/line-arrows-refresh-ccw-1.svg +3 -0
  61. package/src/assets/svg/line-arrows-sort-line-asc.svg +3 -0
  62. package/src/assets/svg/line-arrows-sort-line-desc.svg +3 -0
  63. package/src/assets/svg/line-arrows-switch-vertical-1.svg +3 -0
  64. package/src/assets/svg/line-dev-bug-2.svg +3 -0
  65. package/src/assets/svg/line-dev-code-square.svg +3 -0
  66. package/src/assets/svg/line-files-file-attachment-2.svg +3 -0
  67. package/src/assets/svg/line-general-check.svg +3 -0
  68. package/src/assets/svg/line-general-checklist3.svg +3 -0
  69. package/src/assets/svg/line-general-copy-3.svg +3 -0
  70. package/src/assets/svg/line-general-download-cloud.svg +3 -0
  71. package/src/assets/svg/line-general-equal.svg +3 -0
  72. package/src/assets/svg/line-general-home-line.svg +3 -0
  73. package/src/assets/svg/line-general-link-1.svg +3 -0
  74. package/src/assets/svg/line-general-link-external.svg +3 -0
  75. package/src/assets/svg/line-general-search-md.svg +3 -0
  76. package/src/assets/svg/line-general-settings-1.svg +3 -0
  77. package/src/assets/svg/line-general-x-close.svg +3 -0
  78. package/src/assets/svg/line-general-zap.svg +3 -0
  79. package/src/assets/svg/line-helpers-flag.svg +4 -0
  80. package/src/assets/svg/line-helpers-play-circle.svg +4 -0
  81. package/src/assets/svg/line-images-image.svg +3 -0
  82. package/src/assets/svg/line-security-key.svg +3 -0
  83. package/src/assets/svg/line-shapes-dot-circle.svg +3 -0
  84. package/src/assets/svg/line-shapes-moon.svg +3 -0
  85. package/src/assets/svg/line-shapes-sun.svg +3 -0
  86. package/src/assets/svg/line-time-clock-stopwatch.svg +3 -0
  87. package/src/assets/svg/report-logo.svg +64 -0
  88. package/src/assets/svg/solid-alert-circle.svg +3 -0
  89. package/src/assets/svg/solid-check-circle.svg +3 -0
  90. package/src/assets/svg/solid-help-circle.svg +3 -0
  91. package/src/assets/svg/solid-minus-circle.svg +3 -0
  92. package/src/assets/svg/solid-x-circle.svg +3 -0
  93. package/src/assets/svg/spinner.svg +18 -0
  94. package/src/assets/svg/view-off.svg +12 -0
  95. package/src/assets/svg/view.svg +11 -0
  96. package/src/components/app/ArrowButton/index.tsx +36 -0
  97. package/src/components/app/ArrowButton/styles.scss +32 -0
  98. package/src/components/app/BaseLayout/index.tsx +60 -0
  99. package/src/components/app/BaseLayout/styles.scss +60 -0
  100. package/src/components/app/Footer/FooterLogo.tsx +16 -0
  101. package/src/components/app/Footer/FooterVersion.tsx +27 -0
  102. package/src/components/app/Footer/index.tsx +13 -0
  103. package/src/components/app/Footer/styles.scss +14 -0
  104. package/src/components/app/Header/index.tsx +17 -0
  105. package/src/components/app/Header/styles.scss +26 -0
  106. package/src/components/app/LanguagePicker/index.tsx +41 -0
  107. package/src/components/app/MainReport/index.tsx +19 -0
  108. package/src/components/app/Metadata/index.tsx +114 -0
  109. package/src/components/app/Metadata/styles.scss +146 -0
  110. package/src/components/app/MetadataButton/index.tsx +33 -0
  111. package/src/components/app/MetadataButton/styles.scss +53 -0
  112. package/src/components/app/Modal/index.tsx +184 -0
  113. package/src/components/app/Modal/styles.scss +126 -0
  114. package/src/components/app/ReportBody/Filters.tsx +94 -0
  115. package/src/components/app/ReportBody/HeaderActions.tsx +21 -0
  116. package/src/components/app/ReportBody/SortBy.tsx +134 -0
  117. package/src/components/app/ReportBody/context.tsx +107 -0
  118. package/src/components/app/ReportBody/index.tsx +71 -0
  119. package/src/components/app/ReportBody/styles.scss +64 -0
  120. package/src/components/app/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  121. package/src/components/app/ReportHeader/ReportHeaderLogo.tsx +10 -0
  122. package/src/components/app/ReportHeader/ReportHeaderPie.tsx +14 -0
  123. package/src/components/app/ReportHeader/index.tsx +33 -0
  124. package/src/components/app/ReportHeader/styles.scss +49 -0
  125. package/src/components/app/ReportLogo/index.tsx +17 -0
  126. package/src/components/app/ReportLogo/styles.scss +20 -0
  127. package/src/components/app/ReportLogoFull/index.tsx +21 -0
  128. package/src/components/app/ReportLogoFull/styles.scss +7 -0
  129. package/src/components/app/ReportMetadata/MetadataItem.tsx +45 -0
  130. package/src/components/app/ReportMetadata/MetadataSummary.tsx +79 -0
  131. package/src/components/app/ReportMetadata/MetadataTestType.tsx +16 -0
  132. package/src/components/app/ReportMetadata/MetadataWithIcon.tsx +25 -0
  133. package/src/components/app/ReportMetadata/index.tsx +46 -0
  134. package/src/components/app/ReportMetadata/styles.scss +99 -0
  135. package/src/components/app/Tabs/index.tsx +58 -0
  136. package/src/components/app/Tabs/styles.scss +56 -0
  137. package/src/components/app/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  138. package/src/components/app/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  139. package/src/components/app/TestResult/TestResultDescription/index.tsx +27 -0
  140. package/src/components/app/TestResult/TestResultDescription/styles.scss +12 -0
  141. package/src/components/app/TestResult/TestResultDropdown/index.tsx +19 -0
  142. package/src/components/app/TestResult/TestResultDropdown/styles.scss +34 -0
  143. package/src/components/app/TestResult/TestResultEmpty/index.tsx +34 -0
  144. package/src/components/app/TestResult/TestResultEmpty/styles.scss +25 -0
  145. package/src/components/app/TestResult/TestResultError/index.tsx +51 -0
  146. package/src/components/app/TestResult/TestResultError/styles.scss +40 -0
  147. package/src/components/app/TestResult/TestResultHeader/index.tsx +55 -0
  148. package/src/components/app/TestResult/TestResultHeader/styles.scss +43 -0
  149. package/src/components/app/TestResult/TestResultHistory/TestResultHistoryItem.tsx +57 -0
  150. package/src/components/app/TestResult/TestResultHistory/index.tsx +26 -0
  151. package/src/components/app/TestResult/TestResultHistory/styles.scss +63 -0
  152. package/src/components/app/TestResult/TestResultInfo/index.tsx +79 -0
  153. package/src/components/app/TestResult/TestResultInfo/styles.scss +33 -0
  154. package/src/components/app/TestResult/TestResultLinks/index.tsx +60 -0
  155. package/src/components/app/TestResult/TestResultLinks/styles.scss +30 -0
  156. package/src/components/app/TestResult/TestResultMetadata/index.tsx +27 -0
  157. package/src/components/app/TestResult/TestResultMetadata/styles.scss +8 -0
  158. package/src/components/app/TestResult/TestResultNavigation/index.tsx +89 -0
  159. package/src/components/app/TestResult/TestResultNavigation/styles.scss +48 -0
  160. package/src/components/app/TestResult/TestResultOverview.tsx +40 -0
  161. package/src/components/app/TestResult/TestResultParameters/index.tsx +30 -0
  162. package/src/components/app/TestResult/TestResultParameters/styles.scss +8 -0
  163. package/src/components/app/TestResult/TestResultPrevStatuses/index.tsx +52 -0
  164. package/src/components/app/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  165. package/src/components/app/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +50 -0
  166. package/src/components/app/TestResult/TestResultRetriesView/index.tsx +24 -0
  167. package/src/components/app/TestResult/TestResultRetriesView/styles.scss +69 -0
  168. package/src/components/app/TestResult/TestResultSetup/index.tsx +50 -0
  169. package/src/components/app/TestResult/TestResultSeverity/index.tsx +34 -0
  170. package/src/components/app/TestResult/TestResultSeverity/styles.scss +29 -0
  171. package/src/components/app/TestResult/TestResultStatus/index.tsx +26 -0
  172. package/src/components/app/TestResult/TestResultStatus/styles.scss +36 -0
  173. package/src/components/app/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
  174. package/src/components/app/TestResult/TestResultSteps/attachment.tsx +70 -0
  175. package/src/components/app/TestResult/TestResultSteps/attachmentCode.tsx +15 -0
  176. package/src/components/app/TestResult/TestResultSteps/attachmentImage.tsx +29 -0
  177. package/src/components/app/TestResult/TestResultSteps/attachmentVideo.tsx +12 -0
  178. package/src/components/app/TestResult/TestResultSteps/index.tsx +49 -0
  179. package/src/components/app/TestResult/TestResultSteps/styles.scss +225 -0
  180. package/src/components/app/TestResult/TestResultSteps/testResultAttachment.tsx +79 -0
  181. package/src/components/app/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +87 -0
  182. package/src/components/app/TestResult/TestResultSteps/testResultStep.tsx +71 -0
  183. package/src/components/app/TestResult/TestResultSteps/testResultStepInfo.tsx +33 -0
  184. package/src/components/app/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  185. package/src/components/app/TestResult/TestResultTabs/index.tsx +59 -0
  186. package/src/components/app/TestResult/TestResultTabs/styles.scss +76 -0
  187. package/src/components/app/TestResult/TestResultTeardown/index.tsx +49 -0
  188. package/src/components/app/TestResult/index.tsx +56 -0
  189. package/src/components/app/ThemeButton/ThemeButton.tsx +22 -0
  190. package/src/components/app/Tree/Tree.tsx +122 -0
  191. package/src/components/app/Tree/TreeHeader.tsx +81 -0
  192. package/src/components/app/Tree/TreeItem.tsx +31 -0
  193. package/src/components/app/Tree/TreeItemIcon.tsx +35 -0
  194. package/src/components/app/Tree/index.tsx +40 -0
  195. package/src/components/app/Tree/styles.scss +170 -0
  196. package/src/components/commons/Button/index.tsx +176 -0
  197. package/src/components/commons/Button/styles.scss +558 -0
  198. package/src/components/commons/Counter/index.tsx +29 -0
  199. package/src/components/commons/Counter/styles.scss +21 -0
  200. package/src/components/commons/Label/index.tsx +11 -0
  201. package/src/components/commons/Label/styles.scss +7 -0
  202. package/src/components/commons/Link/index.tsx +20 -0
  203. package/src/components/commons/Link/styles.scss +46 -0
  204. package/src/components/commons/Loadable/index.tsx +32 -0
  205. package/src/components/commons/Menu/index.tsx +173 -0
  206. package/src/components/commons/Menu/styles.scss +94 -0
  207. package/src/components/commons/PageLoader/index.tsx +10 -0
  208. package/src/components/commons/PageLoader/styles.scss +29 -0
  209. package/src/components/commons/SearchBox/index.tsx +61 -0
  210. package/src/components/commons/SearchBox/styles.scss +58 -0
  211. package/src/components/commons/Spinner/index.tsx +8 -0
  212. package/src/components/commons/SuccessRatePieChart/index.tsx +52 -0
  213. package/src/components/commons/SuccessRatePieChart/styles.scss +12 -0
  214. package/src/components/commons/SvgIcon/index.tsx +46 -0
  215. package/src/components/commons/SvgIcon/styles.scss +26 -0
  216. package/src/components/commons/Toggle/index.tsx +29 -0
  217. package/src/components/commons/Toggle/styles.scss +48 -0
  218. package/src/components/commons/Tooltip/index.tsx +123 -0
  219. package/src/components/commons/Tooltip/styles.scss +38 -0
  220. package/src/components/commons/Typography/index.tsx +99 -0
  221. package/src/hooks/useDebouncedCallback.ts +31 -0
  222. package/src/i18n/constants.ts +105 -0
  223. package/src/i18n/locales/am.json +115 -0
  224. package/src/i18n/locales/az.json +115 -0
  225. package/src/i18n/locales/de.json +115 -0
  226. package/src/i18n/locales/en.json +115 -0
  227. package/src/i18n/locales/es.json +114 -0
  228. package/src/i18n/locales/fr.json +115 -0
  229. package/src/i18n/locales/he.json +115 -0
  230. package/src/i18n/locales/it.json +115 -0
  231. package/src/i18n/locales/ja.json +115 -0
  232. package/src/i18n/locales/ka.json +115 -0
  233. package/src/i18n/locales/kr.json +115 -0
  234. package/src/i18n/locales/nl.json +115 -0
  235. package/src/i18n/locales/pl.json +113 -0
  236. package/src/i18n/locales/pt.json +115 -0
  237. package/src/i18n/locales/ru.json +113 -0
  238. package/src/i18n/locales/sv.json +115 -0
  239. package/src/i18n/locales/tr.json +115 -0
  240. package/src/i18n/locales/zh.json +115 -0
  241. package/src/index.html +35 -0
  242. package/src/index.tsx +48 -0
  243. package/src/stores/chart.ts +32 -0
  244. package/src/stores/envInfo.ts +34 -0
  245. package/src/stores/index.ts +4 -0
  246. package/src/stores/locale.ts +79 -0
  247. package/src/stores/stats.ts +36 -0
  248. package/src/stores/testResults.ts +40 -0
  249. package/src/stores/theme.ts +33 -0
  250. package/src/stores/tree.ts +33 -0
  251. package/src/stores/types.ts +5 -0
  252. package/src/types/globals.d.ts +8 -0
  253. package/src/types/window.d.ts +8 -0
  254. package/src/utils/attachments.ts +156 -0
  255. package/src/utils/capitalize.ts +4 -0
  256. package/src/utils/copyToClipboard.ts +3 -0
  257. package/src/utils/isMac.ts +7 -0
  258. package/src/utils/statuses.ts +55 -0
  259. package/src/utils/time.ts +17 -0
  260. package/src/utils/treeFilters.ts +150 -0
  261. package/tsconfig.json +25 -0
  262. package/types.d.ts +53 -0
  263. package/webpack.config.js +108 -0
@@ -0,0 +1,53 @@
1
+ .report-metadata-header-arrow {
2
+ opacity: 1;
3
+ transform: rotate(-90deg);
4
+ }
5
+
6
+ .report-metadata-header-arrow-opened {
7
+ transform: rotate(0);
8
+ }
9
+
10
+ .report-metadata-header {
11
+ width: max-content;
12
+ display: flex;
13
+ align-items: center;
14
+ gap: 8px;
15
+ cursor: pointer;
16
+ position: relative;
17
+ transition:
18
+ background-color 200ms,
19
+ opacity 200ms;
20
+
21
+ margin: 6px 0;
22
+
23
+ &:after {
24
+ content: "";
25
+ padding: 6px 8px;
26
+ border-radius: 8px;
27
+ left: -8px;
28
+ top: -6px;
29
+ position: absolute;
30
+ width: calc(100% + 16px);
31
+ height: calc(100% + 12px);
32
+ z-index: 0;
33
+ background-color: transparent;
34
+ transition: background-color 200ms;
35
+ }
36
+
37
+ &:hover {
38
+ &:after {
39
+ background-color: var(--bg-control-flat-medium);
40
+ }
41
+
42
+ .report-metadata-header-arrow {
43
+ opacity: 1;
44
+ }
45
+ }
46
+ }
47
+
48
+ .report-metadata-header-opened {
49
+ .report-metadata-header-arrow {
50
+ transform: rotate(0);
51
+ opacity: 0;
52
+ }
53
+ }
@@ -0,0 +1,184 @@
1
+ import type { AttachmentTestStepResult } from "@allurereport/core-api";
2
+ import { signal } from "@preact/signals";
3
+ import type { FunctionalComponent, VNode } from "preact";
4
+ import { useEffect } from "preact/hooks";
5
+ import Prism from "prismjs";
6
+ import LineGeneralDownloadCloud from "@/assets/svg/line-general-download-cloud.svg";
7
+ import LineGeneralCopy from "@/assets/svg/line-general-link-external.svg";
8
+ import LineGeneralXClose from "@/assets/svg/line-general-x-close.svg";
9
+ import ViewOffIcon from "@/assets/svg/view-off.svg";
10
+ import ViewIcon from "@/assets/svg/view.svg";
11
+ import { Attachment } from "@/components/app/TestResult/TestResultSteps/attachment";
12
+ import { Button, IconButton } from "@/components/commons/Button";
13
+ import { TooltipWrapper } from "@/components/commons/Tooltip";
14
+ import { Heading } from "@/components/commons/Typography";
15
+ import { attachmentType, downloadAttachment, openAttachmentInNewTab } from "@/utils/attachments";
16
+ import type { AllureAwesomeTestResult } from "../../../../types.js";
17
+ import * as styles from "./styles.scss";
18
+
19
+ export const isModalOpen = signal(false);
20
+
21
+ interface ModalDataProps {
22
+ data: AttachmentTestStepResult;
23
+ component: VNode;
24
+ preview?: boolean;
25
+ }
26
+
27
+ export const modalData = signal<ModalDataProps>({
28
+ data: null,
29
+ preview: false,
30
+ component: null,
31
+ });
32
+
33
+ const openModal = ({ data, component, preview }: ModalDataProps) => {
34
+ modalData.value = {
35
+ data,
36
+ component,
37
+ preview,
38
+ };
39
+ isModalOpen.value = true;
40
+ };
41
+
42
+ const closeModal = () => {
43
+ isModalOpen.value = false;
44
+ };
45
+
46
+ const ModalThumb = ({ item, children }) => {
47
+ const isActiveThumb = modalData.value.data?.link?.id === item.link?.id;
48
+
49
+ const showAttach = (showedItem: AttachmentTestStepResult) => {
50
+ openModal({
51
+ data: showedItem,
52
+ component: <Attachment item={showedItem} key={showedItem.link?.id} />,
53
+ });
54
+ };
55
+
56
+ return (
57
+ <div
58
+ className={`${styles["modal-thumb"]} ${isActiveThumb ? styles.active : ""}`}
59
+ onClick={() => showAttach(item as AttachmentTestStepResult)}
60
+ >
61
+ {children}
62
+ </div>
63
+ );
64
+ };
65
+
66
+ export type ModalGalleryProps = {
67
+ attachments: AttachmentTestStepResult[];
68
+ };
69
+
70
+ const ModalGallery: FunctionalComponent<ModalGalleryProps> = ({ attachments = [] }) => {
71
+ const filteredAttachments = attachments.filter(({ link: { contentType } }: AttachmentTestStepResult) => {
72
+ const type = attachmentType(contentType).type;
73
+
74
+ return !["archive", null].includes(type as string);
75
+ });
76
+
77
+ return (
78
+ <div className={styles["modal-gallery"]}>
79
+ {filteredAttachments.map((item, index) => (
80
+ <ModalThumb item={item} key={index}>
81
+ <Attachment item={item} />
82
+ </ModalThumb>
83
+ ))}
84
+ </div>
85
+ );
86
+ };
87
+
88
+ export type ModalProps = {
89
+ testResult: AllureAwesomeTestResult;
90
+ };
91
+
92
+ const Modal: FunctionalComponent<ModalProps> = ({ testResult }) => {
93
+ const { link } = modalData.value.data || {};
94
+ const attachName = link?.name ? `${link?.name}` : `${link?.id}${link?.ext}`;
95
+
96
+ useEffect(() => {
97
+ Prism.highlightAll();
98
+
99
+ if (isModalOpen.value) {
100
+ document.body.style.overflow = "hidden";
101
+ } else {
102
+ document.body.style.overflow = "";
103
+ }
104
+
105
+ return () => {
106
+ document.body.style.overflow = "";
107
+ };
108
+ }, []);
109
+
110
+ const isImageAttachment = link?.contentType?.startsWith("image");
111
+ const isHtmlAttachment = link?.contentType === "text/html";
112
+ const downloadData = async (e: Event) => {
113
+ e.stopPropagation();
114
+ const { id, ext, contentType } = link || {};
115
+ if (id && ext && contentType) {
116
+ await downloadAttachment(id, ext, contentType);
117
+ }
118
+ };
119
+ const openInNewWindow = async () => {
120
+ const { id, ext, contentType } = link || {};
121
+ await openAttachmentInNewTab(id, ext, contentType);
122
+ };
123
+
124
+ if (!isModalOpen.value) {
125
+ return null;
126
+ }
127
+
128
+ return (
129
+ <div className={styles["modal-overlay"]} onClick={closeModal}>
130
+ <div className={styles["modal-content"]} onClick={(e) => e.stopPropagation()}>
131
+ <div className={`${styles["modal-wrapper"]}`}>
132
+ <div className={styles["modal-top"]}>
133
+ <Heading size={"s"}>{attachName}</Heading>
134
+ <div className={styles["modal-buttons"]}>
135
+ {isImageAttachment && (
136
+ <Button
137
+ style={"outline"}
138
+ onClick={openInNewWindow}
139
+ icon={LineGeneralCopy.id}
140
+ text={"Open in new tab"}
141
+ />
142
+ )}
143
+ {isHtmlAttachment && (
144
+ <TooltipWrapper tooltipText={"Preview attachment"}>
145
+ <IconButton
146
+ style={"outline"}
147
+ size={"m"}
148
+ iconSize={"s"}
149
+ icon={modalData.value.preview ? ViewOffIcon.id : ViewIcon.id}
150
+ onClick={() => {
151
+ modalData.value = {
152
+ ...modalData.value,
153
+ preview: !modalData.value.preview,
154
+ };
155
+ }}
156
+ />
157
+ </TooltipWrapper>
158
+ )}
159
+ <TooltipWrapper tooltipText={"Download attachment"}>
160
+ <IconButton
161
+ style={"outline"}
162
+ size={"m"}
163
+ iconSize={"s"}
164
+ icon={LineGeneralDownloadCloud.id}
165
+ onClick={(e: MouseEvent) => downloadData(e)}
166
+ />
167
+ </TooltipWrapper>
168
+ <IconButton iconSize={"m"} style={"ghost"} onClick={closeModal} icon={LineGeneralXClose.id} />
169
+ </div>
170
+ </div>
171
+ <div className={styles["modal-data"]}>
172
+ <div className={styles["modal-data-component"]} key={modalData.value?.data?.link?.id}>
173
+ {modalData.value?.component}
174
+ </div>
175
+ </div>
176
+ </div>
177
+ <ModalGallery attachments={testResult.attachments} />
178
+ </div>
179
+ </div>
180
+ );
181
+ };
182
+
183
+ export { openModal, closeModal };
184
+ export default Modal;
@@ -0,0 +1,126 @@
1
+ .modal-overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ background: var(--ad-other-modal-overlay);
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ z-index: 1000;
12
+ }
13
+
14
+ .modal-content {
15
+ position: relative;
16
+ display: flex;
17
+ flex-direction: column;
18
+ justify-content: center;
19
+ align-items: center;
20
+ gap: 16px;
21
+ max-width: 90%;
22
+ max-height: 90%;
23
+ }
24
+
25
+ .modal-wrapper {
26
+ position: relative;
27
+ background: var(--bg-base-primary);
28
+ max-width: 90%;
29
+ max-height: 80vh;
30
+ width: 90vw;
31
+ min-width: 320px;
32
+ min-height: 320px;
33
+ display: flex;
34
+ border-radius: 16px;
35
+ align-items: center;
36
+ flex-direction: column;
37
+ justify-content: center;
38
+ overflow: hidden;
39
+ z-index: 1;
40
+ overflow-y: auto;
41
+ }
42
+
43
+ .modal-data-component {
44
+ flex: 1 1 auto;
45
+ overflow-y: auto;
46
+ pointer-events: all;
47
+ padding-top: 56px;
48
+ }
49
+
50
+ .modal-image {
51
+ max-width: 100%;
52
+ max-height: 100%;
53
+ }
54
+
55
+ .close-button-wrap {
56
+ position: absolute;
57
+ top: 0;
58
+ right: 0;
59
+ cursor: pointer;
60
+ z-index: 1;
61
+ }
62
+
63
+ .modal-buttons {
64
+ display: flex;
65
+ gap: 8px;
66
+ margin-left: auto;
67
+ }
68
+
69
+ .modal-button {
70
+ }
71
+
72
+ .modal-data {
73
+ width: 100%;
74
+ height: 100%;
75
+ overflow-y: auto;
76
+ pointer-events: none;
77
+ display: flex;
78
+ position: relative;
79
+ }
80
+
81
+ .modal-top {
82
+ display: flex;
83
+ align-items: center;
84
+ justify-content: space-between;
85
+ width: calc(100% - 32px);
86
+ position: absolute;
87
+ top: 16px;
88
+ left: 16px;
89
+ z-index: 1;
90
+ }
91
+
92
+ .modal-bottom {
93
+ z-index: 1;
94
+ display: flex;
95
+ align-items: center;
96
+ justify-content: flex-end;
97
+ width: 100%;
98
+ position: absolute;
99
+ bottom: 0;
100
+ color: var(--gray-neutral-0);
101
+ }
102
+
103
+ .modal-thumb {
104
+ display: flex;
105
+ justify-content: center;
106
+ width: 64px;
107
+ height: 64px;
108
+ border-radius: 12px;
109
+ background: var(--constant-bg-base-primary-night);
110
+ overflow: hidden;
111
+ border: 1px solid transparent;
112
+ cursor: pointer;
113
+ user-select: none;
114
+
115
+ &.active {
116
+ border: 1px solid var(--constant-on-border-heavy);
117
+ }
118
+ }
119
+
120
+ .modal-gallery {
121
+ display: flex;
122
+ width: 100%;
123
+ gap: 8px;
124
+ justify-content: center;
125
+ flex-wrap: wrap;
126
+ }
@@ -0,0 +1,94 @@
1
+ import notificationBoxIcon from "@/assets/svg/line-alerts-notification-box.svg";
2
+ import refreshIcon from "@/assets/svg/line-arrows-refresh-ccw-1.svg";
3
+ import settingsIcon from "@/assets/svg/line-general-settings-1.svg";
4
+ import zapIcon from "@/assets/svg/line-general-zap.svg";
5
+ import { useReportContentContext } from "@/components/app/ReportBody/context";
6
+ import { Button } from "@/components/commons/Button";
7
+ import { Menu } from "@/components/commons/Menu";
8
+ import { Toggle } from "@/components/commons/Toggle";
9
+ import { useI18n } from "@/stores/locale";
10
+ import * as styles from "./styles.scss";
11
+
12
+ export const Filters = () => {
13
+ const { t } = useI18n("filters");
14
+ const { filter, setFilter } = useReportContentContext();
15
+
16
+ const { flaky, retry, new: isNew } = filter;
17
+ const hasFilter = flaky || retry || isNew;
18
+
19
+ return (
20
+ <Menu
21
+ menuTrigger={({ isOpened, onClick }) => (
22
+ <div className={hasFilter && styles.filtersBtnWithFilters}>
23
+ <Button
24
+ icon={settingsIcon.id}
25
+ text={t("more-filters")}
26
+ size="m"
27
+ style="outline"
28
+ isActive={isOpened}
29
+ onClick={onClick}
30
+ />
31
+ </div>
32
+ )}
33
+ >
34
+ <Menu.Section>
35
+ <Menu.Item
36
+ closeMenuOnClick={false}
37
+ ariaLabel={t("enable-filter", { filter: t("flaky") })}
38
+ onClick={() => {
39
+ setFilter("flaky", !flaky);
40
+ }}
41
+ leadingIcon={zapIcon.id}
42
+ rightSlot={
43
+ <div className={styles.filterToggle}>
44
+ <Toggle
45
+ focusable={false}
46
+ value={flaky}
47
+ label={t("enable-filter", { filter: t("flaky") })}
48
+ onChange={(value) => setFilter("flaky", value)}
49
+ />
50
+ </div>
51
+ }
52
+ >
53
+ {t("flaky")}
54
+ </Menu.Item>
55
+ <Menu.Item
56
+ closeMenuOnClick={false}
57
+ ariaLabel={t("enable-filter", { filter: t("retry") })}
58
+ onClick={() => setFilter("retry", !retry)}
59
+ leadingIcon={refreshIcon.id}
60
+ rightSlot={
61
+ <div className={styles.filterToggle}>
62
+ <Toggle
63
+ focusable={false}
64
+ value={retry}
65
+ label={t("enable-filter", { filter: t("retry") })}
66
+ onChange={(value) => setFilter("retry", value)}
67
+ />
68
+ </div>
69
+ }
70
+ >
71
+ {t("retry")}
72
+ </Menu.Item>
73
+ <Menu.Item
74
+ closeMenuOnClick={false}
75
+ ariaLabel={t("enable-filter", { filter: t("new") })}
76
+ onClick={() => setFilter("new", !isNew)}
77
+ leadingIcon={notificationBoxIcon.id}
78
+ rightSlot={
79
+ <div className={styles.filterToggle}>
80
+ <Toggle
81
+ focusable={false}
82
+ value={isNew}
83
+ label={t("enable-filter", { filter: t("new") })}
84
+ onChange={(value) => setFilter("new", value)}
85
+ />
86
+ </div>
87
+ }
88
+ >
89
+ {t("new")}
90
+ </Menu.Item>
91
+ </Menu.Section>
92
+ </Menu>
93
+ );
94
+ };
@@ -0,0 +1,21 @@
1
+ import { useI18n } from "@/stores/locale";
2
+ import { SearchBox } from "../../commons/SearchBox";
3
+ import { Filters } from "./Filters";
4
+ import { useReportContentContext } from "./context";
5
+ import * as styles from "./styles.scss";
6
+
7
+ const Search = () => {
8
+ const { setQuery, query } = useReportContentContext();
9
+ const { t } = useI18n("search");
10
+
11
+ return <SearchBox placeholder={t("search-placeholder")} value={query} onChange={setQuery} />;
12
+ };
13
+
14
+ export const HeaderActions = () => {
15
+ return (
16
+ <div className={styles.headerActions}>
17
+ <Search />
18
+ <Filters />
19
+ </div>
20
+ );
21
+ };
@@ -0,0 +1,134 @@
1
+ import clsx from "clsx";
2
+ import { ComponentChildren } from "preact";
3
+ import lineChevronDownIcon from "@/assets/svg/line-arrows-chevron-down.svg";
4
+ import sortAscIcon from "@/assets/svg/line-arrows-sort-line-asc.svg";
5
+ import sortDescIcon from "@/assets/svg/line-arrows-sort-line-desc.svg";
6
+ import switchVerticalIcon from "@/assets/svg/line-arrows-switch-vertical-1.svg";
7
+ import { useI18n } from "@/stores/locale";
8
+ import { DropdownButton } from "../../commons/Button";
9
+ import { Link } from "../../commons/Link";
10
+ import { Menu } from "../../commons/Menu";
11
+ import { SvgIcon } from "../../commons/SvgIcon";
12
+ import { Text } from "../../commons/Typography";
13
+ import { useReportContentContext } from "./context";
14
+ import * as styles from "./styles.scss";
15
+
16
+ const BtnWrapper = ({ children }: { children: ComponentChildren }) => {
17
+ return <div className={styles.sortByBtnWrap}>{children}</div>;
18
+ };
19
+
20
+ export const SortBy = () => {
21
+ const { t: sortByLocale } = useI18n("sort-by");
22
+ const { t: sortByValuesLocale } = useI18n("sort-by.values");
23
+ const { t: sortByDirectionsLocale } = useI18n("sort-by.directions");
24
+ const { direction, sortBy, setSortBy, setDirection } = useReportContentContext();
25
+
26
+ const displayedSortByValue = sortByValuesLocale(sortBy);
27
+ const displayedDirection = sortByDirectionsLocale(`${sortBy}-${direction}-short`);
28
+
29
+ return (
30
+ <div>
31
+ <Text type="paragraph" size="m" className={styles.sortByText}>
32
+ {sortByLocale("sort-by-text")}
33
+ &nbsp;
34
+ <Menu
35
+ size="l"
36
+ menuTriggerWrapper="span"
37
+ menuTrigger={({ onClick, isOpened }) => (
38
+ <Text type="paragraph" size="m">
39
+ <Link onClick={onClick}>
40
+ {displayedSortByValue} {displayedDirection}
41
+ <SvgIcon
42
+ size="s"
43
+ id={lineChevronDownIcon.id}
44
+ className={clsx(styles.sortByIcon, isOpened && styles.sortByIconReversed)}
45
+ />
46
+ </Link>
47
+ </Text>
48
+ )}
49
+ >
50
+ <Menu.Section>
51
+ <Menu
52
+ size="s"
53
+ menuTrigger={({ onClick, isOpened }) => (
54
+ <Menu.Item
55
+ closeMenuOnClick={false}
56
+ onClick={onClick}
57
+ leadingIcon={switchVerticalIcon.id}
58
+ rightSlot={
59
+ <BtnWrapper>
60
+ <DropdownButton
61
+ style="outline"
62
+ size="s"
63
+ isExpanded={isOpened}
64
+ text={displayedSortByValue}
65
+ focusable={false}
66
+ />
67
+ </BtnWrapper>
68
+ }
69
+ >
70
+ {sortByLocale("sort-by-category")}
71
+ </Menu.Item>
72
+ )}
73
+ >
74
+ <Menu.Section>
75
+ <Menu.ItemWithCheckmark onClick={() => setSortBy("order")} isChecked={sortBy === "order"}>
76
+ {sortByValuesLocale("order")}
77
+ </Menu.ItemWithCheckmark>
78
+ <Menu.ItemWithCheckmark onClick={() => setSortBy("duration")} isChecked={sortBy === "duration"}>
79
+ {sortByValuesLocale("duration")}
80
+ </Menu.ItemWithCheckmark>
81
+ <Menu.ItemWithCheckmark onClick={() => setSortBy("status")} isChecked={sortBy === "status"}>
82
+ {sortByValuesLocale("status")}
83
+ </Menu.ItemWithCheckmark>
84
+ <Menu.ItemWithCheckmark onClick={() => setSortBy("alphabet")} isChecked={sortBy === "alphabet"}>
85
+ {sortByValuesLocale("alphabet")}
86
+ </Menu.ItemWithCheckmark>
87
+ </Menu.Section>
88
+ </Menu>
89
+ <Menu
90
+ size="m"
91
+ menuTrigger={({ onClick, isOpened }) => (
92
+ <Menu.Item
93
+ closeMenuOnClick={false}
94
+ onClick={onClick}
95
+ leadingIcon={direction == "asc" ? sortAscIcon.id : sortDescIcon.id}
96
+ rightSlot={
97
+ <BtnWrapper>
98
+ <DropdownButton
99
+ style="outline"
100
+ size="s"
101
+ isExpanded={isOpened}
102
+ text={displayedDirection}
103
+ focusable={false}
104
+ />
105
+ </BtnWrapper>
106
+ }
107
+ >
108
+ {sortByLocale("direction-category")}
109
+ </Menu.Item>
110
+ )}
111
+ >
112
+ <Menu.Section>
113
+ <Menu.ItemWithCheckmark
114
+ onClick={() => setDirection("asc")}
115
+ leadingIcon={sortAscIcon.id}
116
+ isChecked={direction === "asc"}
117
+ >
118
+ {sortByDirectionsLocale(`${sortBy}-asc`)}
119
+ </Menu.ItemWithCheckmark>
120
+ <Menu.ItemWithCheckmark
121
+ onClick={() => setDirection("desc")}
122
+ leadingIcon={sortDescIcon.id}
123
+ isChecked={direction === "desc"}
124
+ >
125
+ {sortByDirectionsLocale(`${sortBy}-desc`)}
126
+ </Menu.ItemWithCheckmark>
127
+ </Menu.Section>
128
+ </Menu>
129
+ </Menu.Section>
130
+ </Menu>
131
+ </Text>
132
+ </div>
133
+ );
134
+ };