fix: #209 after saving the knowledge base configuration, jump to the dataset page (#212)

### What problem does this PR solve?
fix: #209 after saving the knowledge base configuration, jump to the
dataset page
feat: translate ConfigurationForm
feat: translate KnowledgeTesting
feat: translate document list page
feat: translate knowledge list page

Issue link: #209

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2024-04-03 11:21:54 +08:00
committed by GitHub
parent 392e515c3f
commit 9b9b6d5408
19 changed files with 299 additions and 196 deletions

View File

@ -7,6 +7,7 @@ import {
import { Breadcrumb } from 'antd';
import { ItemType } from 'antd/es/breadcrumb/Breadcrumb';
import { useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Link, Outlet, useDispatch, useLocation } from 'umi';
import Siderbar from './components/knowledge-sidebar';
import {
@ -21,6 +22,7 @@ const KnowledgeAdding = () => {
const dispatch = useDispatch();
const knowledgeBaseId = useKnowledgeBaseId();
const { t } = useTranslation();
const location = useLocation();
const activeKey: KnowledgeRouteKey =
(useSecondPathName() as KnowledgeRouteKey) || KnowledgeRouteKey.Dataset;
@ -33,14 +35,18 @@ const KnowledgeAdding = () => {
const breadcrumbItems: ItemType[] = useMemo(() => {
const items: ItemType[] = [
{
title: <a onClick={() => gotoList('/knowledge')}>Knowledge Base</a>,
title: (
<a onClick={() => gotoList('/knowledge')}>
{t('header.knowledgeBase')}
</a>
),
},
{
title: datasetActiveKey ? (
<Link
to={`/knowledge/${KnowledgeRouteKey.Dataset}?id=${knowledgeBaseId}`}
>
{routeMap[activeKey]}
{t(`knowledgeDetails.${activeKey}`)}
</Link>
) : (
routeMap[activeKey]
@ -55,7 +61,7 @@ const KnowledgeAdding = () => {
}
return items;
}, [activeKey, datasetActiveKey, gotoList, knowledgeBaseId]);
}, [activeKey, datasetActiveKey, gotoList, knowledgeBaseId, t]);
useEffect(() => {
const search: string = location.search.slice(1);