Skip to content

Commit 8f91013

Browse files
committed
Fix remaining TypeScript compilation errors
- Add createdBy property to CreateGraphInput interface - Add tags and defaultRole properties to Graph interface - Fix User teamId references to use team?.id instead - Add missing edgeCount to GraphHierarchy builds - Fix implicit any type in GraphContext find callback All critical TypeScript build errors now resolved.
1 parent f54a306 commit 8f91013

5 files changed

Lines changed: 13 additions & 7 deletions

File tree

packages/web/src/components/UserSelector.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function UserSelector() {
4646
}
4747
};
4848

49-
const currentTeamUsers = availableUsers.filter(user => user.teamId === currentTeam?.id);
49+
const currentTeamUsers = availableUsers.filter(user => user.team?.id === currentTeam?.id);
5050

5151
return (
5252
<div className="relative" ref={dropdownRef}>
@@ -137,15 +137,15 @@ export function UserSelector() {
137137
))}
138138

139139
{/* Other team users */}
140-
{availableUsers.filter(user => user.teamId !== currentTeam?.id).length > 0 && (
140+
{availableUsers.filter(user => user.team?.id !== currentTeam?.id).length > 0 && (
141141
<>
142142
<div className="text-xs font-medium text-gray-500 px-2 py-1 mt-3 uppercase tracking-wide border-t pt-3">
143143
Other Teams
144144
</div>
145145
{availableUsers
146-
.filter(user => user.teamId !== currentTeam?.id)
146+
.filter(user => user.team?.id !== currentTeam?.id)
147147
.map((user) => {
148-
const userTeam = availableTeams.find(t => t.id === user.teamId);
148+
const userTeam = availableTeams.find(t => t.id === user.team?.id);
149149
return (
150150
<button
151151
key={user.id}

packages/web/src/contexts/GraphContext.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function GraphProvider({ children }: GraphProviderProps) {
101101
let graphToSelect = null;
102102

103103
if (storedGraphId) {
104-
graphToSelect = parsedGraphs.find(g => g.id === storedGraphId);
104+
graphToSelect = parsedGraphs.find((g: Graph) => g.id === storedGraphId);
105105
}
106106

107107
// Auto-select first graph if none selected or stored graph not found
@@ -270,6 +270,7 @@ export function GraphProvider({ children }: GraphProviderProps) {
270270
type: originalGraph.type,
271271
parentGraphId: originalGraph.parentGraphId,
272272
teamId: originalGraph.teamId,
273+
createdBy: currentUser?.id || '',
273274
copyFromGraphId: graphId
274275
});
275276
};
@@ -405,6 +406,7 @@ function buildHierarchy(graph: Graph, allGraphs: Graph[]): GraphHierarchy {
405406
type: graph.type,
406407
children,
407408
nodeCount: graph.nodeCount,
409+
edgeCount: graph.edgeCount,
408410
isShared: graph.isShared,
409411
permissions: getPermissionLevel(graph)
410412
};

packages/web/src/pages/Login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function Login() {
1111

1212
const handleUserSelect = (user: User) => {
1313
setSelectedUser(user);
14-
const userTeam = availableTeams.find(t => t.id === user.teamId);
14+
const userTeam = availableTeams.find(t => t.id === user.team?.id);
1515
setSelectedTeam(userTeam || null);
1616
};
1717

@@ -30,7 +30,7 @@ export function Login() {
3030
}
3131
};
3232

33-
const teamUsers = selectedTeam ? availableUsers.filter(u => u.teamId === selectedTeam.id) : [];
33+
const teamUsers = selectedTeam ? availableUsers.filter(u => u.team?.id === selectedTeam.id) : [];
3434

3535
return (
3636
<div className="min-h-screen bg-gradient-to-br from-gray-900 via-gray-800 to-gray-900 flex items-center justify-center p-4">

packages/web/src/types/graph.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export interface Graph {
99
createdBy: string;
1010
createdAt: string;
1111
updatedAt: string;
12+
tags?: string[];
13+
defaultRole?: string;
1214

1315
// Hierarchy
1416
children?: Graph[];
@@ -136,6 +138,7 @@ export interface CreateGraphInput {
136138
type: Graph['type'];
137139
parentGraphId?: string;
138140
teamId: string;
141+
createdBy: string;
139142
templateId?: string;
140143
copyFromGraphId?: string;
141144
tags?: string[];

temp_fix.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Temporary marker for file surgery

0 commit comments

Comments
 (0)