Skip to content

Commit 8936a22

Browse files
fix: various bugs (#736)
1 parent 3b10819 commit 8936a22

File tree

29 files changed

+247
-161
lines changed

29 files changed

+247
-161
lines changed

src/app/components/columns.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { ComponentSheet } from "@/components/stack-components/component-sheet";
55
import { ComponentBadge } from "@/components/stack-components/ComponentBadge";
66
import { snakeCaseToTitleCase } from "@/lib/strings";
77
import { sanitizeUrl } from "@/lib/url";
8-
import { getUsername } from "@/lib/user";
98
import { StackComponent } from "@/types/components";
109
import { ColumnDef } from "@tanstack/react-table";
1110
import { Tag } from "@zenml-io/react-component-library/components/server";
@@ -88,9 +87,9 @@ export function getComponentList(): ColumnDef<StackComponent>[] {
8887
header: "Author",
8988
accessorFn: (row) => row.body?.user?.name,
9089
cell: ({ row }) => {
91-
const author = row.original.body?.user;
90+
const author = row.original.body?.user?.name;
9291
if (!author) return null;
93-
return <InlineAvatar username={getUsername(author)} />;
92+
return <InlineAvatar username={author} />;
9493
}
9594
},
9695
{

src/app/pipelines/PipelinesTab/DeletePipelineAlert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export function DeletePipelineAlert() {
1515

1616
return (
1717
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
18-
<AlertDialogTrigger>
18+
<AlertDialogTrigger asChild>
1919
<Button
20-
className="rounded-sharp border-none bg-white"
20+
className="rounded-sharp border-y-0 bg-white"
2121
size="md"
2222
emphasis="subtle"
2323
intent="secondary"

src/app/pipelines/RunsTab/DeleteRunAlert.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ export function DeleteRunAlert() {
1515

1616
return (
1717
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
18-
<AlertDialogTrigger>
18+
<AlertDialogTrigger asChild>
1919
<Button
20-
className="rounded-sharp border-none bg-white"
20+
className="rounded-sharp border-y-0 bg-white"
2121
size="md"
2222
emphasis="subtle"
2323
intent="secondary"

src/app/pipelines/RunsTab/columns.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ export const runsColumns: ColumnDef<PipelineRun>[] = [
137137
id: "author",
138138
header: "Author",
139139
accessorFn: (row) => ({
140-
name: row.body?.user?.body?.full_name || row.body?.user?.name
140+
name: row.body?.user?.name
141141
}),
142142
cell: ({ getValue }) => {
143143
const { name } = getValue<{
144-
name: string;
144+
name?: string;
145145
}>();
146146

147+
if (!name) return null;
148+
147149
return <InlineAvatar username={name} />;
148150
}
149151
},

src/app/runs/[id]/_Tabs/Configuration/ParameterCollapsible.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ChevronDown from "@/assets/icons/chevron-down.svg?react";
22
import { NestedCollapsible } from "@/components/NestedCollapsible";
3+
import { NotAvailable } from "@/components/not-available";
34
import { pipelineDeploymentQueries } from "@/data/pipeline-deployments";
45
import { useQuery } from "@tanstack/react-query";
56
import {
@@ -37,7 +38,7 @@ export function PipelineParamsCollapsible({ deploymentId }: Props) {
3738
Pipeline Parameters
3839
</CollapsibleHeader>
3940
<CollapsibleContent className="border-t border-theme-border-moderate bg-theme-surface-primary px-5 py-3">
40-
Not available
41+
<NotAvailable />
4142
</CollapsibleContent>
4243
</CollapsiblePanel>
4344
);

src/app/settings/members/columns.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { DisplayDate } from "@/components/DisplayDate";
22
import { InlineAvatar } from "@/components/InlineAvatar";
3-
import { getUsername } from "@/lib/user";
43
import { User, UserBody } from "@/types/user";
54
import { ColumnDef } from "@tanstack/react-table";
65
import { Badge } from "@zenml-io/react-component-library";
@@ -71,7 +70,7 @@ export function columns({ isAdmin }: Props): ColumnDef<User>[] {
7170
header: "",
7271
accessorFn: (row) => ({
7372
id: row.id,
74-
name: getUsername(row)
73+
name: row.name
7574
}),
7675
meta: {
7776
width: "5%"

src/app/settings/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
import { InlineAvatar } from "@/components/InlineAvatar";
12
import { useCurrentUser } from "@/data/users/current-user-query";
3+
import { Skeleton } from "@zenml-io/react-component-library";
24
import { Outlet } from "react-router-dom";
35
import { DisplayServer, ProfileSettingsMenu, ServerSettingsMenu } from "./LayoutSidebar";
4-
import { InlineAvatar } from "@/components/InlineAvatar";
56
import { VersionDisplay } from "./VersionDisplay";
6-
import { getUsername } from "@/lib/user";
7-
import { Skeleton } from "@zenml-io/react-component-library";
87

98
export default function SettingsPage() {
109
const { data } = useCurrentUser();
@@ -20,7 +19,7 @@ export default function SettingsPage() {
2019
{data ? (
2120
<div className="flex flex-col gap-4">
2221
<p className="text-text-xs font-semibold uppercase text-theme-text-tertiary">Account</p>
23-
<InlineAvatar username={getUsername(data)} />
22+
<InlineAvatar username={data.name} />
2423
</div>
2524
) : (
2625
<Skeleton className="h-[70px] w-full" />

src/app/settings/profile/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Avatar, AvatarFallback, Box, Skeleton } from "@zenml-io/react-component-library";
22
import { UpdateProfileForm } from "./UpdateProfileForm";
33
import { useCurrentUser } from "@/data/users/current-user-query";
4-
import { getUsername } from "@/lib/user";
54

65
export default function ProfilePage() {
76
const { data: user } = useCurrentUser();
@@ -15,7 +14,7 @@ export default function ProfilePage() {
1514
{user ? (
1615
<Avatar size="xxl" className="ml-5 h-[140px] w-[140px]" type="rounded">
1716
<AvatarFallback className="text-display-lg" size="xxl">
18-
{getUsername(user)[0]}
17+
{user.name[0]}
1918
</AvatarFallback>
2019
</Avatar>
2120
) : (

src/app/settings/secrets/columns.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ import { CopyButton } from "@/components/CopyButton";
33
import { DisplayDate } from "@/components/DisplayDate";
44
import { InlineAvatar } from "@/components/InlineAvatar";
55
import { getSecretSnippet } from "@/lib/code-snippets";
6-
import { getUsername } from "@/lib/user";
76
import { routes } from "@/router/routes";
87
import { SecretNamespace } from "@/types/secret";
9-
import { User } from "@/types/user";
108
import { ColumnDef } from "@tanstack/react-table";
119
import { Link } from "react-router-dom";
1210
import SecretsDropdown from "./SecretsDropdown";
@@ -54,14 +52,11 @@ export const secretsColumns: ColumnDef<SecretNamespace>[] = [
5452
{
5553
id: "author",
5654
header: "Author",
57-
accessorFn: (row) => row.body?.user,
55+
accessorFn: (row) => row.body?.user?.name,
5856
cell: ({ getValue }) => {
59-
const user = getValue<User>();
60-
return (
61-
<>
62-
<InlineAvatar username={getUsername(user)} />
63-
</>
64-
);
57+
const name = getValue<string>();
58+
if (!name) return null;
59+
return <InlineAvatar username={name} />;
6560
}
6661
},
6762
{

src/app/settings/service-accounts/DeleteAlert.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function DeleteServiceAccountAlert() {
2121
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
2222
<AlertDialogTrigger asChild>
2323
<Button
24-
className="rounded-sharp border-none bg-white"
24+
className="rounded-sharp border-y-0 bg-white"
2525
size="md"
2626
emphasis="subtle"
2727
intent="secondary"

0 commit comments

Comments
 (0)