Skip to content

Commit 98da2fa

Browse files
format and lint fixes
1 parent bfd0ba2 commit 98da2fa

File tree

8 files changed

+27
-34
lines changed

8 files changed

+27
-34
lines changed

frontend/src/components/BreakDownPopOver.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function BreakDownPopOver({ file, isNodeCount = true }: { file: C
1111
<CustomPopOver
1212
Trigger={
1313
<IconButton isClean ariaLabel='infoicon'>
14-
<InformationCircleIconOutline className='n-size-token-7' />
14+
<InformationCircleIconOutline className='n-size-token-3' />
1515
</IconButton>
1616
}
1717
>

frontend/src/components/ChatBot/Chatbot.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
249249
} else {
250250
setListMessages((prev) =>
251251
prev.map((msg) =>
252-
msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg
252+
(msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg)
253253
)
254254
);
255255
}
@@ -264,7 +264,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
264264
} else {
265265
setListMessages((prev) =>
266266
prev.map((msg) =>
267-
msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg
267+
(msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg)
268268
)
269269
);
270270
}
@@ -273,15 +273,15 @@ const Chatbot: FC<ChatbotProps> = (props) => {
273273
console.error(`API call failed for mode ${mode}:`, result.reason);
274274
setListMessages((prev) =>
275275
prev.map((msg) =>
276-
msg.id === chatbotMessageId
276+
(msg.id === chatbotMessageId
277277
? {
278278
...msg,
279279
modes: {
280280
...msg.modes,
281281
[mode]: { message: 'Failed to fetch response for this mode.', error: result.reason },
282282
},
283283
}
284-
: msg
284+
: msg)
285285
)
286286
);
287287
}
@@ -294,7 +294,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
294294
if (error instanceof Error) {
295295
setListMessages((prev) =>
296296
prev.map((msg) =>
297-
msg.id === chatbotMessageId
297+
(msg.id === chatbotMessageId
298298
? {
299299
...msg,
300300
isLoading: false,
@@ -306,7 +306,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
306306
},
307307
},
308308
}
309-
: msg
309+
: msg)
310310
)
311311
);
312312
}

frontend/src/components/Content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const Content: React.FC<ContentProps> = ({
8888
processedCount,
8989
setProcessedCount,
9090
setchatModes,
91-
model
91+
model,
9292
} = useFileContext();
9393
const [viewPoint, setViewPoint] = useState<'tableView' | 'showGraphView' | 'chatInfoView' | 'neighborView'>(
9494
'tableView'
@@ -539,7 +539,7 @@ const Content: React.FC<ContentProps> = ({
539539
setProcessedCount(0);
540540
setConnectionStatus(false);
541541
localStorage.removeItem('password');
542-
localStorage.removeItem('selectedModel')
542+
localStorage.removeItem('selectedModel');
543543
setUserCredentials({ uri: '', password: '', userName: '', database: '' });
544544
setSelectedNodes([]);
545545
setSelectedRels([]);

frontend/src/components/Graph/GraphViewModal.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
6464
graphType.includes('DocumentChunk') && graphType.includes('Entities')
6565
? queryMap.DocChunkEntities
6666
: graphType.includes('DocumentChunk')
67-
? queryMap.DocChunks
68-
: graphType.includes('Entities')
69-
? queryMap.Entities
70-
: '';
67+
? queryMap.DocChunks
68+
: graphType.includes('Entities')
69+
? queryMap.Entities
70+
: '';
7171

7272
// fit graph to original position
7373
const handleZoomToFit = () => {
@@ -114,10 +114,10 @@ const GraphViewModal: React.FunctionComponent<GraphViewModalProps> = ({
114114
const nodeRelationshipData =
115115
viewPoint === graphLabels.showGraphView
116116
? await graphQueryAPI(
117-
userCredentials as UserCredentials,
118-
graphQuery,
119-
selectedRows?.map((f) => f.name)
120-
)
117+
userCredentials as UserCredentials,
118+
graphQuery,
119+
selectedRows?.map((f) => f.name)
120+
)
121121
: await graphQueryAPI(userCredentials as UserCredentials, graphQuery, [inspectedName ?? '']);
122122
return nodeRelationshipData;
123123
} catch (error: any) {

frontend/src/components/Layout/PageLayout.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { useNavigate } from 'react-router';
1818

1919
const ConnectionModal = lazy(() => import('../Popups/ConnectionModal/ConnectionModal'));
2020

21-
2221
const PageLayout: React.FC = () => {
2322
const [openConnection, setOpenConnection] = useState<connectionState>({
2423
openPopUp: false,
@@ -161,8 +160,7 @@ const PageLayout: React.FC = () => {
161160
setConnectionStatus(Boolean(connectionData.data.graph_connection));
162161
setIsBackendConnected(true);
163162
handleDisconnectButtonState(false);
164-
}
165-
else if (!session) {
163+
} else if (!session) {
166164
setUserCredentials(envCredentials);
167165
localStorage.setItem(
168166
'neo4j.connection',
@@ -181,27 +179,22 @@ const PageLayout: React.FC = () => {
181179
setIsReadOnlyUser(envCredentials.isReadonlyUser);
182180
handleDisconnectButtonState(false);
183181
}
184-
}
185-
else {
186-
if (session && !isDev) {
182+
} else if (session && !isDev) {
187183
// For PROD, picking the session values
188184
setUserCredentialsFromSession(session as string);
189185
setConnectionStatus(true);
190186
handleDisconnectButtonState(true);
191-
return;
192-
}
193-
else {
187+
188+
} else {
194189
setOpenConnection((prev) => ({ ...prev, openPopUp: true }));
195190
handleDisconnectButtonState(true);
196191
}
197-
}
198192
} catch (error) {
199193
console.error('Error in DEV session handling:', error);
200194
if (session) {
201195
setUserCredentialsFromSession(session as string);
202196
setConnectionStatus(true);
203-
}
204-
else {
197+
} else {
205198
setErrorMessage(backendApiResponse?.data.error);
206199
setOpenConnection((prev) => ({ ...prev, openPopUp: true }));
207200
}

frontend/src/components/Popups/GraphEnhancementDialog/Deduplication/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ export default function DeduplicationTab() {
104104
const onRemove = (nodeid: string, similarNodeId: string) => {
105105
setDuplicateNodes((prev) => {
106106
return prev.map((d) =>
107-
d.e.elementId === nodeid
107+
(d.e.elementId === nodeid
108108
? {
109109
...d,
110110
similar: d.similar.filter((n) => n.elementId != similarNodeId),
111111
}
112-
: d
112+
: d)
113113
);
114114
});
115115
};

frontend/src/components/Popups/GraphEnhancementDialog/PostProcessingCheckList/SelectedJobList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ export default function SelectedJobList({
1111
}) {
1212
const ongoingPostProcessingTasks = useMemo(
1313
() =>
14-
isGdsActive
14+
(isGdsActive
1515
? postProcessingTasks.includes('enable_communities')
1616
? postProcessingTasks
1717
: postProcessingTasks.filter((s) => s != 'enable_communities')
18-
: postProcessingTasks.filter((s) => s != 'enable_communities'),
18+
: postProcessingTasks.filter((s) => s != 'enable_communities')),
1919
[isGdsActive, postProcessingTasks]
2020
);
2121
return (

frontend/src/utils/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ export const isFileCompleted = (waitingFile: CustomFile, item: SourceNode) =>
396396
waitingFile && item.status === 'Completed';
397397

398398
export const calculateProcessedCount = (prev: number, batchSize: number) =>
399-
prev === batchSize ? batchSize - 1 : prev + 1;
399+
(prev === batchSize ? batchSize - 1 : prev + 1);
400400

401401
export const isProcessingFileValid = (item: SourceNode, userCredentials: UserCredentials) => {
402402
return item.status === 'Processing' && item.fileName != undefined && userCredentials && userCredentials.database;

0 commit comments

Comments
 (0)