diff --git a/changelog/unreleased/000057-connection-tags-fix.yml b/changelog/unreleased/000057-connection-tags-fix.yml index c53faa8..25652a1 100644 --- a/changelog/unreleased/000057-connection-tags-fix.yml +++ b/changelog/unreleased/000057-connection-tags-fix.yml @@ -7,4 +7,5 @@ type: fixed #[added/changed/deprecated/removed/fixed/security/other] issues: - 57 merge_requests: - - 58 \ No newline at end of file + - 58 + - 59 \ No newline at end of file diff --git a/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java index ee5442f..3380f63 100644 --- a/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java +++ b/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java @@ -11,6 +11,7 @@ import java.util.Collection; import java.util.LinkedList; import java.util.List; +import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; @@ -64,7 +65,12 @@ private List tagsForConnection(HofundConnection connection) { List tags = new LinkedList<>(); tags.add(Tag.of("id", connection.toTargetTag())); tags.add(Tag.of("title", connection.getTarget() + "_" + connection.getType())); - tags.add(Tag.of("subtitle", connection.getType().toString() + " (" + connection.getDescription() + ")")); + + String subtitle = Objects.equals(connection.getDescription(), "") ? + connection.getType().toString() + : String.format("%s (%s)", connection.getType(), connection.getDescription()); + + tags.add(Tag.of("subtitle", subtitle)); tags.add(Tag.of("type", connection.getType().toString())); return tags; }