diff --git a/app/web/src/store/components.store.ts b/app/web/src/store/components.store.ts index 0a2de85f75..ede876e0b5 100644 --- a/app/web/src/store/components.store.ts +++ b/app/web/src/store/components.store.ts @@ -218,22 +218,22 @@ const edgeFromRawEdge = isInferred?: boolean; isManagement?: boolean; }) => - (e: RawEdge): Edge => { - const edge = structuredClone(e) as Edge; - if (isManagement) { - edge.id = `mgmt-${edge.toComponentId}_${edge.fromComponentId}`; - } else { - edge.id = generateEdgeId( - edge.fromComponentId, - edge.toComponentId, - edge.fromSocketId, - edge.toSocketId, - ); - } - edge.isInferred = isInferred ?? false; - edge.isManagement = isManagement ?? false; - return edge; - }; + (e: RawEdge): Edge => { + const edge = structuredClone(e) as Edge; + if (isManagement) { + edge.id = `mgmt-${edge.toComponentId}_${edge.fromComponentId}`; + } else { + edge.id = generateEdgeId( + edge.fromComponentId, + edge.toComponentId, + edge.fromSocketId, + edge.toSocketId, + ); + } + edge.isInferred = isInferred ?? false; + edge.isManagement = isManagement ?? false; + return edge; + }; export const loadCollapsedData = ( prefix: string, @@ -294,19 +294,19 @@ export function getPossibleAndExistingPeerSockets( .map((edge) => targetSocket.direction === "input" ? { - edge, - thisComponentId: edge.def.toComponentId, - thisSocketId: edge.def.toSocketId, - peerComponentId: edge.def.fromComponentId, - peerSocketId: edge.def.fromSocketId, - } + edge, + thisComponentId: edge.def.toComponentId, + thisSocketId: edge.def.toSocketId, + peerComponentId: edge.def.fromComponentId, + peerSocketId: edge.def.fromSocketId, + } : { - edge, - thisComponentId: edge.def.fromComponentId, - thisSocketId: edge.def.fromSocketId, - peerComponentId: edge.def.toComponentId, - peerSocketId: edge.def.toSocketId, - }, + edge, + thisComponentId: edge.def.fromComponentId, + thisSocketId: edge.def.fromSocketId, + peerComponentId: edge.def.toComponentId, + peerSocketId: edge.def.toSocketId, + }, ) // Get only edges relevant to this socket .filter( @@ -349,13 +349,13 @@ export function getPossibleAndExistingPeerSockets( const [outputCAs, inputCAs] = targetSocket.direction === "output" ? [ - targetSocket.connectionAnnotations, - peerSocket.connectionAnnotations, - ] + targetSocket.connectionAnnotations, + peerSocket.connectionAnnotations, + ] : [ - peerSocket.connectionAnnotations, - targetSocket.connectionAnnotations, - ]; + peerSocket.connectionAnnotations, + targetSocket.connectionAnnotations, + ]; // check socket connection annotations compatibility for (const outputCA of outputCAs) { @@ -745,22 +745,22 @@ export const useComponentsStore = (forceChangeSetId?: ChangeSetId) => { const edges = response.edges && response.edges.length > 0 ? response.edges.map( - edgeFromRawEdge({ isInferred: false, isManagement: false }), - ) + edgeFromRawEdge({ isInferred: false, isManagement: false }), + ) : []; const inferred = response.inferredEdges && response.inferredEdges.length > 0 ? response.inferredEdges.map( - edgeFromRawEdge({ isInferred: true, isManagement: false }), - ) + edgeFromRawEdge({ isInferred: true, isManagement: false }), + ) : []; const management = response.managementEdges?.length > 0 && - featureFlagsStore.MANAGEMENT_EDGES + featureFlagsStore.MANAGEMENT_EDGES ? response.managementEdges.map( - edgeFromRawEdge({ isInferred: false, isManagement: true }), - ) + edgeFromRawEdge({ isInferred: false, isManagement: true }), + ) : []; this.rawEdgesById = _.keyBy( @@ -873,7 +873,7 @@ export const useComponentsStore = (forceChangeSetId?: ChangeSetId) => { toSocketId: to.socketId, ...visibilityParams, }, - onSuccess: () => { }, + onSuccess: () => {}, optimistic: () => { this.rawEdgesById[newEdge.id] = newEdge; this.processRawEdge(newEdge.id); @@ -1003,17 +1003,17 @@ export const useComponentsStore = (forceChangeSetId?: ChangeSetId) => { const edge = this.rawEdgesById[edgeId]; const params = edge?.isManagement ? { - managedComponentId: toComponentId, - managerComponentId: fromComponentId, - ...visibilityParams, - } + managedComponentId: toComponentId, + managerComponentId: fromComponentId, + ...visibilityParams, + } : { - fromSocketId, - toSocketId, - toComponentId, - fromComponentId, - ...visibilityParams, - }; + fromSocketId, + toSocketId, + toComponentId, + fromComponentId, + ...visibilityParams, + }; const url = edge?.isManagement ? "component/unmanage"