Skip to content

Commit dd7007d

Browse files
feat: add display name (#957)
1 parent fb521ef commit dd7007d

File tree

9 files changed

+60
-9
lines changed

9 files changed

+60
-9
lines changed

src/app/components/columns.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ export function getComponentList(): ColumnDef<StackComponent>[] {
9090
{
9191
id: "flavor",
9292
header: "Flavor",
93-
accessorFn: (row) => row.body?.flavor_name,
93+
accessorFn: (row) => row.resources?.flavor?.body?.display_name,
9494
cell: ({ row }) => {
95-
const flavor = row.original.body?.flavor_name;
95+
const flavor = row.original.resources?.flavor?.body?.display_name;
9696
return (
9797
<Tag
9898
rounded={false}

src/app/components/create/config-step.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export function ConfiguratinStep({ flavor, type, handleBack }: Props) {
2323
navigate(routes.components.detail(id));
2424
}
2525

26+
const flavorName = flavor.body?.display_name ?? snakeCaseToTitleCase(flavor.name);
27+
2628
return (
2729
<>
2830
<Wizard.Header className="flex items-center gap-2">
@@ -36,7 +38,7 @@ export function ConfiguratinStep({ flavor, type, handleBack }: Props) {
3638
<span className="sr-only">Go step back</span>
3739
</Button>
3840
<span>
39-
Configure your {snakeCaseToTitleCase(flavor.name)} {snakeCaseToTitleCase(type)}
41+
Configure your {flavorName} {snakeCaseToTitleCase(type)}
4042
</span>
4143
</Wizard.Header>
4244
<Wizard.Body className="p-0">

src/app/runs/[id]/pipeline-viz/dag/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import RunIcon from "@/assets/icons/terminal.svg?react";
12
import { ArtifactNode } from "@/components/dag-visualizer/ArtifactNode";
23
import { DagControls } from "@/components/dag-visualizer/Controls";
34
import { ElkEdge } from "@/components/dag-visualizer/elk-edge";
@@ -7,6 +8,7 @@ import { PreviewStepNode } from "@/components/dag-visualizer/PreviewStep";
78
import { SheetProvider } from "@/components/dag-visualizer/sheet-context";
89
import { StepNode } from "@/components/dag-visualizer/StepNode";
910
import { TriggeredRunNode } from "@/components/dag-visualizer/TriggeredRunNode";
11+
import { EmptyState } from "@/components/EmptyState";
1012
import { Dag } from "@/types/dag-visualizer";
1113
import { Spinner } from "@zenml-io/react-component-library/components/server";
1214
import ReactFlow, { NodeTypes } from "reactflow";
@@ -36,6 +38,17 @@ export function DAG({ dagData, refetchHandler, setActiveView }: Props) {
3638
const { nodes, edges, onNodesChange, onEdgesChange, initialRender, topMostNode, shouldFitView } =
3739
useDag(dagData);
3840

41+
if (dagData.nodes.length === 0) {
42+
return (
43+
<EmptyState icon={<RunIcon className="h-[120px] w-[120px] fill-neutral-300" />}>
44+
<div className="space-y-2 text-center">
45+
<p className="text-display-xs font-semibold">No steps to display</p>
46+
<p className="text-base text-neutral-500">There are no steps to display for this run.</p>
47+
</div>
48+
</EmptyState>
49+
);
50+
}
51+
3952
if (initialRender)
4053
return (
4154
<div className="flex h-full flex-col items-center justify-center">

src/app/stacks/create/existing-infrastructure/steps/final/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function StackComponentItem({ component }: { component: StackComponent }) {
8787
<FlavorIcon
8888
width={24}
8989
height={24}
90-
flavor={component.body?.flavor_name || ""}
90+
flavor={component.resources?.flavor.name || ""}
9191
type={component.body?.type || "orchestrator"}
9292
/>
9393
<div>

src/components/stack-components/component-detail/ConfigTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function BasicParams({ componentId }: Props) {
8383
src={sanitizeUrl(component.body?.logo_url || "")}
8484
alt="Flavor Icon of Component"
8585
/>
86-
<p className="truncate">{component.body?.flavor_name}</p>
86+
<p className="truncate">{component.resources?.flavor?.body?.display_name}</p>
8787
</Tag>
8888
}
8989
/>

src/components/stack-components/component-detail/Header.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ function ComponentIcon({ componentId }: Props) {
9191
if (component.isPending) return <Skeleton className="h-5 w-5" />;
9292
return (
9393
<img
94-
className="h-5 w-5"
94+
width={24}
95+
height={24}
96+
className="shrink-0"
9597
src={sanitizeUrl(component.data.body?.logo_url || "")}
9698
alt={`Icon of component ${component.data.name}`}
9799
/>

src/components/stack-components/create-component/flavor-select.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export function SelectFlavorList({ type, setSelectedFlavor }: Props) {
2929
onClick={() => setSelectedFlavor(flavor)}
3030
id={flavor.id}
3131
name={flavor.name}
32+
displayName={flavor.body?.display_name ?? undefined}
3233
logoUrl={flavor.body?.logo_url ?? undefined}
3334
/>
3435
</li>
@@ -41,12 +42,14 @@ export function SelectFlavorList({ type, setSelectedFlavor }: Props) {
4142
type FlavorListItemItemProps = {
4243
id: string;
4344
name: string;
45+
displayName?: string;
4446
logoUrl?: string;
4547
type: StackComponentType;
4648
onClick?: () => void;
4749
};
4850

49-
function FlavorListItem({ name, logoUrl, onClick, type }: FlavorListItemItemProps) {
51+
function FlavorListItem({ name, logoUrl, onClick, type, displayName }: FlavorListItemItemProps) {
52+
const flavorName = displayName ?? snakeCaseToTitleCase(name);
5053
return (
5154
<Button
5255
onClick={onClick}
@@ -68,7 +71,7 @@ function FlavorListItem({ name, logoUrl, onClick, type }: FlavorListItemItemProp
6871
type={type}
6972
/>
7073
)}
71-
<span className="min-w-0 truncate">{snakeCaseToTitleCase(name)}</span>
74+
<span className="min-w-0 truncate">{flavorName}</span>
7275
</Button>
7376
);
7477
}

src/components/stacks/Sheet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function ComponentListItem({ component }: ComponentListItemProps) {
143143
<img
144144
width={32}
145145
height={32}
146-
alt={`${component.body?.flavor_name} logo`}
146+
alt={`${component.resources?.flavor?.body?.display_name} logo`}
147147
src={sanitizeUrl(component.body?.logo_url || "")}
148148
/>
149149
<div>

src/types/core.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4031,6 +4031,8 @@ export type components = {
40314031
metadata?: {
40324032
[key: string]: unknown;
40334033
} | null;
4034+
/** The number of items in the artifact version if it is sequence-like. This should only be set for artifacts that can be split into parts, like lists or arrays. */
4035+
item_count?: number | null;
40344036
};
40354037
/**
40364038
* ArtifactVersionResponse
@@ -4094,6 +4096,8 @@ export type components = {
40944096
artifact_store_id?: string | null;
40954097
/** The content hash of the artifact version. */
40964098
content_hash?: string | null;
4099+
/** The number of items in the artifact version if it is sequence-like. This should only be set for artifacts that can be split into parts, like lists or arrays. */
4100+
item_count?: number | null;
40974101
};
40984102
/**
40994103
* ArtifactVersionResponseMetadata
@@ -5458,6 +5462,8 @@ export type components = {
54585462
user?: string | null;
54595463
/** The name of the Flavor. */
54605464
name: string;
5465+
/** The display name of the Flavor. */
5466+
display_name?: string | null;
54615467
/** The type of the Flavor. */
54625468
type: components["schemas"]["StackComponentType"];
54635469
/** The JSON schema of this flavor's corresponding configuration. */
@@ -5529,6 +5535,8 @@ export type components = {
55295535
user_id?: string | null;
55305536
/** The type of the Flavor. */
55315537
type: components["schemas"]["StackComponentType"];
5538+
/** The display name of the Flavor. */
5539+
display_name: string;
55325540
/** The name of the integration that the Flavor belongs to. */
55335541
integration: string | null;
55345542
/** The path to the module which contains this Flavor. */
@@ -5577,6 +5585,8 @@ export type components = {
55775585
FlavorUpdate: {
55785586
/** The name of the Flavor. */
55795587
name?: string | null;
5588+
/** The display name of the Flavor. */
5589+
display_name?: string | null;
55805590
/** The type of the Flavor. */
55815591
type?: components["schemas"]["StackComponentType"] | null;
55825592
/** The JSON schema of this flavor's corresponding configuration. */
@@ -5616,6 +5626,10 @@ export type components = {
56165626
step_name: string;
56175627
/** Output Name */
56185628
output_name: string;
5629+
/** Chunk Index */
5630+
chunk_index?: number | null;
5631+
/** Chunk Size */
5632+
chunk_size?: number | null;
56195633
};
56205634
/**
56215635
* LoadedVisualization
@@ -10047,6 +10061,12 @@ export type components = {
1004710061
*/
1004810062
permission_denied?: boolean;
1004910063
input_type: components["schemas"]["StepRunInputArtifactType"];
10064+
/** The index of the input artifact in the step run. */
10065+
index?: number | null;
10066+
/** The index of the chunk in the input artifact. */
10067+
chunk_index?: number | null;
10068+
/** The size of the chunk in the input artifact. */
10069+
chunk_size?: number | null;
1005010070
};
1005110071
/**
1005210072
* StepRunRequest
@@ -10290,6 +10310,11 @@ export type components = {
1029010310
};
1029110311
/** Invocation Id */
1029210312
invocation_id: string;
10313+
/**
10314+
* Enable Heartbeat
10315+
* @default false
10316+
*/
10317+
enable_heartbeat?: boolean;
1029310318
};
1029410319
/**
1029510320
* StepSpec
@@ -10308,6 +10333,11 @@ export type components = {
1030810333
};
1030910334
/** Invocation Id */
1031010335
invocation_id: string;
10336+
/**
10337+
* Enable Heartbeat
10338+
* @default false
10339+
*/
10340+
enable_heartbeat?: boolean;
1031110341
};
1031210342
/**
1031310343
* Tag
@@ -13715,6 +13745,7 @@ export type operations = {
1371513745
scope_user?: string | null;
1371613746
user?: string | null;
1371713747
name?: string | null;
13748+
display_name?: string | null;
1371813749
type?: string | null;
1371913750
integration?: string | null;
1372013751
};

0 commit comments

Comments
 (0)