diff --git a/src/functions/codeEditor.js b/src/functions/codeEditor.js index 564e6bc01d484660d1af36e72be820a24150d174..0761ce5f480e8f6687861f1072a2f0d12f7792a5 100644 --- a/src/functions/codeEditor.js +++ b/src/functions/codeEditor.js @@ -10,7 +10,7 @@ import { } from "./codeEditorHandler"; let editorValues = { - doc: "// Please don't remove comments!\nconst amqp = require('amqplib/callback_api');\n\nconst rabbitmqUrl = 'amqp://mquser:mqpass@rabbit:5672';\n\namqp.connect(rabbitmqUrl, (error0, connection) => {\n if (error0) {\n throw error0;\n }\n connection.createChannel((error1, channel) => {\n if (error1) {\n throw error1;\n }\n\n // START PIPE-BINDING\n // INCOMING PIPES\n // OUTGOING PIPES\n // END PIPE-BINDING\n\n // TODO: Code logic here\n\n\n\t});\n});\n", + doc: "// Please don't remove comments!\nconst amqp = require('amqplib/callback_api');\n\nconst rabbitmqUrl = 'amqp://mquser:mqpass@rabbit:5672';\n\namqp.connect(rabbitmqUrl, (error0, connection) => {\n if (error0) {\n throw error0;\n }\n connection.createChannel((error1, channel) => {\n if (error1) {\n throw error1;\n }\n\n // START PIPE-BINDING\n // INCOMING PIPES\n // OUTGOING PIPES\n // END PIPE-BINDING\n\n // TODO: Code logic here\n\n\n });\n});\n", extensions: [basicSetup, javascript()], }; diff --git a/src/functions/codeEditorHandler.js b/src/functions/codeEditorHandler.js index 7cd563f7a831cd9d4252858427155c69290289a5..017fc9463bae33d873d2cc0b59f9679badebefde 100644 --- a/src/functions/codeEditorHandler.js +++ b/src/functions/codeEditorHandler.js @@ -51,9 +51,9 @@ export const getPipesForFilter = (instance) => { export const handlePipeBinding = (pipeMapping, editor) => { // clear pipe-binindg code let codeArray = editor.state.doc.toString(); - const start = " // INCOMING PIPES"; - const middle = " // OUTGOING PIPES"; - const end = " // END PIPE-BINDING"; + const start = " // INCOMING PIPES"; + const middle = " // OUTGOING PIPES"; + const end = " // END PIPE-BINDING"; const startIndex = codeArray.indexOf(start); const midIndexIn = codeArray.indexOf(middle); @@ -199,11 +199,11 @@ const fillEditorwithCode = (editor, pipeMapping, lineNumber) => { let position = line.from; let pipeNameUserGiven = pipe.pipeName; let pipeNameDeklaration = makeValidConstName(pipeNameUserGiven); - let insertCode = `\t\tconst ${pipeNameDeklaration} = "${pipeNameUserGiven}";\n\t\tchannel.assert${ + let insertCode = ` const ${pipeNameDeklaration} = "${pipeNameUserGiven}";\n channel.assert${ pipe.pipeType === "Queue" ? "Queue" : "Exchange" }(${pipeNameDeklaration}, ${ pipe.pipeType === "Topic" ? `"topic", ` : "" - }{\n\t\t\tdurable: false\n\t\t});\n`; + }{\n durable: false\n });\n`; let transaction = editor.state.update({ changes: { from: position, @@ -219,7 +219,7 @@ export const renamePipeNamesInCode = (editor, oldName, newName) => { const oldNameInCode = makeValidConstName(oldName); const newNameInCode = makeValidConstName(newName); const codeString = editor.state.doc.toString(); - const from = " // TODO: Code logic here"; + const from = " // TODO: Code logic here"; const fromIndex = codeString.indexOf(from); const codeToChange = codeString.slice(fromIndex); @@ -238,14 +238,14 @@ export const renamePipeNamesInCode = (editor, oldName, newName) => { export const deleteWrittenCode = (editor) => { const codeString = editor.state.doc.toString(); - const from = " // TODO: Code logic here"; + const from = " // TODO: Code logic here"; const fromIndex = codeString.indexOf(from); const transaction = editor.state.update({ changes: [ { from: fromIndex + from.length, to: editor.state.doc.length, - insert: "\n\n\n\t});\n});\n", + insert: "\n\n\n });\n});\n", }, ], }); diff --git a/src/style.css b/src/style.css index 95024eca5280003f28805a9e31fd09dab6b93086..67406f681ddc0f09fbd87275f7cf7195126ed011 100644 --- a/src/style.css +++ b/src/style.css @@ -354,7 +354,7 @@ body { white-space: nowrap; font-size: 10px; position: absolute; - bottom: 30px; + bottom: 36px; text-align: left; }