Skip to content

Commit

Permalink
Dataset frontend style adjusting (#1820)
Browse files Browse the repository at this point in the history
* feat: dataset controllers

feat: dataset schema

fix: add missing type to dataset schema
Signed-off-by: FinleyGe <[email protected]>

* chore: use new auth method

Signed-off-by: FinleyGe <[email protected]>

* feat: finish the dataset permission

fix: ts errors
Signed-off-by: FinleyGe <[email protected]>

* chore: adjust the code

* chore: adjust the code

* chore: dataset fe adjusting

* fix: double delete confirm

---------

Signed-off-by: FinleyGe <[email protected]>
  • Loading branch information
FinleyGe committed Jun 24, 2024
1 parent a9ab9eb commit 4a33e04
Show file tree
Hide file tree
Showing 11 changed files with 12,148 additions and 9,272 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
"@chakra-ui/cli": "^2.4.1",
"husky": "^8.0.3",
"i18next": "23.10.0",
"lint-staged": "^13.2.1",
"lint-staged": "^13.3.0",
"next-i18next": "15.2.0",
"prettier": "3.2.4",
"react-i18next": "13.5.0",
"zhlint": "^0.7.1"
"zhlint": "^0.7.4"
},
"lint-staged": {
"./**/**/*.{ts,tsx,scss}": "npm run format-code",
Expand Down
3 changes: 2 additions & 1 deletion packages/global/core/dataset/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { DatasetDataIndexItemType, DatasetSchemaType } from './type';
import { TrainingModeEnum, DatasetCollectionTypeEnum } from './constants';
import type { LLMModelItemType } from '../ai/model.d';
import { ParentIdType } from 'common/parentFolder/type';

/* ================= dataset ===================== */
export type DatasetUpdateBody = {
id: string;
parentId?: string;
parentId?: ParentIdType;
name?: string;
avatar?: string;
intro?: string;
Expand Down
1 change: 1 addition & 0 deletions packages/web/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,7 @@
"Create Folder": "Create Folder",
"Create manual collection": "Create manual collection",
"Delete Dataset Error": "Delete Dataset Error",
"Edit Info": "Edit Information",
"Edit Folder": "Edit Folder",
"Export": "Export",
"Export Dataset Limit Error": "Export Dataset Error",
Expand Down
1 change: 1 addition & 0 deletions packages/web/i18n/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@
"Create Folder": "创建文件夹",
"Create manual collection": "创建手动数据集",
"Delete Dataset Error": "删除知识库异常",
"Edit Info": "编辑信息",
"Edit Folder": "编辑文件夹",
"Export": "导出",
"Export Dataset Limit Error": "导出数据失败",
Expand Down
20,943 changes: 11,875 additions & 9,068 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion projects/app/src/pages/api/core/dataset/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from '@fastgpt/global/support/permission/constant';
import { MongoResourcePermission } from '@fastgpt/service/support/permission/schema';
import { parseParentIdInMongo } from '@fastgpt/global/common/parentFolder/utils';
import { DatasetDefaultPermission } from '@fastgpt/global/support/permission/dataset/constant';

async function handler(req: NextApiRequest) {
const { parentId, type } = req.query as { parentId?: string; type?: DatasetTypeEnum };
Expand Down Expand Up @@ -71,7 +72,7 @@ async function handler(req: NextApiRequest) {
type: item.type,
permission: item.permission,
vectorModel: getVectorModel(item.vectorModel),
defaultPermission: item.defaultPermission
defaultPermission: item.defaultPermission ?? DatasetDefaultPermission
}))
);

Expand Down
2 changes: 1 addition & 1 deletion projects/app/src/pages/dataset/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Detail = ({ datasetId, currentTab }: Props) => {
<Slider currentTab={currentTab} />

{!!datasetDetail._id && (
<Box flex={'1 0 0'} pb={0}>
<Box flex={'1 0 0'} pb={0} overflow={'auto'}>
{currentTab === TabEnum.collectionCard && (
<CollectionPageContextProvider>
<CollectionCard />
Expand Down
Loading

0 comments on commit 4a33e04

Please sign in to comment.