-
Notifications
You must be signed in to change notification settings - Fork 2
fix: resolve TypeScript build errors in console app #1197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,7 @@ | |
| * @module utils/metadataConverters | ||
| */ | ||
|
|
||
| import type { ObjectDefinition, DesignerFieldDefinition, DesignerFieldType } from '@object-ui/types'; | ||
| import type { ObjectDefinition, ObjectDefinitionRelationship, DesignerFieldDefinition, DesignerFieldType } from '@object-ui/types'; | ||
|
|
||
| // --------------------------------------------------------------------------- | ||
| // Raw metadata shapes (from the ObjectStack API) | ||
|
|
@@ -87,7 +87,7 @@ export function toObjectDefinition(obj: MetadataObject, index: number): ObjectDe | |
| relationships: Array.isArray(obj.relationships) | ||
| ? obj.relationships.map((r) => ({ | ||
| relatedObject: r.object || r.relatedObject || '', | ||
| type: r.type || 'one-to-many', | ||
| type: (r.type || 'one-to-many') as ObjectDefinitionRelationship['type'], | ||
| label: r.label || r.name || undefined, | ||
| foreignKey: r.foreign_key || r.foreignKey || undefined, | ||
|
Comment on lines
88
to
92
|
||
| })) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HubCard.iconwas widened toReact.ElementType, but the rendering code uses<Icon className="..." />.ElementTypedoesn’t guarantee the component acceptsclassName, so this reduces type safety and can mask icon incompatibilities. Prefer a more specific icon type (e.g.,LucideIconfromlucide-reactorReact.ComponentType<{ className?: string }>), and adjustgetIcon()’s return type accordingly so call sites stay type-safe.