Skip to content

Commit c25ee92

Browse files
CopilotCopilot
andcommitted
fix: resolve all TS7006 implicit any type errors in console app
Add explicit `: any` type annotations to all callback parameters that were triggering TS7006 errors under strict TypeScript mode in the console app. This covers render/visibleWhen callbacks in view-config-schema.tsx, find/map/filter/flatMap callbacks in the test file, and various event/action handler parameters across App.tsx, AppSidebar.tsx, DashboardView.tsx, MetadataInspector.tsx, ObjectView.tsx, OnboardingWalkthrough.tsx, SearchResultsPage.tsx, and useObjectActions.ts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f817681 commit c25ee92

File tree

10 files changed

+156
-156
lines changed

10 files changed

+156
-156
lines changed

apps/console/src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,13 @@ export function AppContent() {
109109
// Global Undo/Redo with toast notifications (Phase 16 L2)
110110
useGlobalUndo({
111111
dataSource: dataSource ?? undefined,
112-
onUndo: (op) => {
112+
onUndo: (op: any) => {
113113
toast.info(`Undo: ${op.description}`, {
114114
duration: 4000,
115115
});
116116
setRefreshKey(k => k + 1);
117117
},
118-
onRedo: (op) => {
118+
onRedo: (op: any) => {
119119
toast.info(`Redo: ${op.description}`, {
120120
duration: 3000,
121121
});
@@ -124,7 +124,7 @@ export function AppContent() {
124124
});
125125

126126
useEffect(() => {
127-
runner.registerHandler('crud_success', async (action) => {
127+
runner.registerHandler('crud_success', async (action: any) => {
128128
setIsDialogOpen(false);
129129
setRefreshKey(k => k + 1);
130130
toast.success(action.params?.message ?? 'Record saved successfully');
@@ -141,7 +141,7 @@ export function AppContent() {
141141

142142
useEffect(() => {
143143
if (!dataSource) return;
144-
const unsub = dataSource.onConnectionStateChange((event) => {
144+
const unsub = dataSource.onConnectionStateChange((event: any) => {
145145
setConnectionState(event.state);
146146
if (event.error) {
147147
console.error('[Console] Connection error:', event.error);

apps/console/src/__tests__/view-config-schema.test.tsx

Lines changed: 93 additions & 93 deletions
Large diffs are not rendered by default.

apps/console/src/components/AppSidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
366366
<SidebarInput
367367
placeholder="Search navigation..."
368368
value={navSearchQuery}
369-
onChange={(e) => setNavSearchQuery(e.target.value)}
369+
onChange={(e: any) => setNavSearchQuery(e.target.value)}
370370
className="pl-8"
371371
/>
372372
</SidebarGroupContent>
@@ -406,7 +406,7 @@ export function AppSidebar({ activeAppName, onAppChange }: { activeAppName: stri
406406
</SidebarMenuButton>
407407
<SidebarMenuAction
408408
showOnHover
409-
onClick={(e) => { e.stopPropagation(); removeFavorite(item.id); }}
409+
onClick={(e: any) => { e.stopPropagation(); removeFavorite(item.id); }}
410410
aria-label={`Remove ${item.label} from favorites`}
411411
>
412412
<StarOff className="h-3 w-3" />

apps/console/src/components/DashboardView.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ function createWidgetId(): string {
5858
/** Ensure every widget in the schema has a unique id. */
5959
function ensureWidgetIds(schema: DashboardSchema): DashboardSchema {
6060
if (!schema.widgets?.length) return schema;
61-
const needsFix = schema.widgets.some((w) => !w.id);
61+
const needsFix = schema.widgets.some((w: any) => !w.id);
6262
if (!needsFix) return schema;
6363
return {
6464
...schema,
65-
widgets: schema.widgets.map((w) => (w.id ? w : { ...w, id: createWidgetId() })),
65+
widgets: schema.widgets.map((w: any) => (w.id ? w : { ...w, id: createWidgetId() })),
6666
};
6767
}
6868

@@ -217,7 +217,7 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
217217
if (!editSchema) return;
218218
const newSchema = {
219219
...editSchema,
220-
widgets: editSchema.widgets.filter((w) => w.id !== widgetId),
220+
widgets: editSchema.widgets.filter((w: any) => w.id !== widgetId),
221221
};
222222
setEditSchema(newSchema);
223223
saveSchema(newSchema);
@@ -263,7 +263,7 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
263263
(field: string, value: any) => {
264264
if (!editSchema) return;
265265
// Map config field keys to proper DashboardSchema updates for live preview
266-
setEditSchema((prev) => {
266+
setEditSchema((prev: any) => {
267267
if (!prev) return prev;
268268
if (field === 'refreshInterval') {
269269
return { ...prev, refreshInterval: Number(value) || 0 };
@@ -275,7 +275,7 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
275275
);
276276

277277
// ---- Widget config panel handlers ---------------------------------------
278-
const selectedWidget = editSchema?.widgets?.find((w) => w.id === selectedWidgetId);
278+
const selectedWidget = editSchema?.widgets?.find((w: any) => w.id === selectedWidgetId);
279279

280280
// Stabilize widget config: only recompute after explicit actions (widget
281281
// switch, save, add). configVersion is incremented on save/add, and
@@ -293,7 +293,7 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
293293
const updates = unflattenWidgetConfig(config, selectedWidget);
294294
const newSchema = {
295295
...editSchema,
296-
widgets: editSchema.widgets.map((w) =>
296+
widgets: editSchema.widgets.map((w: any) =>
297297
w.id === selectedWidgetId ? { ...w, ...updates } : w,
298298
),
299299
};
@@ -307,16 +307,16 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
307307
const handleWidgetFieldChange = useCallback(
308308
(field: string, value: any) => {
309309
if (!selectedWidgetId) return;
310-
setEditSchema((prev) => {
310+
setEditSchema((prev: any) => {
311311
if (!prev) return prev;
312-
const widget = prev.widgets?.find((w) => w.id === selectedWidgetId);
312+
const widget = prev.widgets?.find((w: any) => w.id === selectedWidgetId);
313313
if (!widget) return prev;
314314
const flat = flattenWidgetConfig(widget);
315315
flat[field] = value;
316316
const updates = unflattenWidgetConfig(flat, widget);
317317
return {
318318
...prev,
319-
widgets: prev.widgets.map((w) =>
319+
widgets: prev.widgets.map((w: any) =>
320320
w.id === selectedWidgetId ? { ...w, ...updates } : w,
321321
),
322322
};

apps/console/src/components/MetadataInspector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,6 @@ export function useMetadataInspector() {
144144
const [showDebug, setShowDebug] = useState(autoOpen);
145145
return {
146146
showDebug,
147-
toggleDebug: () => setShowDebug(prev => !prev),
147+
toggleDebug: () => setShowDebug((prev: any) => !prev),
148148
};
149149
}

apps/console/src/components/ObjectView.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -723,32 +723,32 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
723723
viewTypeIcons={VIEW_TYPE_ICONS}
724724
config={{ ...objectDef.viewTabBar, reorderable: isAdmin ? true : objectDef.viewTabBar?.reorderable }}
725725
onAddView={isAdmin ? () => { setViewConfigPanelMode('create'); setShowViewConfigPanel(true); } : undefined}
726-
onRenameView={(id, newName) => {
726+
onRenameView={(id: any, newName: any) => {
727727
// Rename is wired for future backend integration
728728
console.info('[ViewTabBar] Rename view:', id, newName);
729729
}}
730-
onDuplicateView={(id) => {
730+
onDuplicateView={(id: any) => {
731731
console.info('[ViewTabBar] Duplicate view:', id);
732732
}}
733-
onDeleteView={(id) => {
733+
onDeleteView={(id: any) => {
734734
console.info('[ViewTabBar] Delete view:', id);
735735
}}
736-
onSetDefaultView={(id) => {
736+
onSetDefaultView={(id: any) => {
737737
console.info('[ViewTabBar] Set default view:', id);
738738
}}
739-
onShareView={(id) => {
739+
onShareView={(id: any) => {
740740
console.info('[ViewTabBar] Share view:', id);
741741
}}
742-
onPinView={(id, pinned) => {
742+
onPinView={(id: any, pinned: any) => {
743743
console.info('[ViewTabBar] Pin view:', id, pinned);
744744
}}
745-
onReorderViews={(viewIds) => {
745+
onReorderViews={(viewIds: any) => {
746746
console.info('[ViewTabBar] Reorder views:', viewIds);
747747
}}
748-
onChangeViewType={(id, newType) => {
748+
onChangeViewType={(id: any, newType: any) => {
749749
console.info('[ViewTabBar] Change view type:', id, newType);
750750
}}
751-
onConfigView={isAdmin ? (id) => {
751+
onConfigView={isAdmin ? (id: any) => {
752752
handleViewChange(id);
753753
setViewConfigPanelMode('edit');
754754
setShowViewConfigPanel(true);

apps/console/src/components/OnboardingWalkthrough.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function OnboardingWalkthrough() {
9999
const isLast = currentStep === STEPS.length - 1;
100100

101101
return (
102-
<Dialog open={open} onOpenChange={v => { if (!v) dismiss(); }}>
102+
<Dialog open={open} onOpenChange={(v: any) => { if (!v) dismiss(); }}>
103103
<DialogContent className="sm:max-w-md">
104104
<DialogHeader>
105105
<div className="flex items-center justify-between">

apps/console/src/components/SearchResultsPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export function SearchResultsPage() {
137137
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
138138
<Input
139139
value={query}
140-
onChange={e => handleSearch(e.target.value)}
140+
onChange={(e: any) => handleSearch(e.target.value)}
141141
placeholder="Search objects, dashboards, pages, reports..."
142142
className="pl-10 h-11 text-base"
143143
autoFocus

apps/console/src/hooks/useObjectActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function useObjectActions({
7070
});
7171

7272
// Handler: delete
73-
runner.registerHandler('delete', async (action) => {
73+
runner.registerHandler('delete', async (action: any) => {
7474
const recordId = action.params?.recordId || action.recordId;
7575
if (!recordId) return { success: false, error: 'No record ID provided' };
7676

@@ -88,7 +88,7 @@ export function useObjectActions({
8888
});
8989

9090
// Handler: navigate
91-
runner.registerHandler('navigate', async (action) => {
91+
runner.registerHandler('navigate', async (action: any) => {
9292
const url = action.params?.url || action.url;
9393
if (url) {
9494
navigate(url.startsWith('/') ? url : `${baseUrl}/${url}`);

0 commit comments

Comments
 (0)