Skip to content

Commit

Permalink
Merge pull request #59 from witx98/subtitle-tag
Browse files Browse the repository at this point in the history
Subtitle tag fix
  • Loading branch information
marwin1991 authored Nov 27, 2024
2 parents ebce197 + 9828d00 commit a36f1eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion changelog/unreleased/000057-connection-tags-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ type: fixed #[added/changed/deprecated/removed/fixed/security/other]
issues:
- 57
merge_requests:
- 58
- 58
- 59
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -64,7 +65,12 @@ private List<Tag> tagsForConnection(HofundConnection connection) {
List<Tag> 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;
}
Expand Down

0 comments on commit a36f1eb

Please sign in to comment.