mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-04-22 14:10:01 +08:00
Fix: read flow blank template strings from i18n file (#6240)
### What problem does this PR solve? Blank and createFromNothing were not read from the i18n file when Agent was created 创建Agent的时候 Blank 和 createFromNothing 没从i18n文件中读取 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
f540559c41
commit
1d8daad223
@ -10,6 +10,7 @@ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|||||||
import { message } from 'antd';
|
import { message } from 'antd';
|
||||||
import { set } from 'lodash';
|
import { set } from 'lodash';
|
||||||
import get from 'lodash/get';
|
import get from 'lodash/get';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useParams } from 'umi';
|
import { useParams } from 'umi';
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
@ -51,6 +52,8 @@ export const EmptyDsl = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
|
export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { data } = useQuery({
|
const { data } = useQuery({
|
||||||
queryKey: ['fetchFlowTemplates'],
|
queryKey: ['fetchFlowTemplates'],
|
||||||
initialData: [],
|
initialData: [],
|
||||||
@ -59,8 +62,8 @@ export const useFetchFlowTemplates = (): ResponseType<IFlowTemplate[]> => {
|
|||||||
if (Array.isArray(data?.data)) {
|
if (Array.isArray(data?.data)) {
|
||||||
data.data.unshift({
|
data.data.unshift({
|
||||||
id: uuid(),
|
id: uuid(),
|
||||||
title: 'Blank',
|
title: t('flow.blank'),
|
||||||
description: 'Create your agent from scratch',
|
description: t('flow.createFromNothing'),
|
||||||
dsl: EmptyDsl,
|
dsl: EmptyDsl,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user