refactor(reactflowUtils.ts): extract duplicated code into a helper function to improve readability and maintainability
fix(reactflowUtils.ts): fix typo in function name scapedJSONStringfy to escapedJSONStringify fix(reactflowUtils.ts): fix typo in function name customStringify to escapedJSONStringify feat(reactflowUtils.ts): add inputTypes property to targetHandleType to improve functionality and accuracy of handle connection check
This commit is contained in:
parent
44b6171800
commit
3305983cc4
2 changed files with 302 additions and 299 deletions
591
src/frontend/package-lock.json
generated
591
src/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -589,17 +589,19 @@ function isHandleConnected(
|
||||||
/*
|
/*
|
||||||
this function receives a flow and a handleId and check if there is a connection with this handle
|
this function receives a flow and a handleId and check if there is a connection with this handle
|
||||||
*/
|
*/
|
||||||
|
scapedJSONStringfy({ type: field.type, fieldName: key, id: nodeId })
|
||||||
if (field.proxy) {
|
if (field.proxy) {
|
||||||
if (
|
if (
|
||||||
edges.some(
|
edges.some(
|
||||||
(e) =>
|
(e) =>
|
||||||
e.targetHandle ===
|
e.targetHandle ===
|
||||||
customStringify({
|
scapedJSONStringfy({
|
||||||
type: field.type,
|
type: field.type,
|
||||||
fieldName: key,
|
fieldName: key,
|
||||||
id: nodeId,
|
id: nodeId,
|
||||||
proxy: { id: field.proxy!.id, field: field.proxy!.field },
|
proxy: { id: field.proxy!.id, field: field.proxy!.field },
|
||||||
})
|
inputTypes: field.input_types,
|
||||||
|
} as targetHandleType)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -609,7 +611,9 @@ function isHandleConnected(
|
||||||
edges.some(
|
edges.some(
|
||||||
(e) =>
|
(e) =>
|
||||||
e.targetHandle ===
|
e.targetHandle ===
|
||||||
customStringify({ type: field.type, fieldName: key, id: nodeId })
|
scapedJSONStringfy({ type: field.type, fieldName: key,
|
||||||
|
id: nodeId,
|
||||||
|
inputTypes:field.input_types} as targetHandleType)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue