@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.
- package/.babelrc--old.cjs +18 -0
- package/.babelrc.js +46 -0
- package/.eslintrc--old.cjs +125 -0
- package/.eslintrc.cjs +22 -0
- package/README.md +27 -0
- package/dist/multi/10.app-970f027d.js +1 -0
- package/dist/multi/222.app-970f027d.js +1 -0
- package/dist/multi/26.app-970f027d.js +1 -0
- package/dist/multi/302.app-970f027d.js +1 -0
- package/dist/multi/304.app-970f027d.js +1 -0
- package/dist/multi/369.app-970f027d.js +1 -0
- package/dist/multi/389.app-970f027d.js +1 -0
- package/dist/multi/498.app-970f027d.js +1 -0
- package/dist/multi/60.app-970f027d.js +1 -0
- package/dist/multi/643.app-970f027d.js +1 -0
- package/dist/multi/671.app-970f027d.js +1 -0
- package/dist/multi/725.app-970f027d.js +1 -0
- package/dist/multi/770.app-970f027d.js +1 -0
- package/dist/multi/848.app-970f027d.js +1 -0
- package/dist/multi/853.app-970f027d.js +1 -0
- package/dist/multi/872.app-970f027d.js +1 -0
- package/dist/multi/895.app-970f027d.js +1 -0
- package/dist/multi/920.app-970f027d.js +1 -0
- package/dist/multi/979.app-970f027d.js +1 -0
- package/dist/multi/991.app-970f027d.js +1 -0
- package/dist/multi/JetBrainsMono_vf-9e9649b6..woff2 +0 -0
- package/dist/multi/JetBrainsMono_vf-b9a9c326..woff +0 -0
- package/dist/multi/app-970f027d.js +2 -0
- package/dist/multi/app-970f027d.js.LICENSE.txt +25 -0
- package/dist/multi/manifest.json +28 -0
- package/dist/multi/pt-root-ui_vf-22fe60ca..woff +0 -0
- package/dist/multi/pt-root-ui_vf-9d251e8b..woff2 +0 -0
- package/dist/multi/styles-970f027d.css +283 -0
- package/dist/single/app-2babff54.js +2 -0
- package/dist/single/app-2babff54.js.LICENSE.txt +25 -0
- package/dist/single/manifest.json +3 -0
- package/package--old.json +106 -0
- package/package.json +107 -0
- package/postcss.config.js +5 -0
- package/src/assets/scss/_common.scss +142 -0
- package/src/assets/scss/code.scss +71 -0
- package/src/assets/scss/day.scss +51 -0
- package/src/assets/scss/fonts.scss +3 -0
- package/src/assets/scss/index.scss +9 -0
- package/src/assets/scss/night.scss +61 -0
- package/src/assets/scss/palette.scss +393 -0
- package/src/assets/scss/theme.scss +117 -0
- package/src/assets/scss/typography.scss +218 -0
- package/src/assets/scss/vars.scss +8 -0
- package/src/components/ArrowButton/index.tsx +36 -0
- package/src/components/ArrowButton/styles.scss +35 -0
- package/src/components/BaseLayout/index.tsx +23 -0
- package/src/components/BaseLayout/styles.scss +63 -0
- package/src/components/Behaviors/BehaviorsList.tsx +67 -0
- package/src/components/Behaviors/index.tsx +60 -0
- package/src/components/Behaviors/styles.scss +196 -0
- package/src/components/Categories/CategoriesList.tsx +67 -0
- package/src/components/Categories/index.tsx +60 -0
- package/src/components/Categories/styles.scss +196 -0
- package/src/components/Footer/FooterLogo.tsx +16 -0
- package/src/components/Footer/FooterVersion.tsx +33 -0
- package/src/components/Footer/index.tsx +13 -0
- package/src/components/Footer/styles.scss +14 -0
- package/src/components/Graphs/index.tsx +2 -0
- package/src/components/Header/index.tsx +14 -0
- package/src/components/Header/styles.scss +26 -0
- package/src/components/HeaderActions/Filters.tsx +90 -0
- package/src/components/HeaderActions/HeaderActions.tsx +59 -0
- package/src/components/HeaderActions/SortBy.tsx +128 -0
- package/src/components/HeaderActions/styles.scss +82 -0
- package/src/components/LanguagePicker/index.tsx +41 -0
- package/src/components/LanguagePicker/styles.scss +3 -0
- package/src/components/MainReport/index.tsx +19 -0
- package/src/components/Metadata/index.tsx +121 -0
- package/src/components/Metadata/styles.scss +146 -0
- package/src/components/MetadataButton/index.tsx +32 -0
- package/src/components/MetadataButton/styles.scss +53 -0
- package/src/components/Modal/ModalView.hbs +13 -0
- package/src/components/Modal/ModalView.js +43 -0
- package/src/components/Modal/index.tsx +174 -0
- package/src/components/Modal/styles.scss +126 -0
- package/src/components/Overview/index.tsx +9 -0
- package/src/components/Packages/PackagesList.tsx +67 -0
- package/src/components/Packages/index.tsx +59 -0
- package/src/components/Packages/styles.scss +196 -0
- package/src/components/ReportBody/Filters.tsx +92 -0
- package/src/components/ReportBody/HeaderActions.tsx +21 -0
- package/src/components/ReportBody/SortBy.tsx +132 -0
- package/src/components/ReportBody/context.tsx +106 -0
- package/src/components/ReportBody/index.tsx +71 -0
- package/src/components/ReportBody/styles.scss +64 -0
- package/src/components/ReportHeader/ReportHeaderLabelList.tsx +12 -0
- package/src/components/ReportHeader/ReportHeaderLogo.tsx +10 -0
- package/src/components/ReportHeader/ReportHeaderPie.tsx +14 -0
- package/src/components/ReportHeader/index.tsx +33 -0
- package/src/components/ReportHeader/styles.scss +49 -0
- package/src/components/ReportLogo/index.tsx +16 -0
- package/src/components/ReportLogo/styles.scss +20 -0
- package/src/components/ReportLogoFull/index.tsx +20 -0
- package/src/components/ReportLogoFull/styles.scss +7 -0
- package/src/components/ReportMetadata/MetadataItem.tsx +45 -0
- package/src/components/ReportMetadata/MetadataSummary.tsx +81 -0
- package/src/components/ReportMetadata/MetadataTestType.tsx +16 -0
- package/src/components/ReportMetadata/MetadataWithIcon.tsx +21 -0
- package/src/components/ReportMetadata/index.tsx +46 -0
- package/src/components/ReportMetadata/styles.scss +99 -0
- package/src/components/SideBySide/index.tsx +54 -0
- package/src/components/SideBySide/styles.scss +59 -0
- package/src/components/SideNav/SideNav.tsx +78 -0
- package/src/components/SideNav/SideNavView.hbs +39 -0
- package/src/components/SideNav/SideNavView.js +81 -0
- package/src/components/SideNav/styles.scss +126 -0
- package/src/components/Suites/index.tsx +62 -0
- package/src/components/Suites/styles.scss +10 -0
- package/src/components/Tabs/index.tsx +33 -0
- package/src/components/Tabs/styles.scss +56 -0
- package/src/components/TestResult/TestResultAttachmentsView/index.tsx +27 -0
- package/src/components/TestResult/TestResultAttachmentsView/styles.scss +12 -0
- package/src/components/TestResult/TestResultDescription/index.tsx +27 -0
- package/src/components/TestResult/TestResultDescription/styles.scss +12 -0
- package/src/components/TestResult/TestResultDropdown/index.tsx +23 -0
- package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
- package/src/components/TestResult/TestResultEmpty/index.tsx +33 -0
- package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
- package/src/components/TestResult/TestResultError/index.tsx +48 -0
- package/src/components/TestResult/TestResultError/styles.scss +51 -0
- package/src/components/TestResult/TestResultHeader/index.tsx +53 -0
- package/src/components/TestResult/TestResultHeader/styles.scss +43 -0
- package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +67 -0
- package/src/components/TestResult/TestResultHistory/index.tsx +26 -0
- package/src/components/TestResult/TestResultHistory/styles.scss +63 -0
- package/src/components/TestResult/TestResultInfo/TestResultInfoStatuses.tsx +30 -0
- package/src/components/TestResult/TestResultInfo/index.tsx +79 -0
- package/src/components/TestResult/TestResultInfo/styles.scss +50 -0
- package/src/components/TestResult/TestResultLinks/index.tsx +56 -0
- package/src/components/TestResult/TestResultLinks/styles.scss +30 -0
- package/src/components/TestResult/TestResultMetadata/index.tsx +27 -0
- package/src/components/TestResult/TestResultMetadata/styles.scss +8 -0
- package/src/components/TestResult/TestResultNavigation/index.tsx +80 -0
- package/src/components/TestResult/TestResultNavigation/styles.scss +48 -0
- package/src/components/TestResult/TestResultOverview.tsx +40 -0
- package/src/components/TestResult/TestResultParameters/index.tsx +30 -0
- package/src/components/TestResult/TestResultParameters/styles.scss +8 -0
- package/src/components/TestResult/TestResultPrevStatuses/index.tsx +49 -0
- package/src/components/TestResult/TestResultPrevStatuses/styles.scss +57 -0
- package/src/components/TestResult/TestResultRetriesView/TestResultRetriesItem.tsx +49 -0
- package/src/components/TestResult/TestResultRetriesView/index.tsx +20 -0
- package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
- package/src/components/TestResult/TestResultSetup/index.tsx +49 -0
- package/src/components/TestResult/TestResultSeverity/index.tsx +27 -0
- package/src/components/TestResult/TestResultSeverity/styles.scss +29 -0
- package/src/components/TestResult/TestResultStatus/index.tsx +26 -0
- package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
- package/src/components/TestResult/TestResultSteps/HtmlAttachmentPreview.tsx +12 -0
- package/src/components/TestResult/TestResultSteps/attachment.tsx +68 -0
- package/src/components/TestResult/TestResultSteps/attachmentCode.tsx +20 -0
- package/src/components/TestResult/TestResultSteps/attachmentImage.tsx +32 -0
- package/src/components/TestResult/TestResultSteps/attachmentVideo.tsx +15 -0
- package/src/components/TestResult/TestResultSteps/index.tsx +49 -0
- package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +77 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
- package/src/components/TestResult/TestResultSteps/testResultStep.tsx +78 -0
- package/src/components/TestResult/TestResultSteps/testResultStepInfo.tsx +30 -0
- package/src/components/TestResult/TestResultSteps/wrongAttachment.tsx +8 -0
- package/src/components/TestResult/TestResultTabs/index.tsx +59 -0
- package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
- package/src/components/TestResult/TestResultTeardown/index.tsx +49 -0
- package/src/components/TestResult/TestResultView.hbs +32 -0
- package/src/components/TestResult/TestResultView.js +90 -0
- package/src/components/TestResult/index.tsx +54 -0
- package/src/components/TestResult/styles.scss +29 -0
- package/src/components/TestResultView/index.tsx +31 -0
- package/src/components/ThemeButton/ThemeButton.tsx +20 -0
- package/src/components/Timeline/index.tsx +2 -0
- package/src/components/Tree/Tree.tsx +76 -0
- package/src/components/Tree/TreeHeader.tsx +82 -0
- package/src/components/Tree/TreeItem.tsx +49 -0
- package/src/components/Tree/TreeItemIcon.tsx +32 -0
- package/src/components/Tree/index.tsx +60 -0
- package/src/components/Tree/styles.scss +185 -0
- package/src/favicon.ico +0 -0
- package/src/index.html +40 -0
- package/src/index.js +52 -0
- package/src/index.tsx +60 -0
- package/src/mixins.scss +128 -0
- package/src/rtl.scss +19 -0
- package/src/stores/behaviors.ts +127 -0
- package/src/stores/categories.ts +127 -0
- package/src/stores/chart.ts +32 -0
- package/src/stores/envInfo.ts +34 -0
- package/src/stores/index.ts +4 -0
- package/src/stores/locale.ts +83 -0
- package/src/stores/packages.ts +127 -0
- package/src/stores/router.ts +55 -0
- package/src/stores/stats.ts +36 -0
- package/src/stores/tabs.ts +7 -0
- package/src/stores/testResults.ts +66 -0
- package/src/stores/theme.ts +33 -0
- package/src/stores/tree.ts +127 -0
- package/src/stores/types.ts +5 -0
- package/src/styles.scss +91 -0
- package/src/translations/am.json +127 -0
- package/src/translations/az.json +127 -0
- package/src/translations/br.json +214 -0
- package/src/translations/constants.ts +124 -0
- package/src/translations/de.json +127 -0
- package/src/translations/en.json +128 -0
- package/src/translations/es.json +118 -0
- package/src/translations/fr.json +118 -0
- package/src/translations/he.json +118 -0
- package/src/translations/isv.json +216 -0
- package/src/translations/it.json +118 -0
- package/src/translations/ja.json +118 -0
- package/src/translations/ka.json +118 -0
- package/src/translations/kr.json +118 -0
- package/src/translations/nl.json +118 -0
- package/src/translations/pl.json +116 -0
- package/src/translations/pt.json +118 -0
- package/src/translations/ru.json +116 -0
- package/src/translations/sv.json +118 -0
- package/src/translations/tr.json +118 -0
- package/src/translations/zh.json +118 -0
- package/src/types/globals.d.ts +13 -0
- package/src/types/window.d.ts +8 -0
- package/src/utils/attachments.ts +156 -0
- package/src/utils/capitalize.ts +6 -0
- package/src/utils/copyToClipboard.ts +16 -0
- package/src/utils/isMac.ts +8 -0
- package/src/utils/navigate.ts +7 -0
- package/src/utils/statuses.js +1 -0
- package/src/utils/statuses.ts +55 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/treeFilters.ts +139 -0
- package/src/variables.scss +71 -0
- package/test/utils/treeFilters.test.ts +448 -0
- package/tsconfig.json +25 -0
- package/types.d.ts +85 -0
- package/vitest.config.ts +18 -0
- package/webpack.config--old.js +127 -0
- package/webpack.config.js +108 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { DropdownButton, Link, Menu, SvgIcon, Text, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import type { ComponentChildren } from "preact";
|
|
4
|
+
import { useI18n } from "@/stores/locale";
|
|
5
|
+
import { setTreeDirection, setTreeSortBy, treeFiltersStore } from "@/stores/tree";
|
|
6
|
+
import * as styles from "./styles.scss";
|
|
7
|
+
|
|
8
|
+
const BtnWrapper = ({ children }: { children: ComponentChildren }) => {
|
|
9
|
+
return <div className={styles.sortByBtnWrap}>{children}</div>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const SortBy = () => {
|
|
13
|
+
const { t: sortByLocale } = useI18n("sort-by");
|
|
14
|
+
const { t: sortByValuesLocale } = useI18n("sort-by.values");
|
|
15
|
+
const { t: sortByDirectionsLocale } = useI18n("sort-by.directions");
|
|
16
|
+
const { sortBy, direction } = treeFiltersStore.value;
|
|
17
|
+
|
|
18
|
+
const displayedSortByValue = sortByValuesLocale(sortBy);
|
|
19
|
+
const displayedDirection = sortByDirectionsLocale(`${sortBy}-${direction}-short`);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div>
|
|
23
|
+
<Text type="paragraph" size="m" className={styles.sortByText}>
|
|
24
|
+
{sortByLocale("sort-by-text")}
|
|
25
|
+
|
|
26
|
+
<Menu
|
|
27
|
+
size="l"
|
|
28
|
+
menuTriggerWrapper="span"
|
|
29
|
+
menuTrigger={({ onClick, isOpened }) => (
|
|
30
|
+
<Text type="paragraph" size="m">
|
|
31
|
+
<Link onClick={onClick}>
|
|
32
|
+
{displayedSortByValue} {displayedDirection}
|
|
33
|
+
<SvgIcon
|
|
34
|
+
size="s"
|
|
35
|
+
id={allureIcons.lineArrowsChevronDown}
|
|
36
|
+
className={clsx(styles.sortByIcon, isOpened && styles.sortByIconReversed)}
|
|
37
|
+
/>
|
|
38
|
+
</Link>
|
|
39
|
+
</Text>
|
|
40
|
+
)}
|
|
41
|
+
>
|
|
42
|
+
<Menu.Section>
|
|
43
|
+
<Menu
|
|
44
|
+
size="s"
|
|
45
|
+
menuTrigger={({ onClick, isOpened }) => (
|
|
46
|
+
<Menu.Item
|
|
47
|
+
closeMenuOnClick={false}
|
|
48
|
+
onClick={onClick}
|
|
49
|
+
leadingIcon={allureIcons.lineArrowsSwitchVertical1}
|
|
50
|
+
rightSlot={
|
|
51
|
+
<BtnWrapper>
|
|
52
|
+
<DropdownButton
|
|
53
|
+
style="outline"
|
|
54
|
+
size="s"
|
|
55
|
+
isExpanded={isOpened}
|
|
56
|
+
text={displayedSortByValue}
|
|
57
|
+
focusable={false}
|
|
58
|
+
/>
|
|
59
|
+
</BtnWrapper>
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
{sortByLocale("sort-by-category")}
|
|
63
|
+
</Menu.Item>
|
|
64
|
+
)}
|
|
65
|
+
>
|
|
66
|
+
<Menu.Section>
|
|
67
|
+
<Menu.ItemWithCheckmark onClick={() => setTreeSortBy("order")} isChecked={sortBy === "order"}>
|
|
68
|
+
{sortByValuesLocale("order")}
|
|
69
|
+
</Menu.ItemWithCheckmark>
|
|
70
|
+
<Menu.ItemWithCheckmark onClick={() => setTreeSortBy("duration")} isChecked={sortBy === "duration"}>
|
|
71
|
+
{sortByValuesLocale("duration")}
|
|
72
|
+
</Menu.ItemWithCheckmark>
|
|
73
|
+
<Menu.ItemWithCheckmark onClick={() => setTreeSortBy("status")} isChecked={sortBy === "status"}>
|
|
74
|
+
{sortByValuesLocale("status")}
|
|
75
|
+
</Menu.ItemWithCheckmark>
|
|
76
|
+
<Menu.ItemWithCheckmark onClick={() => setTreeSortBy("alphabet")} isChecked={sortBy === "alphabet"}>
|
|
77
|
+
{sortByValuesLocale("alphabet")}
|
|
78
|
+
</Menu.ItemWithCheckmark>
|
|
79
|
+
</Menu.Section>
|
|
80
|
+
</Menu>
|
|
81
|
+
<Menu
|
|
82
|
+
size="m"
|
|
83
|
+
menuTrigger={({ onClick, isOpened }) => (
|
|
84
|
+
<Menu.Item
|
|
85
|
+
closeMenuOnClick={false}
|
|
86
|
+
onClick={onClick}
|
|
87
|
+
leadingIcon={
|
|
88
|
+
direction === "asc" ? allureIcons.lineArrowsSortLineAsc : allureIcons.lineArrowsSortLineDesc
|
|
89
|
+
}
|
|
90
|
+
rightSlot={
|
|
91
|
+
<BtnWrapper>
|
|
92
|
+
<DropdownButton
|
|
93
|
+
style="outline"
|
|
94
|
+
size="s"
|
|
95
|
+
isExpanded={isOpened}
|
|
96
|
+
text={displayedDirection}
|
|
97
|
+
focusable={false}
|
|
98
|
+
/>
|
|
99
|
+
</BtnWrapper>
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
{sortByLocale("direction-category")}
|
|
103
|
+
</Menu.Item>
|
|
104
|
+
)}
|
|
105
|
+
>
|
|
106
|
+
<Menu.Section>
|
|
107
|
+
<Menu.ItemWithCheckmark
|
|
108
|
+
onClick={() => setTreeDirection("asc")}
|
|
109
|
+
leadingIcon={allureIcons.lineArrowsSortLineAsc}
|
|
110
|
+
isChecked={direction === "asc"}
|
|
111
|
+
>
|
|
112
|
+
{sortByDirectionsLocale(`${sortBy}-asc`)}
|
|
113
|
+
</Menu.ItemWithCheckmark>
|
|
114
|
+
<Menu.ItemWithCheckmark
|
|
115
|
+
onClick={() => setTreeDirection("desc")}
|
|
116
|
+
leadingIcon={allureIcons.lineArrowsSortLineDesc}
|
|
117
|
+
isChecked={direction === "desc"}
|
|
118
|
+
>
|
|
119
|
+
{sortByDirectionsLocale(`${sortBy}-desc`)}
|
|
120
|
+
</Menu.ItemWithCheckmark>
|
|
121
|
+
</Menu.Section>
|
|
122
|
+
</Menu>
|
|
123
|
+
</Menu.Section>
|
|
124
|
+
</Menu>
|
|
125
|
+
</Text>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
.header {
|
|
2
|
+
padding: 24px;
|
|
3
|
+
padding-bottom: 0;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: 12px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.headerRow {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
column-gap: 8px;
|
|
13
|
+
row-gap: 12px;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.body {
|
|
20
|
+
padding: 16px 24px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.headerActions {
|
|
24
|
+
display: flex;
|
|
25
|
+
gap: 8px;
|
|
26
|
+
flex-wrap: wrap;
|
|
27
|
+
margin-bottom: 8px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.header-search {
|
|
31
|
+
display: flex;
|
|
32
|
+
gap: 8px;
|
|
33
|
+
width: 100%;
|
|
34
|
+
}
|
|
35
|
+
.header-tabs {
|
|
36
|
+
flex: 1 1 auto;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.header-filters {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* This is a hack because button do not have this state */
|
|
47
|
+
.filtersBtnWithFilters > button::after {
|
|
48
|
+
content: "";
|
|
49
|
+
background-color: var(--bg-support-aldebaran);
|
|
50
|
+
width: 6px;
|
|
51
|
+
height: 6px;
|
|
52
|
+
border-radius: 100px;
|
|
53
|
+
position: absolute;
|
|
54
|
+
top: 7px;
|
|
55
|
+
right: 3px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.filterToggle {
|
|
59
|
+
padding-top: 2px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.sortByText {
|
|
63
|
+
color: var(--on-text-secondary);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.sortByBtnWrap {
|
|
67
|
+
/*
|
|
68
|
+
Because button is 24px height it makes
|
|
69
|
+
menu item to be 24px height too
|
|
70
|
+
But design is not that
|
|
71
|
+
*/
|
|
72
|
+
margin-top: -2px;
|
|
73
|
+
margin-bottom: -2px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.sortByIcon {
|
|
77
|
+
transition: transform var(--interaction-transition-duration) ease-out;
|
|
78
|
+
|
|
79
|
+
&.sortByIconReversed {
|
|
80
|
+
transform: rotate(180deg);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Button, Menu } from "@allurereport/web-components";
|
|
2
|
+
import { currentLocale } from "@/stores";
|
|
3
|
+
import { setLocale } from "@/stores/locale";
|
|
4
|
+
import { LANG_LOCALE, type LangLocale } from "@/translations/constants";
|
|
5
|
+
import * as styles from "./styles.scss";
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8
|
+
const langPickerOptions = Object.entries(LANG_LOCALE).map(([key, { full }]) => ({
|
|
9
|
+
key: key as LangLocale,
|
|
10
|
+
value: full,
|
|
11
|
+
}));
|
|
12
|
+
|
|
13
|
+
export const LanguagePicker = () => {
|
|
14
|
+
const locale = currentLocale.value;
|
|
15
|
+
const handleSelect = (selectedOption: LangLocale) => {
|
|
16
|
+
setLocale(selectedOption);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Menu
|
|
21
|
+
size="s"
|
|
22
|
+
menuTrigger={({ onClick }) => (
|
|
23
|
+
<Button
|
|
24
|
+
style="raised"
|
|
25
|
+
className={styles["language-picker"]}
|
|
26
|
+
size="s"
|
|
27
|
+
text={LANG_LOCALE[locale || "en"].short}
|
|
28
|
+
onClick={onClick}
|
|
29
|
+
/>
|
|
30
|
+
)}
|
|
31
|
+
>
|
|
32
|
+
<Menu.Section>
|
|
33
|
+
{langPickerOptions.map(({ key, value }) => (
|
|
34
|
+
<Menu.ItemWithCheckmark onClick={() => handleSelect(key)} key={key} isChecked={locale === key}>
|
|
35
|
+
{value}
|
|
36
|
+
</Menu.ItemWithCheckmark>
|
|
37
|
+
))}
|
|
38
|
+
</Menu.Section>
|
|
39
|
+
</Menu>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as styles from "@/components/BaseLayout/styles.scss";
|
|
2
|
+
import { Header } from "@/components/Header";
|
|
3
|
+
import { ReportBody } from "@/components/ReportBody";
|
|
4
|
+
import { ReportHeader } from "@/components/ReportHeader";
|
|
5
|
+
import { ReportMetadata } from "@/components/ReportMetadata";
|
|
6
|
+
|
|
7
|
+
const MainReport = () => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<Header />
|
|
11
|
+
<div className={styles.content}>
|
|
12
|
+
<ReportHeader />
|
|
13
|
+
<ReportMetadata />
|
|
14
|
+
<ReportBody />
|
|
15
|
+
</div>
|
|
16
|
+
</>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
export default MainReport;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Button, Menu, Text, allureIcons } from "@allurereport/web-components";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import type { FunctionalComponent } from "preact";
|
|
4
|
+
import { useState } from "preact/hooks";
|
|
5
|
+
import { MetadataButton } from "@/components/MetadataButton";
|
|
6
|
+
import type { MetadataProps } from "@/components/ReportMetadata";
|
|
7
|
+
import { useI18n } from "@/stores/locale";
|
|
8
|
+
import { copyToClipboard } from "@/utils/copyToClipboard";
|
|
9
|
+
import * as styles from "./styles.scss";
|
|
10
|
+
|
|
11
|
+
export const MetadataList: FunctionalComponent<MetadataProps & { columns?: number }> = ({
|
|
12
|
+
envInfo,
|
|
13
|
+
size = "m",
|
|
14
|
+
columns = 2,
|
|
15
|
+
}) => {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
class={styles["report-metadata-list"]}
|
|
19
|
+
style={{ gridTemplateColumns: `repeat(${columns}, ${100 / columns - 5}%)` }}
|
|
20
|
+
>
|
|
21
|
+
{envInfo?.map(({ name, values, value }) => (
|
|
22
|
+
<MetadataKeyValue key={name} size={size} title={name} value={value} values={values} />
|
|
23
|
+
))}
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const TestResultMetadataList: FunctionalComponent<MetadataProps> = ({ groupedLabels, size = "m" }) => {
|
|
29
|
+
return (
|
|
30
|
+
<div class={styles["report-metadata-list"]}>
|
|
31
|
+
{groupedLabels &&
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
33
|
+
Object.entries(groupedLabels)?.map(([name, values]) => (
|
|
34
|
+
<MetadataKeyValue key={name} size={size} title={name} values={values} />
|
|
35
|
+
))}
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const Metadata: FunctionalComponent<MetadataProps> = ({ envInfo }) => {
|
|
41
|
+
const { t } = useI18n("ui");
|
|
42
|
+
const [isOpened, setIsOpen] = useState(true);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div class={styles["report-metadata"]}>
|
|
46
|
+
<MetadataButton isOpened={isOpened} setIsOpen={setIsOpen} counter={envInfo.length} title={t("metadata")} />
|
|
47
|
+
{isOpened && <MetadataList envInfo={envInfo} />}
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const MetadataTooltip = (props: { value: string }) => {
|
|
53
|
+
const { value } = props;
|
|
54
|
+
const { t } = useI18n("ui");
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<div className={styles["metadata-tooltip"]}>
|
|
58
|
+
<div className={styles["metadata-tooltip-value"]}>
|
|
59
|
+
<Text>{value}</Text>
|
|
60
|
+
</div>
|
|
61
|
+
<Button
|
|
62
|
+
style={"outline"}
|
|
63
|
+
icon={allureIcons.lineGeneralCopy3}
|
|
64
|
+
text={t("copy")}
|
|
65
|
+
onClick={() => copyToClipboard(value)}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const MetaDataKeyLabel: FunctionalComponent<{
|
|
72
|
+
size?: "s" | "m";
|
|
73
|
+
value: string;
|
|
74
|
+
}> = ({ size = "s", value }) => {
|
|
75
|
+
return (
|
|
76
|
+
<Menu
|
|
77
|
+
size="xl"
|
|
78
|
+
menuTrigger={({ onClick }) => (
|
|
79
|
+
<div className={styles["report-metadata-keyvalue-wrapper"]}>
|
|
80
|
+
<Text type={"ui"} size={size} onClick={onClick} bold className={styles["report-metadata-keyvalue-value"]}>
|
|
81
|
+
{value}
|
|
82
|
+
</Text>
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
>
|
|
86
|
+
<Menu.Section>
|
|
87
|
+
<MetadataTooltip value={value} />
|
|
88
|
+
</Menu.Section>
|
|
89
|
+
</Menu>
|
|
90
|
+
);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const MetadataKeyValue: FunctionalComponent<{
|
|
94
|
+
title: string;
|
|
95
|
+
value?: string;
|
|
96
|
+
values?: string[];
|
|
97
|
+
size?: "s" | "m";
|
|
98
|
+
}> = ({ title, value, values, size = "m" }) => {
|
|
99
|
+
return (
|
|
100
|
+
<div className={styles["report-metadata-keyvalue"]}>
|
|
101
|
+
<Text
|
|
102
|
+
type={"ui"}
|
|
103
|
+
size={size}
|
|
104
|
+
className={clsx(styles["report-metadata-keyvalue-title"], styles[`report-metadata-${size}`])}
|
|
105
|
+
>
|
|
106
|
+
{title}
|
|
107
|
+
</Text>
|
|
108
|
+
{values?.length ? (
|
|
109
|
+
<div className={styles["report-metadata-values"]}>
|
|
110
|
+
{values.map((item) => (
|
|
111
|
+
<MetaDataKeyLabel key={item} value={item} />
|
|
112
|
+
))}
|
|
113
|
+
</div>
|
|
114
|
+
) : (
|
|
115
|
+
<div className={styles["report-metadata-values"]}>
|
|
116
|
+
<MetaDataKeyLabel value={value} />
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
121
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
@import "~@allurereport/web-components/mixins.scss";
|
|
2
|
+
|
|
3
|
+
.report-metadata-wrapper {
|
|
4
|
+
padding: 0 24px;
|
|
5
|
+
align-items: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.report-metadata-separator {
|
|
9
|
+
border-left: 1px solid var(--on-border-primary);
|
|
10
|
+
height: 24px;
|
|
11
|
+
margin: 11px 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.report-metadata-status {
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: 24px;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.report-metadata-summary {
|
|
21
|
+
display: flex;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
align-items: baseline;
|
|
24
|
+
padding: 16px 0;
|
|
25
|
+
border-top: 1px solid var(--on-border-primary);
|
|
26
|
+
border-bottom: 1px solid var(--on-border-primary);
|
|
27
|
+
width: 100%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.report-metadata-all-tests {
|
|
31
|
+
display: flex;
|
|
32
|
+
flex: 1 1 auto;
|
|
33
|
+
gap: 24px;
|
|
34
|
+
margin-right: 8px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.metadata-item-title {
|
|
38
|
+
color: var(--on-text-secondary);
|
|
39
|
+
margin-bottom: 6px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.metadata-item-value {
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.report-metadata {
|
|
47
|
+
padding: 16px 0;
|
|
48
|
+
border-bottom: 1px solid var(--on-border-primary);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.report-metadata-keyvalue {
|
|
52
|
+
display: inline-grid;
|
|
53
|
+
grid-template-columns: 30% 60%;
|
|
54
|
+
gap: 10%;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.report-metadata-values {
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: 6px;
|
|
61
|
+
align-items: center;
|
|
62
|
+
div {
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
text-overflow: ellipsis;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.report-metadata-s {
|
|
69
|
+
font-size: 12px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.report-metadata-keyvalue-title {
|
|
73
|
+
padding: 8px 0;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
text-overflow: ellipsis;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.report-metadata-keyvalue-wrapper {
|
|
80
|
+
background: var(--on-border-primary);
|
|
81
|
+
border-radius: 4px;
|
|
82
|
+
text-overflow: ellipsis;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
padding: 2px 4px;
|
|
85
|
+
line-height: 16px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.report-metadata-keyvalue-value {
|
|
89
|
+
width: max-content;
|
|
90
|
+
height: max-content;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
white-space: nowrap;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.report-metadata-list {
|
|
98
|
+
display: grid;
|
|
99
|
+
column-gap: 5%;
|
|
100
|
+
grid-template-columns: repeat(2, 45%);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.metadata-test-type {
|
|
104
|
+
display: flex;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.metadata-color-badge {
|
|
108
|
+
width: 4px;
|
|
109
|
+
height: 12px;
|
|
110
|
+
border-radius: 2px;
|
|
111
|
+
background: var(--on-text-secondary);
|
|
112
|
+
margin-right: 8px;
|
|
113
|
+
align-self: center;
|
|
114
|
+
@include status-bg-and-text;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.metadata-with-icon {
|
|
118
|
+
display: flex;
|
|
119
|
+
align-items: center;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.metadata-icon {
|
|
123
|
+
margin-right: 8px;
|
|
124
|
+
color: var(--on-icon-secondary);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.metadata-tooltip {
|
|
128
|
+
padding: 12px 12px 16px;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-wrap: wrap;
|
|
131
|
+
justify-content: flex-end;
|
|
132
|
+
gap: 12px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.metadata-tooltip-value {
|
|
136
|
+
flex: 1 1 auto;
|
|
137
|
+
min-width: 320px;
|
|
138
|
+
background: var(--bg-base-secondary);
|
|
139
|
+
max-height: 238px;
|
|
140
|
+
padding: 8px 16px;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
overflow-y: auto;
|
|
143
|
+
border-radius: 8px;
|
|
144
|
+
word-wrap: break-word;
|
|
145
|
+
overflow-wrap: break-word;
|
|
146
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Counter, Text } from "@allurereport/web-components";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import type { FunctionalComponent } from "preact";
|
|
4
|
+
import { ArrowButton } from "@/components/ArrowButton";
|
|
5
|
+
import * as styles from "./styles.scss";
|
|
6
|
+
|
|
7
|
+
interface MetadataButtonProps {
|
|
8
|
+
isOpened?: boolean;
|
|
9
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
10
|
+
counter?: number;
|
|
11
|
+
title?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const MetadataButton: FunctionalComponent<MetadataButtonProps> = ({ isOpened, setIsOpen, counter, title }) => {
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
className={clsx(styles["report-metadata-header"], isOpened && styles["report-metadata-header-opened"])}
|
|
18
|
+
onClick={() => setIsOpen(!isOpened)}
|
|
19
|
+
>
|
|
20
|
+
<Text size={"m"} bold>
|
|
21
|
+
{title}
|
|
22
|
+
</Text>
|
|
23
|
+
{counter && <Counter count={counter} size="s" />}
|
|
24
|
+
<ArrowButton
|
|
25
|
+
isOpened={isOpened}
|
|
26
|
+
iconSize={"s"}
|
|
27
|
+
buttonSize={"s"}
|
|
28
|
+
className={styles["report-metadata-header-arrow"]}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -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,13 @@
|
|
|
1
|
+
<div class="modal__background">
|
|
2
|
+
<div class="modal__window">
|
|
3
|
+
<h2 class="{{b cls 'title'}}">
|
|
4
|
+
<span>{{title}}</span>
|
|
5
|
+
<span class="{{b cls 'close'}}" data-tooltip="Close">
|
|
6
|
+
{{allure-icon "close" noTooltip=true width="16px" height="16px"}}
|
|
7
|
+
</span>
|
|
8
|
+
</h2>
|
|
9
|
+
<div class="modal__content"></div>
|
|
10
|
+
<br>
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { View } from "backbone.marionette";
|
|
2
|
+
import $ from "jquery";
|
|
3
|
+
import { className, on, regions } from "@/decorators/index.js";
|
|
4
|
+
import template from "./ModalView.hbs";
|
|
5
|
+
import "./styles.scss";
|
|
6
|
+
|
|
7
|
+
@className("modal")
|
|
8
|
+
@regions({
|
|
9
|
+
content: ".modal__content",
|
|
10
|
+
})
|
|
11
|
+
class ModalView extends View {
|
|
12
|
+
template = template;
|
|
13
|
+
static container = $(document.body);
|
|
14
|
+
|
|
15
|
+
show() {
|
|
16
|
+
this.constructor.container.append(this.$el);
|
|
17
|
+
this.showChildView("content", this.options.childView);
|
|
18
|
+
$("#content").toggleClass("blur", true);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
onDestroy() {
|
|
22
|
+
$("#content").toggleClass("blur", false);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@on("click .modal__content")
|
|
26
|
+
onKeepOpen(e) {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@on("click .modal__background, .modal__close")
|
|
31
|
+
onClose() {
|
|
32
|
+
this.destroy();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
serializeData() {
|
|
36
|
+
return {
|
|
37
|
+
cls: this.className,
|
|
38
|
+
title: this.options.title,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default ModalView;
|