Skip to content

Commit 385cea8

Browse files
2 parents e90aaa3 + b8da456 commit 385cea8

File tree

7 files changed

+40
-17
lines changed

7 files changed

+40
-17
lines changed

frontend/src/components/Content.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const Content: React.FC<ContentProps> = ({
3030
openTextSchema,
3131
isSchema,
3232
setIsSchema,
33+
showEnhancementDialog,
34+
setshowEnhancementDialog,
3335
}) => {
3436
const [init, setInit] = useState<boolean>(false);
3537
const [openConnection, setOpenConnection] = useState<boolean>(false);
@@ -41,7 +43,6 @@ const Content: React.FC<ContentProps> = ({
4143
const [extractLoading, setextractLoading] = useState<boolean>(false);
4244
const [isLargeFile, setIsLargeFile] = useState<boolean>(false);
4345
const [showSettingnModal, setshowSettingModal] = useState<boolean>(false);
44-
const [showEnhancementDialog, setshowEnhancementDialog] = useState<boolean>(false);
4546

4647
const {
4748
filesData,

frontend/src/components/Layout/PageLayout.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export default function PageLayoutNew({
2828
const [showChatBot, setShowChatBot] = useState<boolean>(false);
2929
const [showDrawerChatbot, setShowDrawerChatbot] = useState<boolean>(true);
3030
const [clearHistoryData, setClearHistoryData] = useState<boolean>(false);
31+
const [showEnhancementDialog, setshowEnhancementDialog] = useState<boolean>(false);
3132
const { userCredentials } = useCredentials();
3233
const toggleLeftDrawer = () => setIsLeftExpanded(!isLeftExpanded);
3334
const toggleRightDrawer = () => setIsRightExpanded(!isRightExpanded);
@@ -86,16 +87,26 @@ export default function PageLayoutNew({
8687
<SideNav isExpanded={isLeftExpanded} position='left' toggleDrawer={toggleLeftDrawer} />
8788
<DrawerDropzone isExpanded={isLeftExpanded} />
8889
<SchemaFromTextDialog
89-
open={showTextFromSchemaDialog}
90+
open={showTextFromSchemaDialog.show}
9091
openSettingsDialog={openSettingsDialog}
9192
onClose={() => {
92-
setShowTextFromSchemaDialog(false);
93+
setShowTextFromSchemaDialog({ triggeredFrom: '', show: false });
94+
switch (showTextFromSchemaDialog.triggeredFrom) {
95+
case 'enhancementtab':
96+
setshowEnhancementDialog(true);
97+
break;
98+
case 'schemadialog':
99+
openSettingsDialog();
100+
break;
101+
default:
102+
break;
103+
}
93104
}}
94105
showAlert={showAlert}
95106
></SchemaFromTextDialog>
96107
<SettingsModal
97108
openTextSchema={() => {
98-
setShowTextFromSchemaDialog(true);
109+
setShowTextFromSchemaDialog({ triggeredFrom: 'schemadialog', show: true });
99110
}}
100111
open={isSettingPanelExpanded}
101112
onClose={closeSettingModal}
@@ -109,10 +120,12 @@ export default function PageLayoutNew({
109120
isRightExpanded={isRightExpanded}
110121
showChatBot={showChatBot}
111122
openTextSchema={() => {
112-
setShowTextFromSchemaDialog(true);
123+
setShowTextFromSchemaDialog({ triggeredFrom: 'schemadialog', show: true });
113124
}}
114125
isSchema={isSchema}
115126
setIsSchema={setIsSchema}
127+
showEnhancementDialog={showEnhancementDialog}
128+
setshowEnhancementDialog={setshowEnhancementDialog}
116129
/>
117130
{showDrawerChatbot && (
118131
<DrawerChatbot messages={messages} isExpanded={isRightExpanded} clearHistoryData={clearHistoryData} />

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,12 @@ export default function DeletePopUpForOrphanNodes({
224224
zebraStriping: true,
225225
headerStyle: 'clean',
226226
}}
227-
rootProps={
228-
{
229-
className:'max-h-[355px] !overflow-y-auto'
230-
}
231-
}
227+
rootProps={{
228+
className: 'max-h-[355px] !overflow-y-auto',
229+
}}
232230
isLoading={isLoading}
233231
components={{
234-
Body: (props) => <DataGridComponents.Body {...props} />,
232+
Body: (props) => <DataGridComponents.Body {...props} />,
235233
PaginationNumericButton: ({ isSelected, innerProps, ...restProps }) => {
236234
return (
237235
<DataGridComponents.PaginationNumericButton

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function GraphEnhancementDialog({
7878
<EntityExtractionSettings
7979
view='Tabs'
8080
openTextSchema={() => {
81-
setShowTextFromSchemaDialog(true);
81+
setShowTextFromSchemaDialog({ triggeredFrom: 'enhancementtab', show: true });
8282
}}
8383
colseEnhanceGraphSchemaDialog={onClose}
8484
settingView='headerView'

frontend/src/components/WebSources/GenericSourceModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ export default function GenericModal({
4545
<Tabs fill='underline' onChange={setactiveTab} size='large' value={activeTab}>
4646
{APP_SOURCES != undefined && APP_SOURCES.includes('youtube') && (
4747
<Tabs.Tab tabId={0} aria-label='Database' disabled={isLoading}>
48-
<img src={themeUtils.colorMode==="light"?youtubelightmodelogo:youtubedarkmodelogo} className={`brandimg`}></img>
48+
<img
49+
src={themeUtils.colorMode === 'light' ? youtubelightmodelogo : youtubedarkmodelogo}
50+
className={`brandimg`}
51+
></img>
4952
</Tabs.Tab>
5053
)}
5154
{APP_SOURCES != undefined && APP_SOURCES.includes('wiki') && (

frontend/src/context/UsersFiles.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { createContext, useContext, useState, Dispatch, SetStateAction, FC, useE
22
import { CustomFile, FileContextProviderProps, OptionType } from '../types';
33
import { defaultLLM } from '../utils/Constants';
44
import { useCredentials } from './UserCredentials';
5-
5+
interface showTextFromSchemaDialogType {
6+
triggeredFrom: string;
7+
show: boolean;
8+
}
69
interface FileContextType {
710
files: (File | null)[] | [];
811
filesData: CustomFile[] | [];
@@ -26,8 +29,8 @@ interface FileContextType {
2629
setchatMode: Dispatch<SetStateAction<string>>;
2730
isSchema: boolean;
2831
setIsSchema: React.Dispatch<React.SetStateAction<boolean>>;
29-
showTextFromSchemaDialog: boolean;
30-
setShowTextFromSchemaDialog: React.Dispatch<React.SetStateAction<boolean>>;
32+
showTextFromSchemaDialog: showTextFromSchemaDialogType;
33+
setShowTextFromSchemaDialog: React.Dispatch<React.SetStateAction<showTextFromSchemaDialogType>>;
3134
}
3235
const FileContext = createContext<FileContextType | undefined>(undefined);
3336

@@ -47,7 +50,10 @@ const FileContextProvider: FC<FileContextProviderProps> = ({ children }) => {
4750
const [chatMode, setchatMode] = useState<string>('graph+vector');
4851
const { userCredentials } = useCredentials();
4952
const [isSchema, setIsSchema] = useState<boolean>(false);
50-
const [showTextFromSchemaDialog, setShowTextFromSchemaDialog] = useState<boolean>(false);
53+
const [showTextFromSchemaDialog, setShowTextFromSchemaDialog] = useState<showTextFromSchemaDialogType>({
54+
triggeredFrom: '',
55+
show: false,
56+
});
5157

5258
useEffect(() => {
5359
if (selectedNodeLabelstr != null) {

frontend/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ export interface ContentProps {
154154
openTextSchema: () => void;
155155
isSchema?: boolean;
156156
setIsSchema: Dispatch<SetStateAction<boolean>>;
157+
showEnhancementDialog: boolean;
158+
setshowEnhancementDialog: Dispatch<SetStateAction<boolean>>;
157159
}
158160

159161
export interface FileTableProps {

0 commit comments

Comments
 (0)