@@ -9,7 +9,7 @@ import ReactJson from 'flowise-react-json-view'
9
9
import useApi from '@/hooks/useApi'
10
10
11
11
// Material-UI
12
- import { Skeleton , Toolbar , Box , Button , Card , CardContent , Grid , OutlinedInput , Stack , Typography } from '@mui/material'
12
+ import { Skeleton , Toolbar , Box , Button , Card , CardContent , Grid , OutlinedInput , Stack , Typography , TextField } from '@mui/material'
13
13
import { useTheme , styled } from '@mui/material/styles'
14
14
import { IconScissors , IconArrowLeft , IconDatabaseImport , IconBook , IconX , IconEye } from '@tabler/icons-react'
15
15
@@ -72,6 +72,7 @@ const LoaderConfigPreviewChunks = () => {
72
72
73
73
const [ loading , setLoading ] = useState ( false )
74
74
const [ error , setError ] = useState ( null )
75
+ const [ loaderName , setLoaderName ] = useState ( '' )
75
76
76
77
const [ textSplitterNodes , setTextSplitterNodes ] = useState ( [ ] )
77
78
const [ splitterOptions , setTextSplitterOptions ] = useState ( [ ] )
@@ -236,7 +237,7 @@ const LoaderConfigPreviewChunks = () => {
236
237
237
238
// Set store id & loader name
238
239
config . storeId = storeId
239
- config . loaderName = selectedDocumentLoader ?. label
240
+ config . loaderName = loaderName || selectedDocumentLoader ?. label
240
241
241
242
// Set loader config
242
243
if ( selectedDocumentLoader . inputs ) {
@@ -282,6 +283,7 @@ const LoaderConfigPreviewChunks = () => {
282
283
// If this is a document store edit config, set the existing input values
283
284
if ( existingLoaderFromDocStoreTable && existingLoaderFromDocStoreTable . loaderConfig ) {
284
285
nodeData . inputs = existingLoaderFromDocStoreTable . loaderConfig
286
+ setLoaderName ( existingLoaderFromDocStoreTable . loaderName )
285
287
}
286
288
setSelectedDocumentLoader ( nodeData )
287
289
@@ -444,6 +446,20 @@ const LoaderConfigPreviewChunks = () => {
444
446
paddingRight : 15
445
447
} }
446
448
>
449
+ < Box sx = { { p : 2 } } >
450
+ < TextField
451
+ fullWidth
452
+ sx = { { mt : 1 } }
453
+ size = 'small'
454
+ label = {
455
+ selectedDocumentLoader ?. label ?. toLowerCase ( ) . includes ( 'loader' )
456
+ ? selectedDocumentLoader . label + ' name'
457
+ : selectedDocumentLoader ?. label + ' Loader Name'
458
+ }
459
+ value = { loaderName }
460
+ onChange = { ( e ) => setLoaderName ( e . target . value ) }
461
+ />
462
+ </ Box >
447
463
{ selectedDocumentLoader &&
448
464
Object . keys ( selectedDocumentLoader ) . length > 0 &&
449
465
( selectedDocumentLoader . inputParams ?? [ ] )
0 commit comments