Skip to content

Commit 90cb60c

Browse files
fixed the setting modal reopen issue
1 parent 256f6e9 commit 90cb60c

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

frontend/src/components/Content.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const Content: React.FC<ContentProps> = ({
3232
setIsSchema,
3333
showEnhancementDialog,
3434
setshowEnhancementDialog,
35+
closeSettingModal
3536
}) => {
3637
const [init, setInit] = useState<boolean>(false);
3738
const [openConnection, setOpenConnection] = useState<boolean>(false);
@@ -588,6 +589,7 @@ const Content: React.FC<ContentProps> = ({
588589
<GraphEnhancementDialog
589590
open={showEnhancementDialog}
590591
onClose={closeGraphEnhancementDialog}
592+
closeSettingModal={closeSettingModal}
591593
showAlert={showAlert}
592594
></GraphEnhancementDialog>
593595
)}

frontend/src/components/Layout/PageLayout.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ export default function PageLayoutNew({
126126
setIsSchema={setIsSchema}
127127
showEnhancementDialog={showEnhancementDialog}
128128
setshowEnhancementDialog={setshowEnhancementDialog}
129+
closeSettingModal={closeSettingModal}
130+
129131
/>
130132
{showDrawerChatbot && (
131133
<DrawerChatbot messages={messages} isExpanded={isRightExpanded} clearHistoryData={clearHistoryData} />

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Dialog, Tabs, Box, Typography, Flex } from '@neo4j-ndl/react';
22
import graphenhancement from '../../../assets/images/graph-enhancements.svg';
3-
import { useState } from 'react';
3+
import { useEffect, useState } from 'react';
44
import DeletePopUpForOrphanNodes from './DeleteTabForOrphanNodes';
55
import deleteOrphanAPI from '../../../services/DeleteOrphanNodes';
66
import { UserCredentials } from '../../../types';
@@ -13,13 +13,15 @@ import { useFileContext } from '../../../context/UsersFiles';
1313
export default function GraphEnhancementDialog({
1414
open,
1515
onClose,
16+
closeSettingModal
1617
}: {
1718
open: boolean;
1819
onClose: () => void;
1920
showAlert: (
2021
alertmsg: string,
2122
alerttype: OverridableStringUnion<AlertColor, AlertPropsColorOverrides> | undefined
2223
) => void;
24+
closeSettingModal:()=>void
2325
}) {
2426
const [orphanDeleteAPIloading, setorphanDeleteAPIloading] = useState<boolean>(false);
2527
const { setShowTextFromSchemaDialog } = useFileContext();
@@ -35,6 +37,10 @@ export default function GraphEnhancementDialog({
3537
console.log(error);
3638
}
3739
};
40+
useEffect(() => {
41+
closeSettingModal()
42+
}, [])
43+
3844
const [activeTab, setactiveTab] = useState<number>(0);
3945
return (
4046
<Dialog

frontend/src/types.ts

+1
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export interface ContentProps {
156156
setIsSchema: Dispatch<SetStateAction<boolean>>;
157157
showEnhancementDialog: boolean;
158158
setshowEnhancementDialog: Dispatch<SetStateAction<boolean>>;
159+
closeSettingModal:()=>void
159160
}
160161

161162
export interface FileTableProps {

0 commit comments

Comments
 (0)