Skip to content

Commit

Permalink
feat(report): added link from report to log page
Browse files Browse the repository at this point in the history
Fixes #214

Signed-off-by: Danil Kostromin <[email protected]>
  • Loading branch information
Danil Kostromin committed Nov 12, 2024
1 parent f218233 commit 3134dbc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ import { BranchBlock, RevisionBlock } from '@/shared/types';
import { CopyShortUrlButtonContainer } from '@/bublik/features/copy-url';

import { WarningsHoverCard } from '../run-report-test';
import { routes } from '@/router';

interface RunReportHeaderProps {
label: string;
runUrl: string;
runId: number;
sourceUrl: string;
branches: BranchBlock[];
revisions: RevisionBlock[];
warnings: string[];
}

function RunReportHeader(props: RunReportHeaderProps) {
const { label, runUrl, sourceUrl, branches, revisions, warnings } = props;
const { label, runUrl, sourceUrl, branches, revisions, warnings, runId } =
props;
const [searchParams] = useSearchParams();
const configId = searchParams.get('config');

Expand Down Expand Up @@ -54,6 +57,12 @@ function RunReportHeader(props: RunReportHeaderProps) {
Run
</Link>
</ButtonTw>
<ButtonTw asChild variant="secondary" size="xss">
<Link to={routes.log({ runId })}>
<Icon name="BoxArrowRight" className="mr-1.5" />
Log
</Link>
</ButtonTw>
<CopyShortUrlButtonContainer />
</div>
</CardHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ function TableOfContentsItem({ item, depth = 0 }: TableOfContentsItemProps) {

interface RunReportProps {
blocks: ReportRoot;
runId: number;
}

function RunReport(props: RunReportProps) {
const { blocks } = props;
const { blocks, runId } = props;

const branchBlocks = useMemo(
() => blocks.content.filter((b) => b.type === 'branch-block'),
Expand Down Expand Up @@ -195,6 +196,7 @@ function RunReport(props: RunReportProps) {
branches={branchBlocks}
revisions={revisionsBlocks}
warnings={blocks.warnings}
runId={runId}
/>
<RunReportTableOfContents contents={generateTableOfContents(blocks)} />
<RunReportContentList blocks={testBlocks} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function RunReportContainer() {

if (!data) return <RunReportEmpty />;

return <RunReport blocks={data} />;
return <RunReport blocks={data} runId={Number(runId)} />;
}

export { RunReportContainer };

0 comments on commit 3134dbc

Please sign in to comment.