plantuml-stdlib / C4-PlantUML

C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures
MIT License
6.41k stars 1.1k forks source link

Element specific tag functions (AddContainerTag, AddComponentTag etc.) are updating bgColor and fontColor globally #300

Closed dannief closed 1 year ago

dannief commented 1 year ago

I think this bug was introduced with this commit: https://github.com/plantuml-stdlib/C4-PlantUML/pull/251

Essentially the expectation is that AddContainerTag will use the default styling of the container element. This worked in v2.4.0.

See below example output for v2.4.0 and current version (2.5.0)

v2.4.0

@startuml
!include  https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/v2.4.0/C4_Container.puml

AddContainerTag(my_custom_tag_1, $bgColor=lightyellow, $fontColor=darkgreen, $legendText="This should have new styles")

AddContainerTag(my_custom_tag_2, $legendText="This should have default styles")

Container(regularContainer, Regular Container)

Container(taggedContainer1, Tagged Container With New Styles, $tags=my_custom_tag_1)

Container(taggedContainer2, Tagged Container With DefaultStyles, $tags=my_custom_tag_2)

SHOW_LEGEND()
@enduml

v2.4.0

v2.5.0

@startuml
!include  https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/v2.5.0/C4_Container.puml

AddContainerTag(my_custom_tag_1, $bgColor=lightyellow, $fontColor=darkgreen, $legendText="This should have new styles")

AddContainerTag(my_custom_tag_2, $legendText="This should have default styles")

Container(regularContainer, Regular Container)

Container(taggedContainer1, Tagged Container With New Styles, $tags=my_custom_tag_1)

Container(taggedContainer2, Tagged Container With DefaultStyles, $tags=my_custom_tag_2)

SHOW_LEGEND()
@enduml

v2.5.0

kirchsth commented 1 year ago

Hi @dannief,

thank you for the finding. I hope it is fixed with my PR #301. Can you please test it with my extended branch

Thank you Helmut

dannief commented 1 year ago

This is fixed. Thanks.

Ques. When will v2.6.0 be released?

kirchsth commented 1 year ago

@dannief: v2.6.0 is released ;-)