Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wendybujalski committed Dec 18, 2024
1 parent b021c14 commit c08433b
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions app/web/src/store/components.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit c08433b

Please sign in to comment.