Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Fixes an issue with relationship properties not showing when `c4plant…
Browse files Browse the repository at this point in the history
…uml.relationshipProperties` is set to `true`.
  • Loading branch information
Simon Brown committed Dec 2, 2022
1 parent 86a910d commit 8b8e33c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/changelog.md
Expand Up @@ -9,6 +9,7 @@
- Renamed `plantuml.sequenceDiagrams` to `plantuml.sequenceDiagram`.
- Adds a view/view set property named `c4plantuml.stereotypes` that can be used to enable/disable stereotypes (these are always on by default when the legend is not shown; #29).
- Adds a `c4plantuml.stdlib` view/view set property to allow users to choose which version of C4-PlantUML should be used (built-in standard library, or GitHub).
- Fixes an issue with relationship properties not showing when `c4plantuml.relationshipProperties` is set to `true`.

## 1.7.0 (3rd October 2022)

Expand Down
Expand Up @@ -437,7 +437,7 @@ protected void writeRelationship(View view, RelationshipView relationshipView, I
return;
}

if (Boolean.TRUE.toString().equalsIgnoreCase(view.getViewSet().getConfiguration().getProperties().getOrDefault(C4PLANTUML_ELEMENT_PROPERTIES_PROPERTY, Boolean.FALSE.toString()))) {
if (Boolean.TRUE.toString().equalsIgnoreCase(view.getViewSet().getConfiguration().getProperties().getOrDefault(C4PLANTUML_RELATIONSHIP_PROPERTIES_PROPERTY, Boolean.FALSE.toString()))) {
addProperties(view, writer, relationship);
}

Expand All @@ -462,14 +462,12 @@ protected void writeRelationship(View view, RelationshipView relationshipView, I
}

private void addProperties(View view, IndentingWriter writer, ModelItem element) {
if ("true".equalsIgnoreCase(view.getViewSet().getConfiguration().getProperties().getOrDefault(C4PLANTUML_ELEMENT_PROPERTIES_PROPERTY, "false"))) {
Map<String, String> properties = element.getProperties();
if (!properties.isEmpty()) {
writer.writeLine("WithoutPropertyHeader()");
properties.keySet().stream().sorted().forEach(key ->
writer.writeLine(String.format("AddProperty(\"%s\",\"%s\")", key, properties.get(key)))
);
}
Map<String, String> properties = element.getProperties();
if (!properties.isEmpty()) {
writer.writeLine("WithoutPropertyHeader()");
properties.keySet().stream().sorted().forEach(key ->
writer.writeLine(String.format("AddProperty(\"%s\",\"%s\")", key, properties.get(key)))
);
}
}

Expand Down

0 comments on commit 8b8e33c

Please sign in to comment.