Skip to content

Commit

Permalink
split changes and imps
Browse files Browse the repository at this point in the history
  • Loading branch information
todti committed Feb 17, 2025
1 parent 9e0717c commit f589ad4
Show file tree
Hide file tree
Showing 45 changed files with 914 additions and 396 deletions.
1 change: 1 addition & 0 deletions packages/plugin-awesome/src/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ export const generateStaticFiles = async (
reportUuid,
groupBy: groupBy?.length ? groupBy : ["parentSuite", "suite", "subSuite"],
layout,
allureVersion,
};
const html = compile({
headTags: headTags.join("\n"),
Expand Down
31 changes: 15 additions & 16 deletions packages/web-awesome/src/assets/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,19 @@ body {
background: var(--bg-base-secondary);
font-family: var(--font-family);
-webkit-text-size-adjust: 100%;
* > * {
&::-webkit-scrollbar {
width: 16px;
margin-right: 8px;
}

&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: var(--scrollbar-color);
border: 4px solid var(--bg-base-primary);
}

&::-webkit-scrollbar-thumb:hover {
cursor: pointer;
}
}
//* > * {
// &::-webkit-scrollbar {
// width: 16px;
// }
//
// &::-webkit-scrollbar-thumb {
// border-radius: 10px;
// background: var(--scrollbar-color);
// border: 4px solid var(--bg-base-primary);
// }
//
// &::-webkit-scrollbar-thumb:hover {
// cursor: pointer;
// }
//}
}
6 changes: 3 additions & 3 deletions packages/web-awesome/src/components/BaseLayout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Loadable, PageLoader } from "@allurereport/web-components";
import { Loadable, Modal, PageLoader } from "@allurereport/web-components";
import { useEffect } from "preact/hooks";
import { Footer } from "@/components/Footer";
import MainReport from "@/components/MainReport";
import Modal from "@/components/Modal";
import TestResult from "@/components/TestResult";
import { modalData } from "@/stores/modal";
import { route } from "@/stores/router";
import { fetchTestResult, fetchTestResultNav, testResultStore } from "@/stores/testResults";
import { treeStore } from "@/stores/tree";
Expand All @@ -29,7 +29,7 @@ export const BaseLayout = () => {
transformData={(data) => data[testResultId]}
renderData={(testResult) => (
<>
<Modal testResult={testResult} />
<Modal {...modalData.value} />
<div className={styles.wrapper} key={testResult?.id}>
<TestResult testResult={testResult} />
<Footer />
Expand Down
6 changes: 5 additions & 1 deletion packages/web-awesome/src/components/Footer/FooterVersion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ import * as styles from "./styles.scss";

export const FooterVersion = () => {
const [createdAt, setCreatedAt] = useState<number | null>(null);
const [currentVersion, setCurrentVersion] = useState<string>();

useEffect(() => {
const reportOptions = getReportOptions<AllureAwesomeReportOptions>();
if (reportOptions?.createdAt) {
setCreatedAt(Number(reportOptions.createdAt));
}
if (reportOptions?.allureVersion) {
setCurrentVersion(reportOptions.allureVersion as string);
}
}, []);

const formattedCreatedAt = new Date(createdAt as number).toLocaleDateString(currentLocaleIso.value as string, {
Expand All @@ -27,7 +31,7 @@ export const FooterVersion = () => {
return (
<Text type="paragraph" size="m" className={styles.version}>
{formattedCreatedAt}
<span> Ver: 3.0.0</span>
<span> Ver: {currentVersion}</span>
</Text>
);
};
8 changes: 3 additions & 5 deletions packages/web-awesome/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { IconButton, allureIcons } from "@allurereport/web-components";
import { LanguagePicker } from "@/components/LanguagePicker";
import { ThemeButton } from "@/components/ThemeButton/ThemeButton";
import { layoutStore, toggleLayout } from "@/stores/layout";
import ToggleLayout from "@/components/ToggleLayout";
import * as styles from "./styles.scss";

export const Header = () => {
const isSplitMode = layoutStore.value === "split";
return (
<div className={styles.above}>
<div className={isSplitMode ? styles.left : styles.right}>
<IconButton size={"s"} icon={allureIcons.reportLogo} style={"ghost"} onClick={() => toggleLayout()} />
<div className={styles.right}>
<LanguagePicker />
<ToggleLayout />
<ThemeButton />
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/web-awesome/src/components/Header/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
.right {
margin-left: auto;
display: flex;
gap: 12px;
gap: 4px;
align-items: center;
}
6 changes: 2 additions & 4 deletions packages/web-awesome/src/components/MainReport/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import { Header } from "@/components/Header";
import { ReportBody } from "@/components/ReportBody";
import { ReportHeader } from "@/components/ReportHeader";
import { ReportMetadata } from "@/components/ReportMetadata";
import { layoutStore } from "@/stores/layout";
import { isSplitMode, layoutStore } from "@/stores/layout";
import * as styles from "./styles.scss";

const MainReport = () => {
const isSplitMode = layoutStore.value === "split";

return (
<>
<Header />
<div className={clsx(styles.content, isSplitMode && styles["scroll-inside"])}>
<div className={clsx(styles.content, isSplitMode.value && styles["scroll-inside"])}>
<ReportHeader />
<ReportMetadata />
<ReportBody />
Expand Down
174 changes: 0 additions & 174 deletions packages/web-awesome/src/components/Modal/index.tsx

This file was deleted.

Loading

0 comments on commit f589ad4

Please sign in to comment.