diff --git a/frontend/src/core/editor.ts b/frontend/src/core/editor.ts index 1789c5e0..973bf50f 100644 --- a/frontend/src/core/editor.ts +++ b/frontend/src/core/editor.ts @@ -157,7 +157,20 @@ class Editor { })); } + public getNodeName(nodeType: string): string { + if (nodeType === 'basic.input') { + return 'Input'; + } else if (nodeType === 'basic.output') { + return 'Output'; + } else if (nodeType === 'basic.constant') { + return 'Parameter'; + } else if (nodeType === 'basic.code') { + return 'Code'; + } + return nodeType; + } + public getGInputsOutput(): [{ indexOne: number, label: string, id:string }[], { indexTwo: number, label: string,id:string }[]] { @@ -181,9 +194,9 @@ class Editor { let label = ``; var id = `${options.id}:${portOptions.label}:${linkIds}`; if(node.getType() == 'block.package'){ - label = `${node.getType()} -> : ${options.info.name} : ${portOptions.label}`; + label = `${options.info.name} -> : ${portOptions.label}`; }else{ - label = `${node.getType()} -> : ${portOptions.label}`; + label = `${this.getNodeName(node.getType())} -> : ${portOptions.label}`; } valueOne.push({ indexOne, label, id }); } @@ -193,9 +206,9 @@ class Editor { let label = ``; var id = `${options.id}:${portOptions.label}:${linkIds}`; if(node.getType() == 'block.package'){ - label = `${node.getType()} -> : ${options.info.name} : ${portOptions.label}`; + label = `${options.info.name} -> : ${portOptions.label}`; }else{ - label = `${node.getType()} -> : ${portOptions.label}`; + label = `${this.getNodeName(node.getType())} -> : ${portOptions.label}`; } valueTwo.push({ indexTwo, label, id }); }