mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 21:37:33 +08:00
Fix: Unable to navigate from the agent list page to the compilation editing page. (#17460)
This commit is contained in:
@@ -3,6 +3,7 @@ import { FormLayout } from '@/constants/form';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
||||
import { useFetchAgentList } from '@/hooks/use-agent-request';
|
||||
import { AgentListItem, AgentListItemType } from '@/interfaces/database/agent';
|
||||
import { buildSelectOptions } from '@/utils/component-util';
|
||||
import { ArrowUpRight } from 'lucide-react';
|
||||
import { useEffect, useMemo } from 'react';
|
||||
@@ -48,19 +49,25 @@ export function DataFlowSelect(props: IProps) {
|
||||
const { data: dataPipelineOptions } = useFetchAgentList({
|
||||
canvas_category: AgentCategory.DataflowCanvas,
|
||||
});
|
||||
|
||||
const canvasList = useMemo(
|
||||
() =>
|
||||
(dataPipelineOptions?.canvas ?? []).filter(
|
||||
(item): item is AgentListItem & { title: string; avatar?: string } =>
|
||||
item.type !== AgentListItemType.CompilationTemplateGroup,
|
||||
),
|
||||
[dataPipelineOptions?.canvas],
|
||||
);
|
||||
|
||||
const options = useMemo(() => {
|
||||
const option = buildSelectOptions(
|
||||
dataPipelineOptions?.canvas,
|
||||
'id',
|
||||
'title',
|
||||
);
|
||||
const option = buildSelectOptions(canvasList, 'id', 'title');
|
||||
|
||||
return option || [];
|
||||
}, [dataPipelineOptions]);
|
||||
}, [canvasList]);
|
||||
|
||||
const nodes = useMemo(() => {
|
||||
return (
|
||||
dataPipelineOptions?.canvas?.map((item) => {
|
||||
canvasList.map((item) => {
|
||||
return {
|
||||
id: item?.id,
|
||||
name: item?.title,
|
||||
@@ -68,7 +75,7 @@ export function DataFlowSelect(props: IProps) {
|
||||
};
|
||||
}) || []
|
||||
);
|
||||
}, [dataPipelineOptions]);
|
||||
}, [canvasList]);
|
||||
|
||||
useEffect(() => {
|
||||
setDataList?.(nodes);
|
||||
|
||||
@@ -132,7 +132,7 @@ export const useFetchExcel = (filePath: string) => {
|
||||
setStatus(true);
|
||||
})
|
||||
.catch((e) => {
|
||||
// eslint-disable-next-line no-console
|
||||
// oxlint-disable-next-line no-console
|
||||
console.warn('failed', e);
|
||||
myExcelPreviewer.destroy();
|
||||
setStatus(false);
|
||||
|
||||
@@ -144,7 +144,7 @@ function UploadForm({
|
||||
setColumnRoles(roles);
|
||||
form.setValue('tableColumnRoles', roles);
|
||||
}
|
||||
}, [extractedColumns, columnMode]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
}, [extractedColumns, columnMode]); // oxlint-disable-line react/exhaustive-deps
|
||||
|
||||
const showColumnConfig = isTableParser && extractedColumns.length > 0;
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ export function FileUploader(props: FileUploaderProps) {
|
||||
}
|
||||
});
|
||||
};
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
// oxlint-disable-next-line react/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
const isDisabled = disabled || (files?.length ?? 0) >= maxFileCount;
|
||||
|
||||
@@ -307,7 +307,7 @@ const FloatingChatWidgetMarkdown = ({
|
||||
'custom-typography': ({ children }: { children: string }) =>
|
||||
renderReference(children),
|
||||
code(props: any) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
// oxlint-disable-next-line typescript/no-unused-vars
|
||||
const { children, className, node, ...rest } = props;
|
||||
const match = /language-(\w+)/.exec(className || '');
|
||||
return match ? (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* eslint-disable react-hooks/exhaustive-deps */
|
||||
/* oxlint-disable react/exhaustive-deps */
|
||||
|
||||
'use client';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user