mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 23:16:58 +08:00
Fix: Fixed the issue that the condition of deleting the classification operator cannot be connected anymore #3221 (#9068)
### What problem does this PR solve? Fix: Fixed the issue that the condition of deleting the classification operator cannot be connected anymore #3221 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -49,6 +49,7 @@ import {
|
||||
initialRetrievalValues,
|
||||
initialRewriteQuestionValues,
|
||||
initialSwitchValues,
|
||||
initialTavilyExtractValues,
|
||||
initialTavilyValues,
|
||||
initialTemplateValues,
|
||||
initialTuShareValues,
|
||||
@ -135,6 +136,7 @@ export const useInitializeOperatorParams = () => {
|
||||
[Operator.WaitingDialogue]: initialWaitingDialogueValues,
|
||||
[Operator.Agent]: { ...initialAgentValues, llm_id: llmId },
|
||||
[Operator.TavilySearch]: initialTavilyValues,
|
||||
[Operator.TavilyExtract]: initialTavilyExtractValues,
|
||||
};
|
||||
}, [llmId]);
|
||||
|
||||
@ -331,7 +333,7 @@ export const useHandleFormValuesChange = (
|
||||
};
|
||||
|
||||
export const useValidateConnection = () => {
|
||||
const { edges, getOperatorTypeFromId, getParentIdById } = useGraphStore(
|
||||
const { getOperatorTypeFromId, getParentIdById } = useGraphStore(
|
||||
(state) => state,
|
||||
);
|
||||
|
||||
@ -354,20 +356,19 @@ export const useValidateConnection = () => {
|
||||
const isSelfConnected = connection.target === connection.source;
|
||||
|
||||
// limit the connection between two nodes to only one connection line in one direction
|
||||
const hasLine = edges.some(
|
||||
(x) => x.source === connection.source && x.target === connection.target,
|
||||
);
|
||||
// const hasLine = edges.some(
|
||||
// (x) => x.source === connection.source && x.target === connection.target,
|
||||
// );
|
||||
|
||||
const ret =
|
||||
!isSelfConnected &&
|
||||
!hasLine &&
|
||||
RestrictedUpstreamMap[
|
||||
getOperatorTypeFromId(connection.source) as Operator
|
||||
]?.every((x) => x !== getOperatorTypeFromId(connection.target)) &&
|
||||
isSameNodeChild(connection);
|
||||
return ret;
|
||||
},
|
||||
[edges, getOperatorTypeFromId, isSameNodeChild],
|
||||
[getOperatorTypeFromId, isSameNodeChild],
|
||||
);
|
||||
|
||||
return isValidConnection;
|
||||
|
||||
Reference in New Issue
Block a user