Skip to content

Commit 62b81f3

Browse files
Copilothotlong
andauthored
fix: resolve all CI TypeScript build errors in console app
- objectDetailWidgets.tsx: pass required `index` arg to toObjectDefinition() - ObjectManagerListAdapter.tsx: remove unused MetadataObject import - SystemHubPage.tsx: remove unused LayoutGrid import - SystemHubPage.tsx: widen HubCard.icon type to React.ElementType - metadataConverters.ts: cast relationship type to proper union type Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/acfc66f8-324c-4b4b-bdeb-08a5b6f52fd6 Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 86c6a12 commit 62b81f3

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

apps/console/src/components/ObjectManagerListAdapter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { toast } from 'sonner';
2121
import { useMetadata } from '../context/MetadataProvider';
2222
import { useMetadataService } from '../hooks/useMetadataService';
2323
import { MetadataService } from '../services/MetadataService';
24-
import { toObjectDefinition, type MetadataObject } from '../utils/metadataConverters';
24+
import { toObjectDefinition } from '../utils/metadataConverters';
2525
import type { MetadataListComponentProps } from '../config/metadataTypeRegistry';
2626

2727
export function ObjectManagerListAdapter({ basePath, metadataType }: MetadataListComponentProps) {

apps/console/src/components/schema/objectDetailWidgets.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function useObjectData(objectName: string) {
4848
);
4949

5050
const object = useMemo(
51-
() => (metadataObject ? toObjectDefinition(metadataObject) : null),
51+
() => (metadataObject ? toObjectDefinition(metadataObject, 0) : null),
5252
[metadataObject],
5353
);
5454

apps/console/src/pages/system/SystemHubPage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
Badge,
1919
} from '@object-ui/components';
2020
import {
21-
LayoutGrid,
2221
Users,
2322
Building2,
2423
Shield,
@@ -35,7 +34,7 @@ import { getIcon } from '../../utils/getIcon';
3534
interface HubCard {
3635
title: string;
3736
description: string;
38-
icon: React.ComponentType<{ className?: string }>;
37+
icon: React.ElementType;
3938
href: string;
4039
countLabel: string;
4140
count: number | null;

apps/console/src/utils/metadataConverters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function toObjectDefinition(obj: MetadataObject, index: number): ObjectDe
8787
relationships: Array.isArray(obj.relationships)
8888
? obj.relationships.map((r) => ({
8989
relatedObject: r.object || r.relatedObject || '',
90-
type: r.type || 'one-to-many',
90+
type: (r.type || 'one-to-many') as 'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many',
9191
label: r.label || r.name || undefined,
9292
foreignKey: r.foreign_key || r.foreignKey || undefined,
9393
}))

0 commit comments

Comments
 (0)