Skip to content

Bug fixing for Icon #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/src/components/ChatBot/Chatbot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
} else {
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg)
msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg
)
);
}
Expand All @@ -264,7 +264,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
} else {
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg)
msg.id === chatbotMessageId ? { ...msg, modes: { ...msg.modes, [mode]: responseMode } } : msg
)
);
}
Expand All @@ -273,15 +273,15 @@ const Chatbot: FC<ChatbotProps> = (props) => {
console.error(`API call failed for mode ${mode}:`, result.reason);
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId
msg.id === chatbotMessageId
? {
...msg,
modes: {
...msg.modes,
[mode]: { message: 'Failed to fetch response for this mode.', error: result.reason },
},
}
: msg)
: msg
)
);
}
Expand All @@ -294,7 +294,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
if (error instanceof Error) {
setListMessages((prev) =>
prev.map((msg) =>
(msg.id === chatbotMessageId
msg.id === chatbotMessageId
? {
...msg,
isLoading: false,
Expand All @@ -306,7 +306,7 @@ const Chatbot: FC<ChatbotProps> = (props) => {
},
},
}
: msg)
: msg
)
);
}
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/components/ChatBot/chatInfo.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { getNeighbors } from '../../services/GraphQuery';
import { NeoNode, NeoRelationship, UserCredentials } from '../../types';
import { showNormalToast } from '../../utils/toasts';

export const handleGraphNodeClick = async (
userCredentials: UserCredentials,
Expand Down Expand Up @@ -29,6 +30,8 @@ export const handleGraphNodeClick = async (
setNeoRels(relationships);
setOpenGraphView(true);
setViewPoint('chatInfoView');
} else {
showNormalToast('No nodes or relationships found for the selected node.');
}
} catch (error: any) {
console.error('Error fetching neighbors:', error);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Layout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const PageLayout: React.FC = () => {
password: atob(parsedConnection.password),
database: parsedConnection.database,
});
setGdsActive(parsedConnection.isGDS);
setGdsActive(parsedConnection.isgdsActive);
setIsReadOnlyUser(parsedConnection.isReadOnlyUser);
} else {
console.error('Invalid parsed session data:', parsedConnection);
Expand Down Expand Up @@ -124,7 +124,7 @@ const PageLayout: React.FC = () => {
database: envCredentials.database,
userDbVectorIndex: 384,
isReadOnlyUser: envCredentials.isReadonlyUser,
isGDS: envCredentials.isGds,
isgdsActive: envCredentials.isgdsActive,
})
);
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ export default function DeduplicationTab() {
const onRemove = (nodeid: string, similarNodeId: string) => {
setDuplicateNodes((prev) => {
return prev.map((d) =>
(d.e.elementId === nodeid
d.e.elementId === nodeid
? {
...d,
similar: d.similar.filter((n) => n.elementId != similarNodeId),
}
: d)
: d
);
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export default function SelectedJobList({
}) {
const ongoingPostProcessingTasks = useMemo(
() =>
(isGdsActive
isGdsActive
? postProcessingTasks.includes('enable_communities')
? postProcessingTasks
: postProcessingTasks.filter((s) => s != 'enable_communities')
: postProcessingTasks.filter((s) => s != 'enable_communities')),
: postProcessingTasks.filter((s) => s != 'enable_communities'),
[isGdsActive, postProcessingTasks]
);
return (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ export const isFileCompleted = (waitingFile: CustomFile, item: SourceNode) =>
waitingFile && item.status === 'Completed';

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

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