Skip to content

Commit 5403f14

Browse files
authored
Feat: Add chunk also supports uploading image. (#13628)
### What problem does this PR solve? Feat: Add chunk also supports uploading image. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
1 parent af7e24b commit 5403f14

File tree

2 files changed

+2
-7
lines changed
  • web/src
    • components
    • pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal

2 files changed

+2
-7
lines changed

web/src/components/file-uploader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ export function FileUploader(props: FileUploaderProps) {
382382
<div className="relative flex flex-col gap-4 overflow-hidden">
383383
{!(hideDropzoneOnMaxFileCount && reachesMaxFileCount) && (
384384
<Tabs defaultValue="file" className="w-full">
385-
<TabsList className="w-full justify-start">
385+
<TabsList className="w-fit justify-start">
386386
<TabsTrigger value="file" className="gap-2">
387387
<FileText className="size-4" />
388388
{t('fileManager.files', 'Files')}

web/src/pages/chunk/parsed-result/add-knowledge/components/knowledge-chunk/components/chunk-creating-modal/index.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
146146
</FormItem>
147147
)}
148148
/>
149-
150149
{/* Do not display the type field in create mode */}
151150
{isEditMode && (
152151
<FormField
@@ -174,7 +173,7 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
174173
/>
175174
)}
176175

177-
{isEditMode && form.getValues('doc_type_kwd') === 'image' && (
176+
{(!isEditMode || form.getValues('doc_type_kwd') + '' === 'image') && (
178177
<FormField
179178
control={form.control}
180179
name="image"
@@ -213,7 +212,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
213212
)}
214213
/>
215214
)}
216-
217215
<FormField
218216
control={form.control}
219217
name="important_kwd"
@@ -227,7 +225,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
227225
</FormItem>
228226
)}
229227
/>
230-
231228
<FormField
232229
control={form.control}
233230
name="question_kwd"
@@ -255,7 +252,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
255252
</FormItem>
256253
)}
257254
/>
258-
259255
{isTagParser && (
260256
<FormField
261257
control={form.control}
@@ -271,7 +267,6 @@ const ChunkCreatingModal: React.FC<IModalProps<any> & kFProps> = ({
271267
)}
272268
/>
273269
)}
274-
275270
{!isTagParser && (
276271
<FormProvider {...form}>
277272
<TagFeatureItem />

0 commit comments

Comments
 (0)