Skip to content

Commit f1a8760

Browse files
graph fix
1 parent 5f1e8fa commit f1a8760

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

frontend/src/components/ConnectionModal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ export default function ConnectionModal({ open, setOpenConnection, setConnection
8080
return acc;
8181
}, {});
8282
parseAndSetURI(configObject.NEO4J_URI);
83-
setUsername(configObject.NEO4J_USERNAME);
84-
setPassword(configObject.NEO4J_PASSWORD);
85-
setDatabase(configObject.NEO4J_DATABASE);
83+
setUsername(configObject.NEO4J_USERNAME ?? 'neo4j');
84+
setPassword(configObject.NEO4J_PASSWORD ?? '');
85+
setDatabase(configObject.NEO4J_DATABASE ?? 'neo4j');
8686
} else {
8787
setMessage({ type: 'danger', content: 'Please drop a valid file' });
8888
}

frontend/src/components/GraphViewModal.tsx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
9898
graphType.length === 3
9999
? queryMap.DocChunkEntities
100100
: graphType.includes('Entities') && graphType.includes('Chunks')
101-
? queryMap.ChunksEntities
102-
: graphType.includes('Entities') && graphType.includes('Document')
103-
? queryMap.DocEntities
104-
: graphType.includes('Document') && graphType.includes('Chunks')
105-
? queryMap.DocChunks
106-
: graphType.includes('Entities') && graphType.length === 1
107-
? queryMap.Entities
108-
: graphType.includes('Chunks') && graphType.length === 1
109-
? queryMap.Chunks
110-
: queryMap.Document;
101+
? queryMap.ChunksEntities
102+
: graphType.includes('Entities') && graphType.includes('Document')
103+
? queryMap.DocEntities
104+
: graphType.includes('Document') && graphType.includes('Chunks')
105+
? queryMap.DocChunks
106+
: graphType.includes('Entities') && graphType.length === 1
107+
? queryMap.Entities
108+
: graphType.includes('Chunks') && graphType.length === 1
109+
? queryMap.Chunks
110+
: queryMap.Document;
111111
if (viewPoint === 'showGraphView') {
112112
queryToRun = constructQuery(newCheck, documentNo);
113113
console.log('inside If QueryToRun', queryToRun);
@@ -118,7 +118,7 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
118118
const session = driver?.session();
119119
setLoading(true);
120120
session
121-
?.run(queryToRun, { document_name: inspectedName })
121+
?.run(queryToRun, { 'document_name': inspectedName })
122122
.then((results) => {
123123
if (results.records && results.records.length > 0) {
124124
// @ts-ignore
@@ -228,6 +228,13 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
228228
const handleZoomOut = () => {
229229
nvlRef.current?.setZoom(nvlRef.current.getScale() * 0.7);
230230
};
231+
232+
const onClose=()=>{
233+
setStatus('unknown');
234+
setStatusMessage('');
235+
setGraphViewOpen(false)
236+
}
237+
231238
return (
232239
<>
233240
<Dialog
@@ -239,7 +246,7 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
239246
open={open}
240247
aria-labelledby='form-dialog-title'
241248
disableCloseButton={false}
242-
onClose={() => setGraphViewOpen(false)}
249+
onClose={onClose}
243250
>
244251
<Dialog.Header id='form-dialog-title'>
245252
{headerTitle}

0 commit comments

Comments
 (0)