diff --git a/src/functions/endpoints.js b/src/functions/endpoints.js index 48b097de3ac211042c5c71c5d968630561c76710..f3faa9fced0aa82f625b3a8dd6f8a306194a55a4 100644 --- a/src/functions/endpoints.js +++ b/src/functions/endpoints.js @@ -15,14 +15,14 @@ const severalEndpointsLeft = { anchor: ["LeftMiddle"], isTarget: true, connectionType: "flow", - maxConnections: 3, + maxConnections: 5, }; const severalEndpointsRight = { endpoint: ["Dot", { radius: 5 }], anchor: ["RightMiddle"], isSource: true, connectionType: "flow", - maxConnections: 3, + maxConnections: 5, }; export const createEndpoints = (instance, id, type) => { diff --git a/src/functions/pipeBinding.js b/src/functions/pipeBinding.js index 597f54010d112a2f7e679be41a467ace733b5067..5df12ed5cd8ddc4e277718eec0118a2df5310642 100644 --- a/src/functions/pipeBinding.js +++ b/src/functions/pipeBinding.js @@ -9,16 +9,14 @@ export const getPipesForFilter = (instance) => { .filter((connection) => connection.targetId === filter) .map((connection) => ({ pipeId: connection.sourceId, - pipeType: - connection.source.dataset.type === "Default" ? "Queue" : "Topic", + pipeType: connection.source.dataset.pipetype, pipeDirection: "in", })); const outgoingConnections = allConnections .filter((connection) => connection.sourceId === filter) .map((connection) => ({ pipeId: connection.targetId, - pipeType: - connection.target.dataset.type === "Default" ? "Queue" : "Topic", + pipeType: connection.target.dataset.pipetype, pipeDirection: "out", })); @@ -60,14 +58,11 @@ export const handlePipeBinding = (pipeMapping, editor) => { ) { return; } else { - let queue = pipe.pipeType === "Queue" ? true : false; let line = editor.state.doc.line(lineNumber); let position = line.from; let pipeNameUserGiven = pipe.pipeName; let pipeNameDeklaration = makeValidConstName(pipeNameUserGiven); - let insertCode = `\t\tconst ${pipeNameDeklaration} = "${pipeNameUserGiven}";\n\t\tawait channel.${ - queue ? "assertQueue" : "assertTopic" - }(${pipeNameDeklaration}, {\n\t\t\tdurable: false\n\t\t});\n`; + let insertCode = `\t\tconst ${pipeNameDeklaration} = "${pipeNameUserGiven}";\n\t\tawait channel.assert${pipe.pipeType}(${pipeNameDeklaration}, {\n\t\t\tdurable: false\n\t\t});\n`; let transaction = editor.state.update({ changes: { from: position, diff --git a/src/index.html b/src/index.html index bf27ecd846c816631626f50d56cbf36f934aced5..6c6a9e4d5ee4eedaba206384a556dc8039232fb9 100644 --- a/src/index.html +++ b/src/index.html @@ -25,7 +25,7 @@ <h4>TOOLBOX</h4> <div> <h5>PIPES</h5> - <div class="Pipe" data-type="Default"> + <div class="Pipe" data-type="Distributor" data-pipetype="Queue"> Queue <br /> <span id="PipeName"></span> @@ -36,7 +36,7 @@ <i id="Check" class="fa-sharp fa-xl fa-solid fa-circle-check"></i> <i id="Docker" class="fa-brands fa-xl fa-docker"></i> </div> - <div class="Pipe" data-type="Distributor"> + <div class="Pipe" data-type="Distributor" data-pipetype="Topic"> Topic <br /> <span id="PipeName"></span>