@@ -50,8 +50,6 @@ const ConfirmationDialog = lazy(() => import('./Popups/LargeFilePopUp/Confirmati
50
50
let afterFirstRender = false ;
51
51
52
52
const Content : React . FC < ContentProps > = ( {
53
- isSchema,
54
- setIsSchema,
55
53
showEnhancementDialog,
56
54
toggleEnhancementDialog,
57
55
setOpenConnection,
@@ -141,17 +139,17 @@ const Content: React.FC<ContentProps> = ({
141
139
< PostProcessingToast
142
140
isGdsActive = { isGdsActive }
143
141
postProcessingTasks = { postProcessingTasks }
144
- isSchema = { isSchema }
142
+ isSchema = { selectedNodes . length > 0 || selectedRels . length > 0 }
145
143
/>
146
144
) ;
147
145
try {
148
146
const payload = isGdsActive
149
- ? isSchema
147
+ ? selectedNodes . length > 0 || selectedRels . length > 0
150
148
? postProcessingTasks . filter ( ( task ) => task !== 'graph_cleanup' )
151
149
: postProcessingTasks
152
- : isSchema
153
- ? postProcessingTasks . filter ( ( task ) => task !== 'graph_cleanup' && task !== 'enable_communities' )
154
- : postProcessingTasks . filter ( ( task ) => task !== 'enable_communities' ) ;
150
+ : selectedNodes . length > 0 || selectedRels . length > 0
151
+ ? postProcessingTasks . filter ( ( task ) => task !== 'graph_cleanup' && task !== 'enable_communities' )
152
+ : postProcessingTasks . filter ( ( task ) => task !== 'enable_communities' ) ;
155
153
const response = await postProcessing ( userCredentials as UserCredentials , payload ) ;
156
154
if ( response . data . status === 'Success' ) {
157
155
const communityfiles = response . data ?. data ;
@@ -197,13 +195,6 @@ const Content: React.FC<ContentProps> = ({
197
195
afterFirstRender = true ;
198
196
} , [ queue . items . length , userCredentials ] ) ;
199
197
200
- useEffect ( ( ) => {
201
- const storedSchema = localStorage . getItem ( 'isSchema' ) ;
202
- if ( storedSchema !== null ) {
203
- setIsSchema ( JSON . parse ( storedSchema ) ) ;
204
- }
205
- } , [ isSchema ] ) ;
206
-
207
198
const handleDropdownChange = ( selectedOption : OptionType | null | void ) => {
208
199
if ( selectedOption ?. value ) {
209
200
setModel ( selectedOption ?. value ) ;
@@ -388,7 +379,7 @@ const Content: React.FC<ContentProps> = ({
388
379
const addFilesToQueue = async ( remainingFiles : CustomFile [ ] ) => {
389
380
if ( ! remainingFiles . length ) {
390
381
showNormalToast (
391
- < PostProcessingToast isGdsActive = { isGdsActive } postProcessingTasks = { postProcessingTasks } isSchema = { isSchema } />
382
+ < PostProcessingToast isGdsActive = { isGdsActive } postProcessingTasks = { postProcessingTasks } isSchema = { selectedNodes . length > 0 || selectedRels . length > 0 } />
392
383
) ;
393
384
try {
394
385
const response = await postProcessing ( userCredentials as UserCredentials , postProcessingTasks ) ;
@@ -539,9 +530,8 @@ const Content: React.FC<ContentProps> = ({
539
530
const handleOpenGraphClick = ( ) => {
540
531
const bloomUrl = process . env . VITE_BLOOM_URL ;
541
532
const uriCoded = userCredentials ?. uri . replace ( / : \d + $ / , '' ) ;
542
- const connectURL = `${ uriCoded ?. split ( '//' ) [ 0 ] } //${ userCredentials ?. userName } @${ uriCoded ?. split ( '//' ) [ 1 ] } :${
543
- userCredentials ?. port ?? '7687'
544
- } `;
533
+ const connectURL = `${ uriCoded ?. split ( '//' ) [ 0 ] } //${ userCredentials ?. userName } @${ uriCoded ?. split ( '//' ) [ 1 ] } :${ userCredentials ?. port ?? '7687'
534
+ } `;
545
535
const encodedURL = encodeURIComponent ( connectURL ) ;
546
536
const replacedUrl = bloomUrl ?. replace ( '{CONNECT_URL}' , encodedURL ) ;
547
537
window . open ( replacedUrl , '_blank' ) ;
@@ -601,12 +591,12 @@ const Content: React.FC<ContentProps> = ({
601
591
return prev . map ( ( f ) => {
602
592
return f . name === filename
603
593
? {
604
- ...f ,
605
- status : 'Ready to Reprocess' ,
606
- processingProgress : isStartFromBegining ? 0 : f . processingProgress ,
607
- nodesCount : isStartFromBegining ? 0 : f . nodesCount ,
608
- relationshipsCount : isStartFromBegining ? 0 : f . relationshipsCount ,
609
- }
594
+ ...f ,
595
+ status : 'Ready to Reprocess' ,
596
+ processingProgress : isStartFromBegining ? 0 : f . processingProgress ,
597
+ nodesCount : isStartFromBegining ? 0 : f . nodesCount ,
598
+ relationshipsCount : isStartFromBegining ? 0 : f . relationshipsCount ,
599
+ }
610
600
: f ;
611
601
} ) ;
612
602
} ) ;
@@ -714,20 +704,22 @@ const Content: React.FC<ContentProps> = ({
714
704
const selectedRows = childRef . current ?. getSelectedRows ( ) ;
715
705
if ( selectedRows ?. length ) {
716
706
const expiredFilesExists = selectedRows . some (
717
- ( c ) => isFileReadyToProcess ( c , true ) && isExpired ( c ?. createdAt as Date )
707
+ ( c ) => c . status !== 'Ready to Reprocess' && isExpired ( c ?. createdAt as Date )
718
708
) ;
719
709
const largeFileExists = selectedRows . some (
720
710
( c ) => isFileReadyToProcess ( c , true ) && typeof c . size === 'number' && c . size > largeFileSize
721
711
) ;
722
712
if ( expiredFilesExists ) {
723
- setshowConfirmationModal ( true ) ;
724
- } else if ( largeFileExists && isGCSActive ) {
725
713
setshowExpirationModal ( true ) ;
714
+ } else if ( largeFileExists && isGCSActive ) {
715
+ setshowConfirmationModal ( true ) ;
726
716
} else {
727
717
handleGenerateGraph ( selectedRows . filter ( ( f ) => isFileReadyToProcess ( f , false ) ) ) ;
728
718
}
729
719
} else if ( filesData . length ) {
730
- const expiredFileExists = filesData . some ( ( c ) => isFileReadyToProcess ( c , true ) && isExpired ( c . createdAt as Date ) ) ;
720
+ const expiredFileExists = filesData . some (
721
+ ( c ) => isExpired ( c . createdAt as Date )
722
+ ) ;
731
723
const largeFileExists = filesData . some (
732
724
( c ) => isFileReadyToProcess ( c , true ) && typeof c . size === 'number' && c . size > largeFileSize
733
725
) ;
@@ -744,7 +736,7 @@ const Content: React.FC<ContentProps> = ({
744
736
} else if ( expiredFileExists && isGCSActive ) {
745
737
setshowExpirationModal ( true ) ;
746
738
} else {
747
- handleGenerateGraph ( filesData . filter ( ( f ) => isFileReadyToProcess ( f , false ) ) ) ;
739
+ handleGenerateGraph ( filesData . filter ( ( f ) => f . status === 'New' || f . status === 'Ready to Reprocess' ) ) ;
748
740
}
749
741
}
750
742
} ;
@@ -788,6 +780,7 @@ const Content: React.FC<ContentProps> = ({
788
780
onClose = { ( ) => setshowConfirmationModal ( false ) }
789
781
loading = { extractLoading }
790
782
selectedRows = { childRef . current ?. getSelectedRows ( ) as CustomFile [ ] }
783
+ isLargeDocumentAlert = { true }
791
784
> </ ConfirmationDialog >
792
785
</ Suspense >
793
786
) }
@@ -854,16 +847,14 @@ const Content: React.FC<ContentProps> = ({
854
847
/>
855
848
< div className = 'pt-1 flex gap-1 items-center' >
856
849
< div >
857
- { ! isSchema ? (
850
+ { selectedNodes . length === 0 || selectedRels . length === 0 ? (
858
851
< StatusIndicator type = 'danger' />
859
- ) : selectedNodes . length || selectedRels . length ? (
860
- < StatusIndicator type = 'success' />
861
- ) : (
862
- < StatusIndicator type = 'warning' />
863
- ) }
852
+ ) :
853
+ ( < StatusIndicator type = 'success' />
854
+ ) }
864
855
</ div >
865
856
< div >
866
- { isSchema ? (
857
+ { selectedNodes . length > 0 || selectedRels . length > 0 ? (
867
858
< span className = 'n-body-small' >
868
859
{ ( ! selectedNodes . length || ! selectedRels . length ) && 'Empty' } Graph Schema configured
869
860
{ selectedNodes . length || selectedRels . length
0 commit comments