@allurereport/web-awesome 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.js +46 -0
- package/.eslintrc.cjs +18 -0
- package/CONTRIBUTING.md +34 -0
- package/README.md +27 -0
- package/dist/multi/141.app-d01d0c66.js +1 -0
- package/dist/multi/222.app-d01d0c66.js +1 -0
- package/dist/multi/335.app-d01d0c66.js +1 -0
- package/dist/multi/34.app-d01d0c66.js +1 -0
- package/dist/multi/349.app-d01d0c66.js +1 -0
- package/dist/multi/378.app-d01d0c66.js +1 -0
- package/dist/multi/406.app-d01d0c66.js +1 -0
- package/dist/multi/476.app-d01d0c66.js +1 -0
- package/dist/multi/53.app-d01d0c66.js +1 -0
- package/dist/multi/584.app-d01d0c66.js +1 -0
- package/dist/multi/690.app-d01d0c66.js +1 -0
- package/dist/multi/747.app-d01d0c66.js +1 -0
- package/dist/multi/767.app-d01d0c66.js +1 -0
- package/dist/multi/816.app-d01d0c66.js +1 -0
- package/dist/multi/83.app-d01d0c66.js +1 -0
- package/dist/multi/873.app-d01d0c66.js +1 -0
- package/dist/multi/920.app-d01d0c66.js +1 -0
- package/dist/multi/991.app-d01d0c66.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-d01d0c66.js +2 -0
- package/dist/multi/app-d01d0c66.js.LICENSE.txt +16 -0
- package/dist/multi/manifest.json +26 -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-d01d0c66.css +39 -0
- package/dist/single/app-6596cb08.js +2 -0
- package/dist/single/app-6596cb08.js.LICENSE.txt +16 -0
- package/dist/single/manifest.json +3 -0
- package/package.json +107 -0
- package/postcss.config.js +5 -0
- package/src/assets/scss/_common.scss +143 -0
- package/src/assets/scss/day.scss +51 -0
- package/src/assets/scss/fonts.scss +3 -0
- package/src/assets/scss/index.scss +7 -0
- package/src/assets/scss/night.scss +61 -0
- package/src/assets/scss/palette.scss +393 -0
- package/src/assets/scss/theme.scss +119 -0
- package/src/assets/scss/vars.scss +9 -0
- package/src/assets/svg/line-alerts-alert-circle.svg +12 -0
- package/src/assets/svg/line-general-eye.svg +7 -0
- package/src/assets/svg/line-icon-bomb-2.svg +12 -0
- package/src/components/ArrowButton/index.tsx +36 -0
- package/src/components/ArrowButton/styles.scss +35 -0
- package/src/components/BaseLayout/index.tsx +43 -0
- package/src/components/BaseLayout/styles.scss +60 -0
- package/src/components/Footer/FooterLogo.tsx +16 -0
- package/src/components/Footer/FooterVersion.tsx +37 -0
- package/src/components/Footer/index.tsx +13 -0
- package/src/components/Footer/styles.scss +14 -0
- package/src/components/Header/index.tsx +28 -0
- package/src/components/Header/styles.scss +33 -0
- package/src/components/LanguagePicker/index.tsx +40 -0
- package/src/components/MainReport/index.tsx +21 -0
- package/src/components/MainReport/styles.scss +11 -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/index.tsx +22 -0
- package/src/components/ReportBody/Filters.tsx +90 -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 +72 -0
- package/src/components/ReportBody/styles.scss +69 -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 +51 -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 +52 -0
- package/src/components/SideBySide/styles.scss +65 -0
- package/src/components/SplitLayout/index.tsx +77 -0
- package/src/components/SplitLayout/styles.scss +85 -0
- package/src/components/Tabs/index.tsx +62 -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 +26 -0
- package/src/components/TestResult/TestResultDropdown/styles.scss +34 -0
- package/src/components/TestResult/TestResultEmpty/index.tsx +34 -0
- package/src/components/TestResult/TestResultEmpty/styles.scss +25 -0
- package/src/components/TestResult/TestResultHeader/TestResultBreadcrumbs.tsx +44 -0
- package/src/components/TestResult/TestResultHeader/index.tsx +21 -0
- package/src/components/TestResult/TestResultHeader/styles.scss +48 -0
- package/src/components/TestResult/TestResultHistory/TestResultHistoryItem.tsx +66 -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 +81 -0
- package/src/components/TestResult/TestResultInfo/styles.scss +68 -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 +43 -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 +51 -0
- package/src/components/TestResult/TestResultRetriesView/index.tsx +24 -0
- package/src/components/TestResult/TestResultRetriesView/styles.scss +69 -0
- package/src/components/TestResult/TestResultSetup/index.tsx +58 -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 +25 -0
- package/src/components/TestResult/TestResultStatus/styles.scss +36 -0
- package/src/components/TestResult/TestResultSteps/index.tsx +58 -0
- package/src/components/TestResult/TestResultSteps/styles.scss +225 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachment.tsx +76 -0
- package/src/components/TestResult/TestResultSteps/testResultAttachmentInfo.tsx +83 -0
- package/src/components/TestResult/TestResultSteps/testResultStep.tsx +84 -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 +68 -0
- package/src/components/TestResult/TestResultTabs/styles.scss +76 -0
- package/src/components/TestResult/TestResultTeardown/index.tsx +59 -0
- package/src/components/TestResult/TestStepsEmpty/index.tsx +23 -0
- package/src/components/TestResult/TestStepsEmpty/styles.scss +25 -0
- package/src/components/TestResult/TrError/TrDiff.tsx +124 -0
- package/src/components/TestResult/TrError/index.tsx +78 -0
- package/src/components/TestResult/TrError/styles.scss +133 -0
- package/src/components/TestResult/index.tsx +62 -0
- package/src/components/TestResult/styles.scss +11 -0
- package/src/components/ThemeButton/ThemeButton.tsx +20 -0
- package/src/components/ToggleLayout/index.tsx +17 -0
- package/src/components/Tree/index.tsx +75 -0
- package/src/components/Tree/styles.scss +189 -0
- package/src/i18n/constants.ts +124 -0
- package/src/i18n/locales/am.json +133 -0
- package/src/i18n/locales/az.json +133 -0
- package/src/i18n/locales/de.json +133 -0
- package/src/i18n/locales/en.json +134 -0
- package/src/i18n/locales/es.json +133 -0
- package/src/i18n/locales/fr.json +133 -0
- package/src/i18n/locales/he.json +133 -0
- package/src/i18n/locales/it.json +133 -0
- package/src/i18n/locales/ja.json +133 -0
- package/src/i18n/locales/ka.json +133 -0
- package/src/i18n/locales/kr.json +133 -0
- package/src/i18n/locales/nl.json +133 -0
- package/src/i18n/locales/pl.json +131 -0
- package/src/i18n/locales/pt.json +133 -0
- package/src/i18n/locales/ru.json +131 -0
- package/src/i18n/locales/sv.json +133 -0
- package/src/i18n/locales/tr.json +133 -0
- package/src/i18n/locales/zh.json +133 -0
- package/src/index.html +40 -0
- package/src/index.tsx +96 -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/layout.ts +36 -0
- package/src/stores/locale.ts +75 -0
- package/src/stores/modal.ts +22 -0
- package/src/stores/router.ts +48 -0
- package/src/stores/stats.ts +36 -0
- package/src/stores/testResults.ts +66 -0
- package/src/stores/theme.ts +32 -0
- package/src/stores/tree.ts +157 -0
- package/src/stores/types.ts +5 -0
- package/src/styles.scss +45 -0
- package/src/types/globals.d.ts +13 -0
- package/src/types/window.d.ts +8 -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/loadFromLocalStorage.ts +8 -0
- package/src/utils/statuses.ts +55 -0
- package/src/utils/time.ts +17 -0
- package/src/utils/treeFilters.ts +147 -0
- package/test/utils/treeFilters.test.ts +448 -0
- package/tsconfig.json +27 -0
- package/types.d.ts +99 -0
- package/vitest.config.ts +18 -0
- package/webpack.config.js +112 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.layout {
|
|
2
|
+
margin: auto;
|
|
3
|
+
padding: 12px 32px;
|
|
4
|
+
background: var(--bg-base-secondary);
|
|
5
|
+
color: var(--on-text-primary);
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.wrapper {
|
|
11
|
+
max-width: 920px;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
margin: auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content {
|
|
18
|
+
box-shadow: var(--shadow-small);
|
|
19
|
+
background: var(--bg-base-primary);
|
|
20
|
+
border-radius: 12px;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.test-results {
|
|
25
|
+
min-height: 320px;
|
|
26
|
+
padding-bottom: 32px;
|
|
27
|
+
padding-top: 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.logo {
|
|
31
|
+
display: inline-block;
|
|
32
|
+
margin-bottom: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.title {
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
line-height: 1.25;
|
|
38
|
+
color: var(--on-text-primary);
|
|
39
|
+
margin-bottom: 8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.above {
|
|
43
|
+
display: flex;
|
|
44
|
+
justify-content: space-between;
|
|
45
|
+
width: 100%;
|
|
46
|
+
padding-bottom: 12px;
|
|
47
|
+
align-items: center;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.below {
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: space-between;
|
|
53
|
+
align-items: center;
|
|
54
|
+
padding: 16px 8px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.test-result-errors {
|
|
58
|
+
padding: 0 24px;
|
|
59
|
+
margin-top: 12px;
|
|
60
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Text } from "@allurereport/web-components";
|
|
2
|
+
import { ReportLogoFull } from "../ReportLogoFull";
|
|
3
|
+
import * as styles from "./styles.scss";
|
|
4
|
+
|
|
5
|
+
export const FooterLogo = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className={styles["footer-logo"]}>
|
|
8
|
+
<a href="https://allurereport.org" target={"_blank"} rel="noreferrer">
|
|
9
|
+
<Text type="paragraph" size="m" className={styles["footer-logo"]}>
|
|
10
|
+
Powered by
|
|
11
|
+
</Text>
|
|
12
|
+
<ReportLogoFull className={styles.logo} />
|
|
13
|
+
</a>
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getReportOptions } from "@allurereport/web-commons";
|
|
2
|
+
import { Text } from "@allurereport/web-components";
|
|
3
|
+
import { useEffect, useState } from "preact/hooks";
|
|
4
|
+
import type { AwesomeReportOptions } from "types";
|
|
5
|
+
import { currentLocaleIso } from "@/stores";
|
|
6
|
+
import * as styles from "./styles.scss";
|
|
7
|
+
|
|
8
|
+
export const FooterVersion = () => {
|
|
9
|
+
const [createdAt, setCreatedAt] = useState<number | null>(null);
|
|
10
|
+
const [currentVersion, setCurrentVersion] = useState<string>();
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const reportOptions = getReportOptions<AwesomeReportOptions>();
|
|
14
|
+
if (reportOptions?.createdAt) {
|
|
15
|
+
setCreatedAt(Number(reportOptions.createdAt));
|
|
16
|
+
}
|
|
17
|
+
if (reportOptions?.allureVersion) {
|
|
18
|
+
setCurrentVersion(reportOptions.allureVersion as string);
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
|
|
23
|
+
month: "numeric",
|
|
24
|
+
day: "numeric",
|
|
25
|
+
year: "numeric",
|
|
26
|
+
hour: "numeric",
|
|
27
|
+
minute: "numeric",
|
|
28
|
+
second: "numeric",
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Text type="paragraph" size="m" className={styles.version}>
|
|
33
|
+
{formattedCreatedAt}
|
|
34
|
+
{currentVersion && <span> Ver: {currentVersion}</span>}
|
|
35
|
+
</Text>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import * as styles from "@/components/BaseLayout/styles.scss";
|
|
3
|
+
import { FooterLogo } from "@/components/Footer/FooterLogo";
|
|
4
|
+
import { FooterVersion } from "@/components/Footer/FooterVersion";
|
|
5
|
+
|
|
6
|
+
export const Footer = () => {
|
|
7
|
+
return (
|
|
8
|
+
<div className={clsx(styles.below)}>
|
|
9
|
+
<FooterLogo />
|
|
10
|
+
<FooterVersion />
|
|
11
|
+
</div>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ClassValue } from "clsx";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
import { LanguagePicker } from "@/components/LanguagePicker";
|
|
4
|
+
import { TestResultBreadcrumbs } from "@/components/TestResult/TestResultHeader/TestResultBreadcrumbs";
|
|
5
|
+
import { ThemeButton } from "@/components/ThemeButton/ThemeButton";
|
|
6
|
+
import ToggleLayout from "@/components/ToggleLayout";
|
|
7
|
+
import { route } from "@/stores/router";
|
|
8
|
+
import { testResultStore } from "@/stores/testResults";
|
|
9
|
+
import * as styles from "./styles.scss";
|
|
10
|
+
|
|
11
|
+
interface HeaderProps {
|
|
12
|
+
className?: ClassValue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const Header = ({ className }: HeaderProps) => {
|
|
16
|
+
const { id } = route.value;
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className={clsx(styles.above, className)}>
|
|
20
|
+
{id && <TestResultBreadcrumbs testResult={testResultStore.value?.data?.[id]} />}
|
|
21
|
+
<div className={styles.right}>
|
|
22
|
+
<LanguagePicker />
|
|
23
|
+
<ToggleLayout />
|
|
24
|
+
<ThemeButton />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.above {
|
|
2
|
+
margin-bottom: 12px;
|
|
3
|
+
display: flex;
|
|
4
|
+
width: 100%;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 12px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.logoWrapper {
|
|
11
|
+
margin-right: auto;
|
|
12
|
+
color: var(--on-text-secondary);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.logo {
|
|
16
|
+
margin-right: 8px;
|
|
17
|
+
color: var(--on-icon-secondary);
|
|
18
|
+
top: -2px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.left {
|
|
22
|
+
margin-right: auto;
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 12px;
|
|
25
|
+
align-items: center;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.right {
|
|
29
|
+
margin-left: auto;
|
|
30
|
+
display: flex;
|
|
31
|
+
gap: 4px;
|
|
32
|
+
align-items: center;
|
|
33
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DropdownButton, Menu } from "@allurereport/web-components";
|
|
2
|
+
import { LANG_LOCALE, type LangLocale } from "@/i18n/constants";
|
|
3
|
+
import { currentLocale } from "@/stores";
|
|
4
|
+
import { setLocale } from "@/stores/locale";
|
|
5
|
+
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
7
|
+
const langPickerOptions = Object.entries(LANG_LOCALE).map(([key, { full }]) => ({
|
|
8
|
+
key: key as LangLocale,
|
|
9
|
+
value: full,
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
export const LanguagePicker = () => {
|
|
13
|
+
const locale = currentLocale.value;
|
|
14
|
+
const handleSelect = (selectedOption: LangLocale) => {
|
|
15
|
+
setLocale(selectedOption);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Menu
|
|
20
|
+
size="s"
|
|
21
|
+
menuTrigger={({ isOpened, onClick }) => (
|
|
22
|
+
<DropdownButton
|
|
23
|
+
style="ghost"
|
|
24
|
+
size="s"
|
|
25
|
+
text={LANG_LOCALE[locale || "en"].short}
|
|
26
|
+
isExpanded={isOpened}
|
|
27
|
+
onClick={onClick}
|
|
28
|
+
/>
|
|
29
|
+
)}
|
|
30
|
+
>
|
|
31
|
+
<Menu.Section>
|
|
32
|
+
{langPickerOptions.map(({ key, value }) => (
|
|
33
|
+
<Menu.ItemWithCheckmark onClick={() => handleSelect(key)} key={key} isChecked={locale === key}>
|
|
34
|
+
{value}
|
|
35
|
+
</Menu.ItemWithCheckmark>
|
|
36
|
+
))}
|
|
37
|
+
</Menu.Section>
|
|
38
|
+
</Menu>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import clsx from "clsx";
|
|
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
|
+
import { isSplitMode } from "@/stores/layout";
|
|
7
|
+
import * as styles from "./styles.scss";
|
|
8
|
+
|
|
9
|
+
const MainReport = () => {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
{!isSplitMode.value && <Header />}
|
|
13
|
+
<div className={clsx(styles.content, isSplitMode.value ? styles["scroll-inside"] : "")}>
|
|
14
|
+
<ReportHeader />
|
|
15
|
+
<ReportMetadata />
|
|
16
|
+
<ReportBody />
|
|
17
|
+
</div>
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
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,22 @@
|
|
|
1
|
+
import { Modal, type ModalTranslations } from "@allurereport/web-components";
|
|
2
|
+
import { useI18n } from "@/stores";
|
|
3
|
+
import { isModalOpen, modalData } from "@/stores/modal";
|
|
4
|
+
|
|
5
|
+
export const ModalComponent = () => {
|
|
6
|
+
const { t } = useI18n("controls");
|
|
7
|
+
|
|
8
|
+
const translations: ModalTranslations = {
|
|
9
|
+
tooltipDownload: t("downloadAttachment"),
|
|
10
|
+
tooltipPreview: t("previewAttachment"),
|
|
11
|
+
openInNewTabButton: t("openInNewTab"),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Modal
|
|
16
|
+
{...modalData.value}
|
|
17
|
+
translations={translations}
|
|
18
|
+
isModalOpen={isModalOpen.value}
|
|
19
|
+
closeModal={() => (isModalOpen.value = false)}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|