mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 12:37:20 +00:00
fix active sidebar active item, added error boundaries for relational form fields, fixed schema diagram for m:n relations
This commit is contained in:
@@ -17,6 +17,8 @@ import { Media } from "ui/elements";
|
||||
import { useEvent } from "ui/hooks/use-event";
|
||||
import { EntityJsonSchemaFormField } from "./fields/EntityJsonSchemaFormField";
|
||||
import { EntityRelationalFormField } from "./fields/EntityRelationalFormField";
|
||||
import ErrorBoundary from "ui/components/display/ErrorBoundary";
|
||||
import { Alert } from "ui/components/display/Alert";
|
||||
|
||||
type EntityFormProps = {
|
||||
entity: Entity;
|
||||
@@ -94,20 +96,28 @@ export function EntityForm({
|
||||
const _key = `${entity.name}-${field.name}-${key}`;
|
||||
|
||||
return (
|
||||
<Form.Field
|
||||
<ErrorBoundary
|
||||
key={_key}
|
||||
name={field.name}
|
||||
children={(props) => (
|
||||
<EntityFormField
|
||||
field={field}
|
||||
fieldApi={props}
|
||||
disabled={fieldsDisabled}
|
||||
tabIndex={key + 1}
|
||||
action={action}
|
||||
data={data}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
fallback={
|
||||
<Alert.Exception className="font-mono">
|
||||
Field error: {field.name}
|
||||
</Alert.Exception>
|
||||
}
|
||||
>
|
||||
<Form.Field
|
||||
name={field.name}
|
||||
children={(props) => (
|
||||
<EntityFormField
|
||||
field={field}
|
||||
fieldApi={props}
|
||||
disabled={fieldsDisabled}
|
||||
tabIndex={key + 1}
|
||||
action={action}
|
||||
data={data}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</ErrorBoundary>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user