Skip to content

Commit 2f36f34

Browse files
fix: type changes from pydantic update (#614)
1 parent eabe62d commit 2f36f34

File tree

10 files changed

+1564
-1618
lines changed

10 files changed

+1564
-1618
lines changed

src/app/activate-server/ServerNameStep.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function SetServerNameStep({ setUsername }: Props) {
2929
const { mutate } = useActivateServer({
3030
onSuccess: async (data) => {
3131
setUsername(data.name);
32-
loginMutate({ username: data.name, password: serverSettings.admin_password });
32+
loginMutate({ username: data.name, password: serverSettings.admin_password ?? undefined });
3333
},
3434
onError: (error) => {
3535
if (error instanceof Error) {

src/app/activate-user/AccountDetailsStep.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export function AccountDetailsStep() {
88
const { setNewUser, newUser } = useActivationContext();
99

1010
function handleDetailsSubmit({ fullName, getUpdates, email }: AccountDetailForm) {
11-
//@ts-expect-error null is the initial value it needs to be set to
1211
setNewUser((prev) => ({
1312
...prev,
1413
...(email ? { email } : { email: null }),

src/app/activate-user/AwarenessStep.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function AwarenessStep({ userId, setUsername }: Props) {
2929
const { mutate } = useActivateUser({
3030
onSuccess: async (data) => {
3131
setUsername(data.name);
32-
loginMutate({ username: data.name, password: newUser.password });
32+
loginMutate({ username: data.name, password: newUser.password ?? undefined });
3333
},
3434
onError: (error) => {
3535
if (error instanceof Error) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function ConfigurationTab() {
3131

3232
return (
3333
<div className="grid grid-cols-1 gap-5">
34-
<NestedCollapsible title="Parameters" data={data.metadata?.config.parameters} />
34+
<NestedCollapsible title="Parameters" data={data.metadata?.config.parameters ?? undefined} />
3535
{(buildData?.metadata?.images as BuildItemMap)?.orchestrator && (
3636
<DockerImageCollapsible data={buildData?.metadata?.images?.orchestrator as BuildItem} />
3737
)}

src/app/settings/notifications/NotificationsForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ export function NotificationsForm({ settings }: Props) {
4646
const { control, handleSubmit, watch } = useForm<NotificationFormType>({
4747
resolver: zodResolver(NotificationFormSchema),
4848
defaultValues: {
49-
announcements: settings.body?.display_announcements,
50-
updates: settings.body?.display_updates
49+
announcements: settings.body?.display_announcements ?? undefined,
50+
updates: settings.body?.display_updates ?? undefined
5151
}
5252
});
5353

src/app/settings/profile/UpdateProfileForm.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function UpdateProfileForm({ user }: Props) {
107107
Email
108108
</label>
109109
<Input
110-
placeholder={user.metadata?.email}
110+
placeholder={user.metadata?.email ?? undefined}
111111
{...register("email")}
112112
id={emailId}
113113
className="w-full"

src/app/survey/AccountDetailsStep.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export function AccountDetailsStep({ user }: Props) {
1212
const { setSurveyStep } = useSurveyContext();
1313
const { setUser } = useSurveyUserContext();
1414
function handleDetailsSubmit({ fullName, getUpdates, email }: AccountDetailForm) {
15-
//@ts-expect-error null is the initial value it needs to be set to
1615
setUser((prev) => ({
1716
...prev,
1817
...(email ? { email } : { email: null }),

src/components/ExecutionStatus.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Initializing from "@/assets/icons/initializing.svg?react";
66
import Cached from "@/assets/icons/cached.svg?react";
77
import Running from "@/assets/icons/dots-circle.svg?react";
88

9-
export function getExecutionStatusColor(status?: ExecutionStatus) {
9+
export function getExecutionStatusColor(status?: ExecutionStatus | null) {
1010
if (!status) return null;
1111
switch (status) {
1212
case "completed":
@@ -58,7 +58,7 @@ export function ExecutionStatusIcon({
5858
status,
5959
className
6060
}: {
61-
status?: ExecutionStatus;
61+
status?: ExecutionStatus | null;
6262
className?: string;
6363
}) {
6464
if (!status) return null;

src/components/survey/AccountDetailsForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Controller, useForm } from "react-hook-form";
55
import { AccountDetailForm, accountDetailsFormSchema } from "./form-schemas";
66

77
type AccountDetailsProps = {
8-
fullName?: string;
9-
email?: string;
8+
fullName?: string | null;
9+
email?: string | null;
1010
getUpdates?: boolean;
1111
submitHandler: (data: AccountDetailForm) => void;
1212
};

0 commit comments

Comments
 (0)