@allurereport/web-classic 3.0.0-beta.10

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 (241) hide show
  1. package/.babelrc--old.cjs +18 -0
  2. package/.babelrc.js +46 -0
  3. package/.eslintrc--old.cjs +125 -0
  4. package/.eslintrc.cjs +22 -0
  5. package/README.md +27 -0
  6. package/dist/multi/10.app-970f027d.js +1 -0
  7. package/dist/multi/222.app-970f027d.js +1 -0
  8. package/dist/multi/26.app-970f027d.js +1 -0
  9. package/dist/multi/302.app-970f027d.js +1 -0
  10. package/dist/multi/304.app-970f027d.js +1 -0
  11. package/dist/multi/369.app-970f027d.js +1 -0
  12. package/dist/multi/389.app-970f027d.js +1 -0
  13. package/dist/multi/498.app-970f027d.js +1 -0
  14. package/dist/multi/60.app-970f027d.js +1 -0
  15. package/dist/multi/643.app-970f027d.js +1 -0
  16. package/dist/multi/671.app-970f027d.js +1 -0
  17. package/dist/multi/725.app-970f027d.js +1 -0
  18. package/dist/multi/770.app-970f027d.js +1 -0
  19. package/dist/multi/848.app-970f027d.js +1 -0
  20. package/dist/multi/853.app-970f027d.js +1 -0
  21. package/dist/multi/872.app-970f027d.js +1 -0
  22. package/dist/multi/895.app-970f027d.js +1 -0
  23. package/dist/multi/920.app-970f027d.js +1 -0
  24. package/dist/multi/979.app-970f027d.js +1 -0
  25. package/dist/multi/991.app-970f027d.js +1 -0
  26. package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
  27. package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
  28. package/dist/multi/app-970f027d.js +2 -0
  29. package/dist/multi/app-970f027d.js.LICENSE.txt +25 -0
  30. package/dist/multi/manifest.json +28 -0
  31. package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
  32. package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
  33. package/dist/multi/styles-970f027d.css +283 -0
  34. package/dist/single/app-2babff54.js +2 -0
  35. package/dist/single/app-2babff54.js.LICENSE.txt +25 -0
  36. package/dist/single/manifest.json +3 -0
  37. package/package--old.json +106 -0
  38. package/package.json +107 -0
  39. package/postcss.config.js +5 -0
  40. package/src/assets/scss/_common.scss +142 -0
  41. package/src/assets/scss/code.scss +71 -0
  42. package/src/assets/scss/day.scss +51 -0
  43. package/src/assets/scss/fonts.scss +3 -0
  44. package/src/assets/scss/index.scss +9 -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/components/ArrowButton/index.tsx +36 -0
  51. package/src/components/ArrowButton/styles.scss +35 -0
  52. package/src/components/BaseLayout/index.tsx +23 -0
  53. package/src/components/BaseLayout/styles.scss +63 -0
  54. package/src/components/Behaviors/BehaviorsList.tsx +67 -0
  55. package/src/components/Behaviors/index.tsx +60 -0
  56. package/src/components/Behaviors/styles.scss +196 -0
  57. package/src/components/Categories/CategoriesList.tsx +67 -0
  58. package/src/components/Categories/index.tsx +60 -0
  59. package/src/components/Categories/styles.scss +196 -0
  60. package/src/components/Footer/FooterLogo.tsx +16 -0
  61. package/src/components/Footer/FooterVersion.tsx +33 -0
  62. package/src/components/Footer/index.tsx +13 -0
  63. package/src/components/Footer/styles.scss +14 -0
  64. package/src/components/Graphs/index.tsx +2 -0
  65. package/src/components/Header/index.tsx +14 -0
  66. package/src/components/Header/styles.scss +26 -0
  67. package/src/components/HeaderActions/Filters.tsx +90 -0
  68. package/src/components/HeaderActions/HeaderActions.tsx +59 -0
  69. package/src/components/HeaderActions/SortBy.tsx +128 -0
  70. package/src/components/HeaderActions/styles.scss +82 -0
  71. package/src/components/LanguagePicker/index.tsx +41 -0
  72. package/src/components/LanguagePicker/styles.scss +3 -0
  73. package/src/components/MainReport/index.tsx +19 -0
  74. package/src/components/Metadata/index.tsx +121 -0
  75. package/src/components/Metadata/styles.scss +146 -0
  76. package/src/components/MetadataButton/index.tsx +32 -0
  77. package/src/components/MetadataButton/styles.scss +53 -0
  78. package/src/components/Modal/ModalView.hbs +13 -0
  79. package/src/components/Modal/ModalView.js +43 -0
  80. package/src/components/Modal/index.tsx +174 -0
  81. package/src/components/Modal/styles.scss +126 -0
  82. package/src/components/Overview/index.tsx +9 -0
  83. package/src/components/Packages/PackagesList.tsx +67 -0
  84. package/src/components/Packages/index.tsx +59 -0
  85. package/src/components/Packages/styles.scss +196 -0
  86. package/src/components/ReportBody/Filters.tsx +92 -0
  87. package/src/components/ReportBody/HeaderActions.tsx +21 -0
  88. package/src/components/ReportBody/SortBy.tsx +132 -0
  89. package/src/components/ReportBody/context.tsx +106 -0
  90. package/src/components/ReportBody/index.tsx +71 -0
  91. package/src/components/ReportBody/styles.scss +64 -0
  92. package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
  93. package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
  94. package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
  95. package/src/components/ReportHeader/index.tsx +33 -0
  96. package/src/components/ReportHeader/styles.scss +49 -0
  97. package/src/components/ReportLogo/index.tsx +16 -0
  98. package/src/components/ReportLogo/styles.scss +20 -0
  99. package/src/components/ReportLogoFull/index.tsx +20 -0
  100. package/src/components/ReportLogoFull/styles.scss +7 -0
  101. package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
  102. package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
  103. package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
  104. package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
  105. package/src/components/ReportMetadata/index.tsx +46 -0
  106. package/src/components/ReportMetadata/styles.scss +99 -0
  107. package/src/components/SideBySide/index.tsx +54 -0
  108. package/src/components/SideBySide/styles.scss +59 -0
  109. package/src/components/SideNav/SideNav.tsx +78 -0
  110. package/src/components/SideNav/SideNavView.hbs +39 -0
  111. package/src/components/SideNav/SideNavView.js +81 -0
  112. package/src/components/SideNav/styles.scss +126 -0
  113. package/src/components/Suites/index.tsx +62 -0
  114. package/src/components/Suites/styles.scss +10 -0
  115. package/src/components/Tabs/index.tsx +33 -0
  116. package/src/components/Tabs/styles.scss +56 -0
  117. package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
  118. package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
  119. package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
  120. package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
  121. package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
  122. package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
  123. package/src/components/TestResult/TestResultEmpty/index.tsx +33 -0
  124. package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
  125. package/src/components/TestResult/TestResultError/index.tsx +48 -0
  126. package/src/components/TestResult/TestResultError/styles.scss +51 -0
  127. package/src/components/TestResult/TestResultHeader/index.tsx +53 -0
  128. package/src/components/TestResult/TestResultHeader/styles.scss +43 -0
  129. package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +67 -0
  130. package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
  131. package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
  132. package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
  133. package/src/components/TestResult/TestResultInfo/index.tsx +79 -0
  134. package/src/components/TestResult/TestResultInfo/styles.scss +50 -0
  135. package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
  136. package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
  137. package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
  138. package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
  139. package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
  140. package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
  141. package/src/components/TestResult/TestResultOverview.tsx +40 -0
  142. package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
  143. package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
  144. package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
  145. package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
  146. package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +49 -0
  147. package/src/components/TestResult/TestResultRetriesView/index.tsx +20 -0
  148. package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
  149. package/src/components/TestResult/TestResultSetup/index.tsx +49 -0
  150. package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
  151. package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
  152. package/src/components/TestResult/TestResultStatus/index.tsx +26 -0
  153. package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
  154. package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
  155. package/src/components/TestResult/TestResultSteps/attachment.tsx +68 -0
  156. package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +20 -0
  157. package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +32 -0
  158. package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
  159. package/src/components/TestResult/TestResultSteps/index.tsx +49 -0
  160. package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
  161. package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +77 -0
  162. package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
  163. package/src/components/TestResult/TestResultSteps/testResultStep.tsx +78 -0
  164. package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
  165. package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
  166. package/src/components/TestResult/TestResultTabs/index.tsx +59 -0
  167. package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
  168. package/src/components/TestResult/TestResultTeardown/index.tsx +49 -0
  169. package/src/components/TestResult/TestResultView.hbs +32 -0
  170. package/src/components/TestResult/TestResultView.js +90 -0
  171. package/src/components/TestResult/index.tsx +54 -0
  172. package/src/components/TestResult/styles.scss +29 -0
  173. package/src/components/TestResultView/index.tsx +31 -0
  174. package/src/components/ThemeButton/ThemeButton.tsx +20 -0
  175. package/src/components/Timeline/index.tsx +2 -0
  176. package/src/components/Tree/Tree.tsx +76 -0
  177. package/src/components/Tree/TreeHeader.tsx +82 -0
  178. package/src/components/Tree/TreeItem.tsx +49 -0
  179. package/src/components/Tree/TreeItemIcon.tsx +32 -0
  180. package/src/components/Tree/index.tsx +60 -0
  181. package/src/components/Tree/styles.scss +185 -0
  182. package/src/favicon.ico +0 -0
  183. package/src/index.html +40 -0
  184. package/src/index.js +52 -0
  185. package/src/index.tsx +60 -0
  186. package/src/mixins.scss +128 -0
  187. package/src/rtl.scss +19 -0
  188. package/src/stores/behaviors.ts +127 -0
  189. package/src/stores/categories.ts +127 -0
  190. package/src/stores/chart.ts +32 -0
  191. package/src/stores/envInfo.ts +34 -0
  192. package/src/stores/index.ts +4 -0
  193. package/src/stores/locale.ts +83 -0
  194. package/src/stores/packages.ts +127 -0
  195. package/src/stores/router.ts +55 -0
  196. package/src/stores/stats.ts +36 -0
  197. package/src/stores/tabs.ts +7 -0
  198. package/src/stores/testResults.ts +66 -0
  199. package/src/stores/theme.ts +33 -0
  200. package/src/stores/tree.ts +127 -0
  201. package/src/stores/types.ts +5 -0
  202. package/src/styles.scss +91 -0
  203. package/src/translations/am.json +127 -0
  204. package/src/translations/az.json +127 -0
  205. package/src/translations/br.json +214 -0
  206. package/src/translations/constants.ts +124 -0
  207. package/src/translations/de.json +127 -0
  208. package/src/translations/en.json +128 -0
  209. package/src/translations/es.json +118 -0
  210. package/src/translations/fr.json +118 -0
  211. package/src/translations/he.json +118 -0
  212. package/src/translations/isv.json +216 -0
  213. package/src/translations/it.json +118 -0
  214. package/src/translations/ja.json +118 -0
  215. package/src/translations/ka.json +118 -0
  216. package/src/translations/kr.json +118 -0
  217. package/src/translations/nl.json +118 -0
  218. package/src/translations/pl.json +116 -0
  219. package/src/translations/pt.json +118 -0
  220. package/src/translations/ru.json +116 -0
  221. package/src/translations/sv.json +118 -0
  222. package/src/translations/tr.json +118 -0
  223. package/src/translations/zh.json +118 -0
  224. package/src/types/globals.d.ts +13 -0
  225. package/src/types/window.d.ts +8 -0
  226. package/src/utils/attachments.ts +156 -0
  227. package/src/utils/capitalize.ts +6 -0
  228. package/src/utils/copyToClipboard.ts +16 -0
  229. package/src/utils/isMac.ts +8 -0
  230. package/src/utils/navigate.ts +7 -0
  231. package/src/utils/statuses.js +1 -0
  232. package/src/utils/statuses.ts +55 -0
  233. package/src/utils/time.ts +17 -0
  234. package/src/utils/treeFilters.ts +139 -0
  235. package/src/variables.scss +71 -0
  236. package/test/utils/treeFilters.test.ts +448 -0
  237. package/tsconfig.json +25 -0
  238. package/types.d.ts +85 -0
  239. package/vitest.config.ts +18 -0
  240. package/webpack.config--old.js +127 -0
  241. package/webpack.config.js +108 -0
@@ -0,0 +1,45 @@
1
+ import { Text } from "@allurereport/web-components";
2
+ import { clsx } from "clsx";
3
+ import type { FunctionalComponent } from "preact";
4
+ import * as styles from "./styles.scss";
5
+
6
+ export type MetadataProps = {
7
+ count?: number;
8
+ title?: string;
9
+ type?: string;
10
+ status?: string;
11
+ };
12
+
13
+ export const MetadataValue: FunctionalComponent<MetadataProps> = ({ count }) => {
14
+ return (
15
+ <Text data-testid="metadata-value" type={"ui"} size={"m"} tag={"div"} className={styles["metadata-item-value"]}>
16
+ {count}
17
+ </Text>
18
+ );
19
+ };
20
+
21
+ interface ReportMetadataItemProps {
22
+ className?: string;
23
+ renderComponent?: FunctionalComponent<MetadataProps>;
24
+ props?: MetadataProps;
25
+ }
26
+
27
+ const MetadataItem: FunctionalComponent<ReportMetadataItemProps> = ({
28
+ className,
29
+ renderComponent: RenderComponent = MetadataValue,
30
+ props,
31
+ ...rest
32
+ }) => {
33
+ const { title } = props || {};
34
+
35
+ return (
36
+ <div {...rest} className={clsx("metadata-item", className)}>
37
+ <Text type={"ui"} size={"s"} tag={"div"} className={styles["metadata-item-title"]}>
38
+ {title}
39
+ </Text>
40
+ {RenderComponent ? <RenderComponent {...props} /> : <MetadataValue {...props} />}
41
+ </div>
42
+ );
43
+ };
44
+
45
+ export default MetadataItem;
@@ -0,0 +1,81 @@
1
+ import { type Statistic, statusesList } from "@allurereport/core-api";
2
+ import { Loadable } from "@allurereport/web-components";
3
+ import { computed } from "@preact/signals";
4
+ import type { FunctionComponent } from "preact";
5
+ import MetadataItem, { type MetadataProps } from "@/components/ReportMetadata/MetadataItem";
6
+ import { MetadataTestType } from "@/components/ReportMetadata/MetadataTestType";
7
+ import { MetadataWithIcon } from "@/components/ReportMetadata/MetadataWithIcon";
8
+ import * as styles from "@/components/ReportMetadata/styles.scss";
9
+ import { statsStore } from "@/stores";
10
+ import { useI18n } from "@/stores/locale";
11
+ import { capitalize } from "@/utils/capitalize";
12
+
13
+ export const MetadataSummary: FunctionComponent = () => {
14
+ const { t } = useI18n("statuses");
15
+ const { t: testSummary } = useI18n("testSummary");
16
+
17
+ return (
18
+ <Loadable
19
+ source={statsStore}
20
+ renderError={() => null}
21
+ renderData={(stats) => {
22
+ const allTest = computed(() => ({
23
+ title: capitalize(t("total")),
24
+ type: "all",
25
+ count: stats.total,
26
+ }));
27
+ const metaDataTests = ["flaky", "retry"]
28
+ .map((key) => {
29
+ if (!stats[key as keyof Statistic]) {
30
+ return;
31
+ }
32
+ const title = testSummary(key);
33
+ const props = { title, count: stats[key as keyof Statistic] || 0, type: key };
34
+
35
+ return (
36
+ <div key={key}>
37
+ <MetadataItem key={key} props={props} renderComponent={MetadataWithIcon} />
38
+ </div>
39
+ );
40
+ })
41
+ .filter(Boolean);
42
+
43
+ const metadataStatuses = statusesList
44
+ .map((status) => ({ status, value: stats[status] }))
45
+ .filter(({ value }) => value)
46
+ .map(({ status, value }) => {
47
+ const title = capitalize(t(status) ?? status ?? "");
48
+ const props = {
49
+ title,
50
+ count: value,
51
+ status,
52
+ } as MetadataProps;
53
+
54
+ return (
55
+ <MetadataItem
56
+ data-testid={`metadata-item-${status}`}
57
+ key={status}
58
+ props={props}
59
+ renderComponent={MetadataTestType}
60
+ />
61
+ );
62
+ });
63
+
64
+ return (
65
+ <div class={styles["report-metadata-summary"]}>
66
+ <div className={styles["report-metadata-all-tests"]}>
67
+ <MetadataItem
68
+ data-testid="metadata-item-total"
69
+ props={allTest.value}
70
+ renderComponent={MetadataWithIcon}
71
+ />
72
+ {Boolean(metaDataTests.length) && <div className={styles["report-metadata-separator"]} />}
73
+ {metaDataTests}
74
+ </div>
75
+ <div className={styles["report-metadata-status"]}>{metadataStatuses}</div>
76
+ </div>
77
+ );
78
+ }}
79
+ />
80
+ );
81
+ };
@@ -0,0 +1,16 @@
1
+ import { Text } from "@allurereport/web-components";
2
+ import { clsx } from "clsx";
3
+ import type { FunctionComponent } from "preact";
4
+ import type { MetadataProps } from "@/components/ReportMetadata/MetadataItem";
5
+ import * as styles from "@/components/ReportMetadata/styles.scss";
6
+
7
+ export const MetadataTestType: FunctionComponent<MetadataProps> = ({ status, count }) => {
8
+ return (
9
+ <div data-testid="metadata-value" className={styles["metadata-test-type"]}>
10
+ <div className={clsx(styles["metadata-color-badge"], styles?.[`status-${status}`])} />
11
+ <Text type={"ui"} size={"m"} bold>
12
+ {count}
13
+ </Text>
14
+ </div>
15
+ );
16
+ };
@@ -0,0 +1,21 @@
1
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import type { FunctionComponent } from "preact";
3
+ import type { MetadataProps } from "@/components/ReportMetadata/MetadataItem";
4
+ import * as styles from "./styles.scss";
5
+
6
+ const icons: Record<string, string> = {
7
+ flaky: allureIcons.lineGeneralZap,
8
+ retry: allureIcons.lineArrowsRefreshCcw1,
9
+ new: allureIcons.lineAlertsNotificationBox,
10
+ };
11
+
12
+ export const MetadataWithIcon: FunctionComponent<MetadataProps> = ({ type, count }) => {
13
+ return (
14
+ <div data-testid="metadata-value" className={styles["metadata-with-icon"]}>
15
+ {type !== "all" && <SvgIcon className={styles["metadata-icon"]} id={icons[type]} size={"s"} />}
16
+ <Text size={"m"} bold>
17
+ {count}
18
+ </Text>
19
+ </div>
20
+ );
21
+ };
@@ -0,0 +1,46 @@
1
+ import type { EnvironmentItem } from "@allurereport/core-api";
2
+ import { Loadable } from "@allurereport/web-components";
3
+ import type { FunctionalComponent } from "preact";
4
+ import { useState } from "preact/hooks";
5
+ import { MetadataList } from "@/components/Metadata";
6
+ import { MetadataButton } from "@/components/MetadataButton";
7
+ import { MetadataSummary } from "@/components/ReportMetadata/MetadataSummary";
8
+ import { envInfoStore } from "@/stores/envInfo";
9
+ import * as styles from "./styles.scss";
10
+
11
+ export interface MetadataItem extends EnvironmentItem {
12
+ value?: string;
13
+ }
14
+
15
+ export type MetadataProps = {
16
+ envInfo?: MetadataItem[];
17
+ size?: "s" | "m";
18
+ groupedLabels?: Record<string, string[]>;
19
+ };
20
+
21
+ const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
22
+ const [isOpened, setIsOpen] = useState(true);
23
+ const convertedEnvInfo = envInfo.map((env) => {
24
+ return { ...env, value: env.values.join(", ") };
25
+ });
26
+
27
+ return (
28
+ <div class={styles["report-metadata"]}>
29
+ <MetadataButton isOpened={isOpened} setIsOpen={setIsOpen} title={"Metadata"} counter={envInfo.length} />
30
+ {isOpened && <MetadataList envInfo={convertedEnvInfo} />}
31
+ </div>
32
+ );
33
+ };
34
+
35
+ export const ReportMetadata = () => {
36
+ return (
37
+ <div className={styles["report-metadata-wrapper"]}>
38
+ <MetadataSummary />
39
+ <Loadable
40
+ source={envInfoStore}
41
+ renderError={() => null}
42
+ renderData={(data) => Boolean(data?.length) && <Metadata envInfo={data} />}
43
+ />
44
+ </div>
45
+ );
46
+ };
@@ -0,0 +1,99 @@
1
+ @import "~@allurereport/web-components/mixins.scss";
2
+
3
+ .report-metadata {
4
+ padding-top: 20px;
5
+ padding-bottom: 20px;
6
+ }
7
+
8
+ .report-metadata-wrapper {
9
+ padding: 0 24px;
10
+ align-items: center;
11
+ }
12
+
13
+ .report-metadata-separator {
14
+ border-left: 1px solid var(--on-border-primary);
15
+ height: 24px;
16
+ margin: 11px 0;
17
+ }
18
+
19
+ .report-metadata-status {
20
+ display: flex;
21
+ gap: 24px;
22
+ align-items: center;
23
+ }
24
+
25
+ .report-metadata-summary {
26
+ display: flex;
27
+ justify-content: space-between;
28
+ align-items: baseline;
29
+ padding: 16px 0;
30
+ border-top: 1px solid var(--on-border-primary);
31
+ border-bottom: 1px solid var(--on-border-primary);
32
+ width: 100%;
33
+ }
34
+
35
+ .report-metadata-all-tests {
36
+ display: flex;
37
+ gap: 24px;
38
+ margin-right: 8px;
39
+ }
40
+
41
+ .metadata-item-title {
42
+ color: var(--on-text-secondary);
43
+ margin-bottom: 6px;
44
+ }
45
+
46
+ .metadata-item-value {
47
+ font-weight: bold;
48
+ }
49
+
50
+ .report-metadata {
51
+ border-bottom: 1px solid var(--on-border-primary);
52
+ }
53
+
54
+ .report-metadata-keyvalue {
55
+ display: grid;
56
+ grid-template-columns: 1fr 1fr;
57
+ gap: 8px;
58
+ }
59
+
60
+ .report-metadata-keyvalue-title {
61
+ padding: 8px 0;
62
+ }
63
+
64
+ .report-metadata-keyvalue-value {
65
+ padding: 8px 0;
66
+ }
67
+
68
+ .report-metadata-list {
69
+ display: grid;
70
+ column-gap: 48px;
71
+ grid-template-columns: repeat(2, 1fr);
72
+ grid-template-rows: repeat(5, auto);
73
+ grid-auto-flow: column;
74
+ padding-top: 16px;
75
+ }
76
+
77
+ .metadata-test-type {
78
+ display: flex;
79
+ }
80
+
81
+ .metadata-color-badge {
82
+ width: 4px;
83
+ height: 12px;
84
+ border-radius: 2px;
85
+ background: var(--on-text-secondary);
86
+ margin-right: 8px;
87
+ align-self: center;
88
+ @include status-bg-and-text();
89
+ }
90
+
91
+ .metadata-with-icon {
92
+ display: flex;
93
+ align-items: center;
94
+ }
95
+
96
+ .metadata-icon {
97
+ margin-right: 8px;
98
+ color: var(--on-icon-secondary);
99
+ }
@@ -0,0 +1,54 @@
1
+ import type { ComponentChild, FunctionalComponent } from "preact";
2
+ import { useEffect, useRef } from "preact/hooks";
3
+ import Split from "split.js";
4
+ import * as styles from "./styles.scss";
5
+
6
+ interface SideBySideProps {
7
+ left: ComponentChild;
8
+ right?: ComponentChild;
9
+ }
10
+
11
+ const SideBySide: FunctionalComponent<SideBySideProps> = ({ left, right }) => {
12
+ const containerRef = useRef<HTMLDivElement>(null);
13
+
14
+ useEffect(() => {
15
+ const sizes = JSON.parse(localStorage.getItem("sideBySidePosition") || "[50, 50]");
16
+
17
+ const splitter = Split([`.${styles["side-left"]}`, `.${styles["side-right"]}`], {
18
+ sizes,
19
+ gutterSize: 7,
20
+ gutter: (): HTMLElement => {
21
+ const gutter = document.createElement("div");
22
+ gutter.className = `${styles.gutter}`;
23
+ gutter.addEventListener("dblclick", () => {
24
+ const currentSizes = splitter.getSizes();
25
+ if (JSON.stringify(currentSizes) === "[50,50]") {
26
+ splitter.setSizes([30, 70]);
27
+ localStorage.setItem("sideBySidePosition", JSON.stringify([30, 70]));
28
+ return;
29
+ }
30
+ splitter.setSizes([50, 50]);
31
+ localStorage.setItem("sideBySidePosition", JSON.stringify([50, 50]));
32
+ });
33
+ return gutter;
34
+ },
35
+ onDragEnd: () => {
36
+ const newSizes = splitter.getSizes();
37
+ localStorage.setItem("sideBySidePosition", JSON.stringify(newSizes));
38
+ },
39
+ });
40
+
41
+ return () => {
42
+ splitter.destroy();
43
+ };
44
+ }, []);
45
+
46
+ return (
47
+ <div class={styles.side} ref={containerRef}>
48
+ <div class={styles["side-left"]}>{left}</div>
49
+ <div class={styles["side-right"]}>{right}</div>
50
+ </div>
51
+ );
52
+ };
53
+
54
+ export default SideBySide;
@@ -0,0 +1,59 @@
1
+ @import "../../variables.scss";
2
+
3
+ .side {
4
+ height: 100%;
5
+ width: 100%;
6
+ padding: 0;
7
+ margin: 0;
8
+ overflow: hidden;
9
+ display: flex;
10
+ }
11
+
12
+ .side-left {
13
+ overflow: auto;
14
+ flex: 0 0 auto;
15
+ }
16
+
17
+ .side-right {
18
+ overflow: auto;
19
+ flex: 1 1 auto;
20
+ }
21
+
22
+ [dir="ltr"] {
23
+ .side {
24
+ direction: ltr;
25
+ flex-direction: row;
26
+ }
27
+ }
28
+
29
+ [dir="rtl"] {
30
+ .side {
31
+ direction: ltr;
32
+ flex-direction: row-reverse;
33
+ }
34
+
35
+ .side-left {
36
+ direction: rtl;
37
+ }
38
+
39
+ .side-right {
40
+ direction: rtl;
41
+ }
42
+ }
43
+
44
+ .tree-ctrl {
45
+ overflow: hidden;
46
+ }
47
+
48
+ .gutter {
49
+ background: var(--bg-base-secondary) no-repeat 50%;
50
+ min-height: 100vh;
51
+ }
52
+
53
+ .gutter:hover {
54
+ cursor: ew-resize;
55
+ }
56
+
57
+ .gutter-horizontal {
58
+ //background-image: url("vertical.png");
59
+ }
@@ -0,0 +1,78 @@
1
+ import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
2
+ import clsx from "clsx";
3
+ import { h } from "preact";
4
+ import { useState } from "preact/hooks";
5
+ import { LanguagePicker } from "@/components/LanguagePicker";
6
+ import { useI18n } from "@/stores";
7
+ import { activeTab } from "@/stores/router";
8
+ import { navigateTo } from "@/utils/navigate";
9
+ import * as styles from "./styles.scss";
10
+
11
+ const tabs = [
12
+ { tabName: "overview", title: "Overview", icon: "lineGeneralHomeLine", active: false },
13
+ { tabName: "behaviors", title: "Behaviors", icon: "lineFilesClipboardCheck", active: false },
14
+ { tabName: "categories", title: "Categories", icon: "lineFilesFile2", active: false },
15
+ { tabName: "graphs", title: "Graphs", icon: "lineChartsBarChartSquare", active: false },
16
+ { tabName: "packages", title: "Packages", icon: "lineDevDataflow3", active: false },
17
+ { tabName: "suites", title: "Suites", icon: "lineFilesFolder", active: false },
18
+ { tabName: "timeline", title: "Timeline", icon: "lineTimeClockStopwatch", active: false },
19
+ ];
20
+ const SideNav = () => {
21
+ const { t: controls } = useI18n("controls");
22
+ const { t: nav } = useI18n("nav");
23
+ const [isCollapsed, setCollapsed] = useState(localStorage.getItem("sidebarCollapsed") === "true");
24
+
25
+ const toggleCollapsed = () => {
26
+ localStorage.setItem("sidebarCollapsed", String(!isCollapsed));
27
+ setCollapsed(!isCollapsed);
28
+ };
29
+
30
+ return (
31
+ <div class={clsx(styles["side-nav"], isCollapsed && styles.collapsed)}>
32
+ <a href="#" className={styles.brand} data-ga4-event="home_click">
33
+ <SvgIcon id={allureIcons.reportLogo} size={"s"} className={styles.icon} />
34
+ <Text className={styles["brand-text"]} bold>
35
+ Allure Report
36
+ </Text>
37
+ </a>
38
+ <ul className={styles.menu}>
39
+ {tabs?.map((tab) => (
40
+ <li
41
+ className={styles.item}
42
+ data-tooltip={tab.title}
43
+ data-ga4-event="tab_click"
44
+ data-ga4-param-tab={tab.tabName}
45
+ key={tab.tabName}
46
+ >
47
+ <a
48
+ href={`#${tab.tabName}`}
49
+ className={clsx(styles.link, { [styles["link-active"]]: activeTab.value === tab.tabName })}
50
+ onClick={() => navigateTo(tab.tabName)}
51
+ >
52
+ <span className={styles.icon}>
53
+ <SvgIcon id={allureIcons[tab.icon]} />
54
+ </span>
55
+ <Text className={styles.text}>{nav(tab.tabName)}</Text>
56
+ </a>
57
+ </li>
58
+ ))}
59
+ </ul>
60
+ <div className={styles.strut} />
61
+ <div className={styles.footer}>
62
+ <div className={styles["language-picker"]} data-tooltip="Language">
63
+ <LanguagePicker />
64
+ </div>
65
+ <div className={styles.item} data-tooltip="Expand" data-ga4-event="expand_menu_click" onClick={toggleCollapsed}>
66
+ <div className={styles.collapse}>
67
+ <span className={styles["collapse-icon"]}>
68
+ <SvgIcon id={allureIcons.lineArrowsChevronDown} />
69
+ </span>
70
+ <Text className={styles.text}>{controls("collapse")}</Text>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ );
76
+ };
77
+
78
+ export default SideNav;
@@ -0,0 +1,39 @@
1
+ <div class="{{b 'side-nav' 'head'}}">
2
+ <a href="#" class="{{b 'side-nav' 'brand'}}" data-ga4-event="home_click">
3
+ {{allure-icon "allureLogo" noTooltip=true width="40px" height="40px"}}
4
+ <span class="{{b 'side-nav' 'brand-text'}}">Allure</span>
5
+ </a>
6
+ </div>
7
+ <ul class="{{b 'side-nav' 'menu'}}">
8
+ {{#each tabs}}
9
+ <li class="{{b 'side-nav' 'item'}}"
10
+ data-tooltip="{{t title}}"
11
+ data-ga4-event="tab_click"
12
+ data-ga4-param-tab="{{tabName}}">
13
+ <a href="#{{tabName}}" class="{{b 'side-nav' 'link' active=active}}">
14
+ <span class="{{b 'side-nav' 'icon'}}">
15
+ {{allure-icon icon noTooltip=true width="22px" height="22px"}}
16
+ </span>
17
+ <div class="{{b 'side-nav' 'text'}}">{{t title}}</div>
18
+ </a>
19
+ </li>
20
+ {{/each}}
21
+ </ul>
22
+ <div class="{{b 'side-nav' 'strut'}}"></div>
23
+ <div class="{{b 'side-nav' 'footer'}}">
24
+ <div class="{{b 'side-nav' 'item'}}" data-tooltip="{{t 'controls.language'}}">
25
+ <button class="{{b 'button'}} {{b 'button' inverse=true}} {{b 'side-nav' 'language-small' lang=language.id}}"
26
+ data-ga4-event="language_menu_click">
27
+ {{language.id}}
28
+ </button>
29
+ </div>
30
+
31
+ <div class="{{b 'side-nav' 'item'}} " data-tooltip="{{t 'controls.expand'}}" data-ga4-event="expand_menu_click">
32
+ <div class="{{b 'side-nav' 'collapse'}}">
33
+ <span class="{{b 'side-nav' 'icon'}}">
34
+ {{allure-icon "chevronLeft" noTooltip=true width="20px" height="20px"}}
35
+ </span>
36
+ <span class="{{b 'side-nav' 'text'}}">{{t 'controls.collapse'}}</span>
37
+ </div>
38
+ </div>
39
+ </div>
@@ -0,0 +1,81 @@
1
+ import { View } from "backbone.marionette";
2
+ import { escapeExpression as escape } from "handlebars/runtime.js";
3
+ import { findWhere } from "underscore";
4
+ import LanguageSelectView from "@/components/language-select/LanguageSelectView.js";
5
+ import TooltipView from "@/components/tooltip/TooltipView.js";
6
+ import { className, on } from "@/decorators/index.js";
7
+ import router from "@/router.js";
8
+ import pluginsRegistry from "@/utils/pluginsRegistry.js";
9
+ import settings from "@/utils/settings.js";
10
+ import { LANGUAGES } from "@/utils/translation.js";
11
+ import template from "./SideNavView.hbs";
12
+ import "./styles.scss";
13
+
14
+ @className("side-nav")
15
+ class SideNavView extends View {
16
+ template = template;
17
+
18
+ initialize() {
19
+ this.tabs = pluginsRegistry.tabs.map(({ tabName, icon, title }) => ({
20
+ tabName,
21
+ icon,
22
+ title,
23
+ active: this.isTabActive(tabName),
24
+ }));
25
+ this.tooltip = new TooltipView({ position: "right" });
26
+ this.langSelect = new LanguageSelectView();
27
+ }
28
+
29
+ onRender() {
30
+ this.$el.toggleClass("side-nav_collapsed", settings.isSidebarCollapsed());
31
+ }
32
+
33
+ onDestroy() {
34
+ this.tooltip.hide();
35
+ }
36
+
37
+ serializeData() {
38
+ return {
39
+ language: findWhere(LANGUAGES, { id: settings.getLanguage() }),
40
+ tabs: this.tabs,
41
+ };
42
+ }
43
+
44
+ isTabActive(name) {
45
+ const currentUrl = router.getCurrentUrl();
46
+ return name ? currentUrl.indexOf(name) === 0 : currentUrl === name;
47
+ }
48
+
49
+ @on("mouseenter [data-tooltip]")
50
+ onSidelinkHover(e) {
51
+ if (this.$el.hasClass("side-nav_collapsed")) {
52
+ const el = this.$(e.currentTarget);
53
+ this.tooltip.show(escape(el.data("tooltip")), el);
54
+ }
55
+ }
56
+
57
+ @on("mouseleave [data-tooltip]")
58
+ onSidelinkLeave() {
59
+ this.tooltip.hide();
60
+ }
61
+
62
+ @on("click .side-nav__collapse")
63
+ onCollapseClick() {
64
+ this.$el.toggleClass("side-nav_collapsed");
65
+ settings.setSidebarCollapsed(this.$el.hasClass("side-nav_collapsed"));
66
+ this.tooltip.hide();
67
+ }
68
+
69
+ @on("click .side-nav__language")
70
+ @on("click .side-nav__language-small")
71
+ onLanguageClick(e) {
72
+ if (this.langSelect.isVisible()) {
73
+ this.langSelect.hide();
74
+ } else {
75
+ this.langSelect.show(this.$(e.currentTarget));
76
+ }
77
+ this.tooltip.hide();
78
+ }
79
+ }
80
+
81
+ export default SideNavView;