Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add markdown file support in knowledge form #38

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/assets/locale/en/knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uploadFile": {
"label": "Upload File",
"uploadText": "Drag and drop a file here or click to upload",
"uploadHint": "Supported file types: .pdf, .csv, .txt",
"uploadHint": "Supported file types: .pdf, .csv, .txt, .md",
"required": "File is required"
},
"submit": "Submit",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locale/ml/knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uploadFile": {
"label": "ഫയല്‍ അപ്‌ലോഡ് ചെയ്യുക",
"uploadText": "ഇവിടെ ഒരു ഫയല്‍ എടുത്തിടുക അല്ലെങ്കില്‍ അപ്‌ലോഡ് ചെയ്യാന്‍ ക്ലിക്ക് ചെയ്യുക",
"uploadHint": "പിന്തുണയുള്ള ഫയല്‍ തരങ്ങള്‍: .pdf, .csv, .txt",
"uploadHint": "പിന്തുണയുള്ള ഫയല്‍ തരങ്ങള്‍: .pdf, .csv, .txt, .md",
"required": "ഫയല്‍ ആവശ്യമാണ്"
},
"submit": "സമര്‍പ്പിക്കുക",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locale/zh/knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uploadFile": {
"label": "上传文件",
"uploadText": "将文件拖放到此处或点击上传",
"uploadHint": "支持的文件类型: .pdf, .csv, .txt",
"uploadHint": "支持的文件类型: .pdf, .csv, .txt, .md",
"required": "文件是必需的"
},
"submit": "提交",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Option/Knowledge/AddKnowledge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
return e?.fileList
}}>
<Upload.Dragger
accept={".pdf, .csv, .txt"}
accept={".pdf, .csv, .txt, .md"}
multiple={true}
maxCount={10}
beforeUpload={(file) => {
Expand All @@ -113,8 +113,8 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
return false
}}>
<div className="p-3">
<p className="ant-upload-drag-icon justify-center flex">
<InboxIcon className="h-10 w-10 text-gray-400" />
<p className="flex justify-center ant-upload-drag-icon">
<InboxIcon className="w-10 h-10 text-gray-400" />
</p>
<p className="ant-upload-text">
{t("form.uploadFile.uploadText")}
Expand All @@ -130,7 +130,7 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
<button
type="submit"
disabled={isSaving}
className="inline-flex w-full text-center justify-center items-center rounded-md border border-transparent bg-black px-2 py-2 text-md font-medium leading-4 text-white shadow-sm hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:bg-white dark:text-gray-800 dark:hover:bg-gray-100 dark:focus:ring-gray-500 dark:focus:ring-offset-gray-100 disabled:opacity-50">
className="inline-flex items-center justify-center w-full px-2 py-2 font-medium leading-4 text-center text-white bg-black border border-transparent rounded-md shadow-sm text-md hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:bg-white dark:text-gray-800 dark:hover:bg-gray-100 dark:focus:ring-gray-500 dark:focus:ring-offset-gray-100 disabled:opacity-50">
{t("form.submit")}
</button>
</Form.Item>
Expand Down