From 8a725a5d6a8d1d93a88f4ab7b5357dd500008435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Ezr?= Date: Thu, 7 Sep 2023 23:39:11 +0200 Subject: [PATCH] Link element name instead of element When deploymentNode has an url, we were adding hyperlink to the node itself. This adds the link on the element name instead. --- .../export/plantuml/StructurizrPlantUMLExporter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java b/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java index dee7835..19fe0c7 100644 --- a/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java +++ b/src/main/java/com/structurizr/export/plantuml/StructurizrPlantUMLExporter.java @@ -259,20 +259,20 @@ protected void startDeploymentNodeBoundary(DeploymentView view, DeploymentNode d } String url = deploymentNode.getUrl(); + String nodeName = deploymentNode.getName() if (!StringUtils.isNullOrEmpty(url)) { - url = " [[" + url + "]]"; + nodeName = " [[" + url + " " + nodeName + "]]"; } else { url = ""; } writer.writeLine( format("rectangle \"%s\\n%s%s\" <<%s>> as %s%s {", - deploymentNode.getName() + (!"1".equals(deploymentNode.getInstances()) ? " (x" + deploymentNode.getInstances() + ")" : ""), + nodeName + (!"1".equals(deploymentNode.getInstances()) ? " (x" + deploymentNode.getInstances() + ")" : ""), typeOf(view, deploymentNode, true), icon, idOf(deploymentNode), - idOf(deploymentNode), - url + idOf(deploymentNode) ) ); writer.indent(); @@ -351,7 +351,7 @@ protected void writeElement(ModelView view, Element element, IndentingWriter wri shape = plantUMLShapeOf(view, elementInstance.getElement()); if (StringUtils.isNullOrEmpty(url)) { - url = element.getUrl(); + url = elementInstance.getUrl(); if (!StringUtils.isNullOrEmpty(url)) { url = " [[" + url + "]]"; } else {