Skip to content

Commit 3238e25

Browse files
committed
Refactor ContextMap to streamline relationship creation for external calls; unify type handling for queries and commands
1 parent ff31e5a commit 3238e25

2 files changed

Lines changed: 81 additions & 80 deletions

File tree

spa/src/components/overview/ContextMap.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ export function ContextMap() {
5151
const sourceKey = `${ctx.name}/${mod.name}`;
5252
(mod.externalCalls ?? []).forEach(call => {
5353
const targetKey = `${call.targetContext}/${call.targetModule}`;
54-
if (modIndex[targetKey] !== undefined) {
54+
const type = call.type === 'query' ? 'query' : 'command';
55+
if (modIndex[targetKey] !== undefined && !rels.some(r => r.from === sourceKey && r.to === targetKey && r.type === type)) {
5556
rels.push({
5657
from: sourceKey,
5758
to: targetKey,
58-
type: call.type === 'query' ? 'query' : 'command',
59-
label: call.type === 'query' ? 'Query Bus' : 'Command Bus',
59+
type,
60+
label: type === 'query' ? 'Query Bus' : 'Command Bus',
6061
});
6162
}
6263
});

0 commit comments

Comments
 (0)