Skip to content
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

Main fixes to staging branch #1033

Merged
merged 7 commits into from
Jan 24, 2025
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
6 changes: 3 additions & 3 deletions backend/src/graphDB_dataAccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,9 @@ def get_duplicate_nodes_list(self):
AND
(
// either contains each other as substrings or has a text edit distinct of less than 3
(size(toString(other.id)) > 2 AND toLower(n.id) CONTAINS toLower(other.id)) OR
(size(toString(n.id)) > 2 AND toLower(other.id) CONTAINS toLower(n.id))
OR (size(toString(n.id))>5 AND apoc.text.distance(toLower(n.id), toLower(other.id)) < $duplicate_text_distance)
(size(toString(other.id)) > 2 AND toLower(toString(n.id)) CONTAINS toLower(toString(other.id))) OR
(size(toString(n.id)) > 2 AND toLower(toString(other.id)) CONTAINS toLower(toString(n.id)))
OR (size(toString(n.id))>5 AND apoc.text.distance(toLower(toString(n.id)), toLower(toString(other.id))) < $duplicate_text_distance)
OR
vector.similarity.cosine(other.embedding, n.embedding) > $duplicate_score_value
)] as similar
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/ChatBot/ChatInfoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { DocumentDuplicateIconOutline, ClipboardDocumentCheckIconOutline } from '@neo4j-ndl/react/icons';
import '../../styling/info.css';
import Neo4jRetrievalLogo from '../../assets/images/Neo4jRetrievalLogo.png';
import { ExtendedNode, UserCredentials, chatInfoMessage } from '../../types';
import { ExtendedNode, chatInfoMessage } from '../../types';
import { useEffect, useMemo, useReducer, useRef, useState } from 'react';
import GraphViewButton from '../Graph/GraphViewButton';
import { chunkEntitiesAPI } from '../../services/ChunkEntitiesInfo';
Expand Down Expand Up @@ -142,7 +142,6 @@ const ChatInfoModal: React.FC<chatInfoMessage> = ({
toggleInfoLoading();
try {
const response = await chunkEntitiesAPI(
userCredentials as UserCredentials,
userCredentials?.database,
nodeDetails,
entities_ids,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ const Content: React.FC<ContentProps> = ({
const selectedRows = childRef.current?.getSelectedRows();
if (selectedRows?.length) {
const expiredFilesExists = selectedRows.some(
(c) => isFileReadyToProcess(c, true) && isExpired((c?.createdAt as Date) ?? new Date())
(c) => isFileReadyToProcess(c, true) && isExpired((c?.createdAt as Date) ?? new Date()));
const largeFileExists = selectedRows.some(
(c) => isFileReadyToProcess(c, true) && typeof c.size === 'number' && c.size > largeFileSize
);
Expand Down Expand Up @@ -811,7 +811,7 @@ const Content: React.FC<ContentProps> = ({
open={showExpirationModal}
largeFiles={filesForProcessing}
extractHandler={handleGenerateGraph}
onClose={() => setshowExpirationModal(false)}
onClose={() => setShowExpirationModal(false)}
loading={extractLoading}
selectedRows={childRef.current?.getSelectedRows() as CustomFile[]}
isLargeDocumentAlert={false}
Expand Down
25 changes: 13 additions & 12 deletions frontend/src/components/Popups/GraphEnhancementDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,34 @@ export default function GraphEnhancementDialog({ open, onClose }: { open: boolea
<Tabs.Tab
tabId={1}
htmlAttributes={{
'aria-label': 'Disconnected Nodes',
'aria-label': 'Additional Instructions',
}}
>
Disconnected Nodes
Additional Instructions
</Tabs.Tab>
<Tabs.Tab
tabId={2}
htmlAttributes={{
'aria-label': 'Duplication Nodes',
'aria-label': 'Disconnected Nodes',
}}
>
De-Duplication Of Nodes
Disconnected Nodes
</Tabs.Tab>
<Tabs.Tab
tabId={3}
htmlAttributes={{
'aria-label': 'Post Processing Jobs',
'aria-label': 'Duplication Nodes',
}}
>
Post Processing Jobs
De-Duplication Of Nodes
</Tabs.Tab>
<Tabs.Tab
tabId={4}
htmlAttributes={{
'aria-label': 'Additional Instructions',
'aria-label': 'Post Processing Jobs',
}}
>
Additional Instructions
Post Processing Jobs
</Tabs.Tab>
</Tabs>
</Flex>
Expand All @@ -123,17 +123,18 @@ export default function GraphEnhancementDialog({ open, onClose }: { open: boolea
</div>
</Tabs.TabPanel>
<Tabs.TabPanel className='n-flex n-flex-col n-gap-token-4 n-p-token-6' value={activeTab} tabId={1}>
<DeletePopUpForOrphanNodes deleteHandler={orphanNodesDeleteHandler} loading={orphanDeleteAPIloading} />
<AdditionalInstructionsText closeEnhanceGraphSchemaDialog={onClose} />
</Tabs.TabPanel>
<Tabs.TabPanel className='n-flex n-flex-col n-gap-token-4 n-p-token-6' value={activeTab} tabId={2}>
<DeduplicationTab />
<DeletePopUpForOrphanNodes deleteHandler={orphanNodesDeleteHandler} loading={orphanDeleteAPIloading} />
</Tabs.TabPanel>
<Tabs.TabPanel className='n-flex n-flex-col n-gap-token-4 n-p-token-6' value={activeTab} tabId={3}>
<PostProcessingCheckList />
<DeduplicationTab />
</Tabs.TabPanel>
<Tabs.TabPanel className='n-flex n-flex-col n-gap-token-4 n-p-token-6' value={activeTab} tabId={4}>
<AdditionalInstructionsText closeEnhanceGraphSchemaDialog={onClose} />
<PostProcessingCheckList />
</Tabs.TabPanel>

</Dialog.Content>
</Dialog>
);
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/services/GetNodeLabelsRelTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { ServerData } from '../types';
import api from '../API/Index';

export const getNodeLabelsAndRelTypes = async () => {
const formData = new FormData();
try {
const response = await api.post<ServerData>(`/schema`);
const response = await api.post<ServerData>(`/schema`,formData);
return response;
} catch (error) {
console.log(error);
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/services/GetOrphanNodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { OrphanNodeResponse } from '../types';
import api from '../API/Index';

export const getOrphanNodes = async () => {
const formData = new FormData();
try {
const response = await api.post<OrphanNodeResponse>(`/get_unconnected_nodes_list`);
const response = await api.post<OrphanNodeResponse>(`/get_unconnected_nodes_list`,formData);
return response;
} catch (error) {
console.log(error);
Expand Down