Skip to content

Commit aacc566

Browse files
Merge pull request #678 from zenml-io/staging
Followup Release
2 parents e03d661 + 4cb9b1a commit aacc566

File tree

15 files changed

+335
-157
lines changed

15 files changed

+335
-157
lines changed

src/app/runs/[id]/_Tabs/Overview/ComponentCollapsible.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/app/runs/[id]/_Tabs/Overview/Stack.tsx

Lines changed: 0 additions & 100 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import { AlertPanels } from "./AlertPanels";
22
import { Details } from "./Details";
33
import { OrchestratorCollapsible } from "./Orchestrator";
4-
import { StackCollapsible } from "./Stack";
54

65
export function OverviewTab() {
76
return (
87
<div className="grid grid-cols-1 gap-5">
98
<AlertPanels />
109
<Details />
1110
<OrchestratorCollapsible />
12-
<StackCollapsible />
1311
</div>
1412
);
1513
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import AlertCircle from "@/assets/icons/alert-circle.svg?react";
2+
import { EmptyState } from "@/components/EmptyState";
3+
import { StackInfo } from "@/components/stacks/info";
4+
import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query";
5+
import { useStack } from "@/data/stacks/stack-detail-query";
6+
import { PipelineRun } from "@/types/pipeline-runs";
7+
import { Skeleton } from "@zenml-io/react-component-library";
8+
import { useParams } from "react-router-dom";
9+
10+
export function StackTab() {
11+
const { runId } = useParams() as { runId: string };
12+
13+
const run = usePipelineRun({ runId: runId }, { throwOnError: true });
14+
15+
if (run.isPending) return <Skeleton className="h-[250px] w-full" />;
16+
if (run.isError) return <p>Something went wrong fetching the run</p>;
17+
18+
const stackId = run.data?.body?.stack?.id;
19+
20+
if (!stackId)
21+
return (
22+
<EmptyState icon={<AlertCircle className="h-[120px] w-[120px] fill-neutral-300" />}>
23+
<div className="text-center">
24+
<p className="text-display-xs font-semibold">No Stack</p>
25+
<p className="text-text-lg text-theme-text-secondary">
26+
There is no stack associated with this run.
27+
</p>
28+
</div>
29+
</EmptyState>
30+
);
31+
32+
return <StackTabContent run={run.data} stackId={stackId} />;
33+
}
34+
35+
type StackTabContentProps = {
36+
stackId: string;
37+
run: PipelineRun;
38+
};
39+
function StackTabContent({ stackId, run }: StackTabContentProps) {
40+
const { data, isError, isPending } = useStack({ stackId: stackId });
41+
42+
if (isPending) return <Skeleton className="h-[250px] w-full" />;
43+
44+
if (isError) {
45+
return <p>Failed to fetch Stack</p>;
46+
}
47+
48+
return <StackInfo stack={data} run={run} />;
49+
}

src/app/runs/[id]/_Tabs/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import MetadataIcon from "@/assets/icons/code-square.svg?react";
22
import Collapse from "@/assets/icons/collapse.svg?react";
33
import Info from "@/assets/icons/info.svg?react";
4+
import Stack from "@/assets/icons/stack.svg?react";
45
import Tools from "@/assets/icons/tool.svg?react";
56
import {
67
Button,
@@ -12,9 +13,10 @@ import {
1213
import { Dispatch, SetStateAction } from "react";
1314
import { useNavigate } from "react-router-dom";
1415
import { ConfigurationTab } from "./Configuration";
16+
import { MetadataTab } from "./Metadata";
1517
import { OverviewTab } from "./Overview";
1618
import { useSelectedTab } from "./service";
17-
import { MetadataTab } from "./Metadata";
19+
import { StackTab } from "./Stack";
1820

1921
type TabsHeaderProps = {
2022
setIsPanelOpen: Dispatch<SetStateAction<boolean>>;
@@ -52,6 +54,10 @@ export function RunsDetailTabs() {
5254
<Info className="h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong" />
5355
<span>Overview</span>
5456
</TabsTrigger>
57+
<TabsTrigger className="flex items-center gap-2 truncate text-text-md" value="stack">
58+
<Stack className="h-5 w-5 shrink-0 fill-theme-text-tertiary group-data-[state=active]/trigger:fill-theme-surface-strong" />
59+
<span>Stack</span>
60+
</TabsTrigger>
5561
<TabsTrigger
5662
className="flex items-center gap-2 truncate text-text-md"
5763
value="configuration"
@@ -68,6 +74,9 @@ export function RunsDetailTabs() {
6874
<TabsContent className="m-0 mt-5 border-0 bg-transparent p-0" value="overview">
6975
<OverviewTab />
7076
</TabsContent>
77+
<TabsContent className="m-0 mt-5 border-0 bg-transparent p-0" value="stack">
78+
<StackTab />
79+
</TabsContent>
7180
<TabsContent className="m-0 mt-5 border-0 bg-transparent p-0" value="configuration">
7281
<ConfigurationTab />
7382
</TabsContent>

src/app/runs/[id]/_Tabs/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { z } from "zod";
33

44
const tabParamSchema = z.object({
55
tab: z
6-
.enum(["overview", "configuration", "metadata"])
6+
.enum(["overview", "configuration", "metadata", "stack"])
77
.optional()
88
.default("overview")
99
.catch("overview")

src/components/NestedCollapsible.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
TooltipProvider,
88
TooltipTrigger
99
} from "@zenml-io/react-component-library/components/client";
10-
import { ReactNode } from "react";
10+
import { PropsWithChildren, ReactNode } from "react";
1111
import { Codesnippet } from "./CodeSnippet";
1212
import { CollapsibleCard } from "./CollapsibleCard";
1313
import { KeyValue } from "./KeyValue";
@@ -27,8 +27,9 @@ export function NestedCollapsible({
2727
intent = "primary",
2828
isInitialOpen = false,
2929
contentClassName,
30+
children,
3031
className
31-
}: Props) {
32+
}: PropsWithChildren<Props>) {
3233
const objects: { [key: string]: any } = {};
3334
const nonObjects: { [key: string]: any } = {};
3435
const arrays: { [key: string]: any } = {};
@@ -95,6 +96,7 @@ export function NestedCollapsible({
9596
))}
9697
</div>
9798
)}
99+
{children}
98100
</CollapsibleCard>
99101
);
100102
}

src/components/breadcrumbs/SegmentsBreadcrumbs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import MetadataIcon from "@/assets/icons/code-square.svg?react";
22
import Info from "@/assets/icons/info.svg?react";
33
import TemplatesIcon from "@/assets/icons/pipeline-template.svg?react";
44
import PipelineIcon from "@/assets/icons/pipeline.svg?react";
5+
import Stack from "@/assets/icons/stack.svg?react";
56
import RunIcon from "@/assets/icons/terminal.svg?react";
67
import Tools from "@/assets/icons/tool-02.svg?react";
78
import { capitalize } from "@/lib/strings";
@@ -106,7 +107,8 @@ export const matchSegmentWithTab = (segment: string) => {
106107
pipelines: <PipelineIcon className={iconClasses} />,
107108
metadata: <MetadataIcon className={iconClasses} />,
108109
runs: <RunIcon className={iconClasses} />,
109-
templates: <TemplatesIcon className={iconClasses} />
110+
templates: <TemplatesIcon className={iconClasses} />,
111+
stack: <Stack className={iconClasses} />
110112
};
111113

112114
return routeMap[segment] || <Info className="h-5 w-5 fill-theme-text-tertiary" />;

src/components/stack-components/ComponentBadge.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export function ComponentBadge({ type, children }: Props) {
1111
return (
1212
<Tag
1313
rounded={false}
14-
className="inline-flex items-center gap-0.5 text-text-sm"
14+
className="inline-flex shrink items-center gap-0.5 overflow-x-hidden text-text-sm"
1515
color="purple"
1616
emphasis="minimal"
1717
>
18-
<ComponentIcon type={type} className="h-4 w-4 fill-current" />
19-
<span>{children}</span>
18+
<ComponentIcon type={type} className="h-4 w-4 shrink-0 fill-current" />
19+
<div className="truncate">{children}</div>
2020
</Tag>
2121
);
2222
}

0 commit comments

Comments
 (0)