Skip to content

Commit

Permalink
fix: fix sdf viewer from giving 404 error when submitting config
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverDudgeon committed Jan 20, 2025
1 parent 3d35345 commit 9769c22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/components/ViewFilePopover/SDFViewerListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export const SDFViewerListItem = ({ fileName, path, onClick }: SDFViewerListItem
const router = useRouter();

const breadcrumbs = useProjectBreadcrumbs();
path === undefined && (path = breadcrumbs.join("/"));
if (path === undefined) {
path = breadcrumbs.join("/");
}

return (
<A
Expand Down
5 changes: 1 addition & 4 deletions src/features/SDFViewer/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
// const onSubmit: SubmitHandler<SDFViewerConfig> = (data) => console.log(data);

return (
<form onSubmit={() => void handleSubmit(onSubmit)}>
<form onSubmit={(event) => void handleSubmit(onSubmit, (errors) => console.log(errors))(event)}>
<Box sx={{ display: "grid", gap: 1, gridTemplateColumns: "1fr repeat(6, min-content)" }}>
<Typography component="h3" variant="h4">
Field name
Expand Down Expand Up @@ -119,7 +119,6 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
</MenuItem>
))}
</TextField>

<Controller
control={control}
defaultValue={config[key].include}
Expand All @@ -144,7 +143,6 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
/>
)}
/>

<TextField
defaultValue={config[key].min}
disabled={!getIsNumeric(key)}
Expand All @@ -165,7 +163,6 @@ export const ConfigEditor = ({ schema, config, onChange }: ConfigEditorProps) =>
sx={{ width: "7em" }}
type="number"
/>

<TextField
disabled
select
Expand Down

0 comments on commit 9769c22

Please sign in to comment.