Skip to content

Commit

Permalink
fix: .knowledgebase folder can be deleted bug and change "Add file to…
Browse files Browse the repository at this point in the history
… knowledge base" to "Link file to knowledge base" bug (#786)

### What problem does this PR solve?
fix: .knowledgebase folder can be deleted bug 
fix: change "Add file to knowledge base" to "Link file to knowledge
base" bug
#783 #784

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
cike8899 authored May 15, 2024
1 parent 5effbfa commit baad35d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ export default {
knowledgeBase: 'Knowledge Base',
size: 'Size',
action: 'Action',
addToKnowledge: 'Add to Knowledge Base',
addToKnowledge: 'Link to Knowledge Base',
pleaseSelect: 'Please select',
newFolder: 'New Folder',
file: 'File',
Expand Down
2 changes: 1 addition & 1 deletion web/src/locales/zh-traditional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ export default {
knowledgeBase: '知識庫',
size: '大小',
action: '操作',
addToKnowledge: '添加到知識庫',
addToKnowledge: '鏈接知識庫',
pleaseSelect: '請選擇',
newFolder: '新建文件夾',
uploadFile: '上傳文件',
Expand Down
2 changes: 1 addition & 1 deletion web/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export default {
knowledgeBase: '知识库',
size: '大小',
action: '操作',
addToKnowledge: '添加到知识库',
addToKnowledge: '链接知识库',
pleaseSelect: '请选择',
newFolder: '新建文件夹',
uploadFile: '上传文件',
Expand Down
6 changes: 5 additions & 1 deletion web/src/pages/file-manager/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useGetPagination, useSetPagination } from '@/hooks/logicHooks';
import { useOneNamespaceEffectsLoading } from '@/hooks/storeHooks';
import { IFile } from '@/interfaces/database/file-manager';
import { PaginationProps } from 'antd';
import { TableRowSelection } from 'antd/es/table/interface';
import { UploadFile } from 'antd/lib';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useDispatch, useNavigate, useSearchParams, useSelector } from 'umi';
Expand Down Expand Up @@ -93,8 +94,11 @@ export const useHandleSearchChange = () => {
export const useGetRowSelection = () => {
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);

const rowSelection = {
const rowSelection: TableRowSelection<IFile> = {
selectedRowKeys,
getCheckboxProps: (record) => {
return { disabled: record.source_type === 'knowledgebase' };
},
onChange: (newSelectedRowKeys: React.Key[]) => {
setSelectedRowKeys(newSelectedRowKeys);
},
Expand Down

0 comments on commit baad35d

Please sign in to comment.