Skip to content

Commit 6f23367

Browse files
error handling
1 parent 419d5c1 commit 6f23367

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

frontend/src/components/ConnectionModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,4 @@ const ConnectionModal: React.FunctionComponent<ConnectionModalProps> = ({
152152
</>
153153
);
154154
};
155-
export default ConnectionModal;
155+
export default ConnectionModal;

frontend/src/components/Content.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,18 @@ const Content: React.FC<ContentProps> = ({ isExpanded, showChatBot, openChatBot
239239
Generate Graph
240240
</Button>
241241
<Button
242-
loading={filesData.some((f) => f?.status === 'Processing')}
243242
disabled={disableCheckGraph || !filesData.some((f) => f?.status === 'Completed')}
244243
onClick={handleGraphView}
245244
className='mr-0.5'
246245
>
247246
Show Graph
248247
</Button>
249-
<Button href={openGraphUrl} target='_blank' disabled={disableCheckGraph} className='ml-0.5'>
248+
<Button
249+
href={openGraphUrl}
250+
target='_blank'
251+
disabled={disableCheckGraph || !filesData.some((f) => f?.status === 'Completed')}
252+
className='ml-0.5'
253+
>
250254
Open Graph
251255
</Button>
252256
<Button

frontend/src/components/GraphViewModal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ RETURN nodes, rels`;
2020
const pureDocument = `
2121
MATCH (d:Document {status:'Completed'})
2222
WITH d ORDER BY d.createdAt DESC
23-
LIMIT 10
23+
LIMIT 5
2424
MATCH docs=(d)<-[:PART_OF]-(c:Chunk)
2525
WITH docs,
2626
collect { MATCH p=(c)-[:NEXT_CHUNK]-() RETURN p } as chain,
@@ -34,7 +34,7 @@ RETURN nodes, rels
3434
const docEntitiesGraph = `
3535
MATCH (d:Document {status:'Completed'})
3636
WITH d ORDER BY d.createdAt DESC
37-
LIMIT 10
37+
LIMIT 5
3838
MATCH docs=(d)<-[:PART_OF]-(c:Chunk)
3939
WITH docs, collect { OPTIONAL MATCH p=(c:Chunk)-[:HAS_ENTITY]->(e)--(:!Chunk) RETURN p } as entities,
4040
collect { MATCH p=(c)-[:NEXT_CHUNK]-() RETURN p } as chain,
@@ -47,7 +47,7 @@ RETURN nodes, rels`;
4747
const knowledgeGraph = `
4848
MATCH (d:Document {status:'Completed'})
4949
WITH d ORDER BY d.createdAt DESC
50-
LIMIT 10
50+
LIMIT 5
5151
MATCH (d)<-[:PART_OF]-(c:Chunk)
5252
WITH
5353
collect { OPTIONAL MATCH p=(c)-[:HAS_ENTITY]->(e)--(:!Chunk) RETURN p } as entities
@@ -172,7 +172,7 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
172172
}
173173
});
174174

175-
const newNodes = neo4jNodes.map((n:any) => {
175+
const newNodes = neo4jNodes.map((n: any) => {
176176
return {
177177
id: n.elementId,
178178
size: getSize(n),
@@ -249,8 +249,9 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
249249
}
250250
})
251251
.catch((error: any) => {
252+
setLoading(false);
252253
setStatus('danger');
253-
setStatusMessage(error);
254+
setStatusMessage(error.message);
254255
});
255256
}
256257
}, [open, graphType]);

0 commit comments

Comments
 (0)