From 815fbbe47a834b4197d07edacc32c240702f8b13 Mon Sep 17 00:00:00 2001 From: kirchsth Date: Sat, 27 Jan 2024 12:52:00 +0100 Subject: [PATCH 1/2] #334 fix AddNodeTag() call --- C4_Deployment.puml | 2 +- percy/TestAllAddTags.puml | 73 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 percy/TestAllAddTags.puml diff --git a/C4_Deployment.puml b/C4_Deployment.puml index a52d69d6..20ed8b32 100644 --- a/C4_Deployment.puml +++ b/C4_Deployment.puml @@ -31,7 +31,7 @@ skinparam rectangle<> { ' node specific: $techn is only used in old scripts, new scripts uses $type ($techn has to remain, it could be called via named argument) !unquoted procedure AddNodeTag($tagStereo, $bgColor="", $fontColor="", $borderColor="", $shadowing="", $shape="", $sprite="", $type="", $legendText="", $legendSprite="", $techn="", $borderStyle="", $borderThickness="") !$type=$type+$techn - $addElementTagInclReuse("node", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, "", $borderStyle, $borderThickness) + $addElementTagInclReuse("node", $tagStereo, $bgColor, $fontColor, $borderColor, $shadowing, $shape, $sprite, $type, $legendText, $legendSprite, $borderStyle, $borderThickness) !endprocedure ' Layout diff --git a/percy/TestAllAddTags.puml b/percy/TestAllAddTags.puml new file mode 100644 index 00000000..fcd7189a --- /dev/null +++ b/percy/TestAllAddTags.puml @@ -0,0 +1,73 @@ +@startuml + +' displays all elements, relationship and legend (can be included in the theme test) +!if %variable_exists("RELATIVE_INCLUDE") + !include %get_variable_value("RELATIVE_INCLUDE")/C4_Component.puml + !include %get_variable_value("RELATIVE_INCLUDE")/C4_Deployment.puml +!else + !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml + !include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Deployment.puml +!endif + +SetDefaultLegendEntries("person\nsystem\ncontainer\ncomponent\nexternal_person\nexternal_system\nexternal_container\nexternal_component\nnode\nenterprise_boundary\nsystem_boundary\ncontainer_boundary\nboundary") + +AddElementTag("elementTag", $bgColor="lightRed", $fontColor="darkRed", $borderColor="darkRed", $shadowing="true", $borderThickness="5") +AddRelTag("relTag", $textColor="darkGreen", $lineColor="darkGreen", $lineThickness="5") +AddBoundaryTag("boundaryTag", $borderColor="orange", $borderThickness="3") +AddSystemTag("systemTag", $borderColor="orange", $borderThickness="3") +AddExternalSystemTag("exSystemTag", $borderColor="brown", $borderThickness="5") +AddPersonTag("personTag", $borderColor="orange", $borderThickness="3") +AddExternalPersonTag("exPersonTag", $borderColor="brown", $borderThickness="5") +AddContainerTag("containerTag", $borderColor="orange", $borderThickness="3") +AddExternalContainerTag("exContainerTag", $borderColor="brown", $borderThickness="5") +AddComponentTag("componentTag", $borderColor="orange", $borderThickness="3") +AddExternalComponentTag("exComponentTag", $borderColor="brown", $borderThickness="5") +AddNodeTag("nodeTag", $borderColor="orange", $borderThickness="3") + +Boundary(b2, "Boundary 2", $tags="boundaryTag") { + System(system, "System", "Optional Description - elementTag", $tags="elementTag") + System_Ext(externalSystem, "External System", "Optional Description") + Rel_R(system, externalSystem, "uses - relTag", $tags="relTag") + + SystemDb(systemDb, "SystemDb", "Optional Description - systemTag", $tags="systemTag") + SystemDb_Ext(externalSystemDb, "External SystemDb", "Optional Description - exSystemTag", $tags="exSystemTag") +} + +Boundary(b1, "Boundary 1") { + Person(person, "Person", "Optional Description") + Person(person2, "Person 2", "Optional Description - personTag", $tags="personTag") + Person_Ext(externalPerson, "External Person", "Optional Description") + Person_Ext(externalPerson2, "External Person 2", "Optional Description - exPersonTag", $tags="exPersonTag") + Rel_R(person, externalPerson, "uses") +} + +Boundary(b3, "Boundary 3") { + Container(container, "Container", "Technology", "Optional Description",$tags="containerTag") + Container_Ext(externalContainer, "External Container", "Technology", "Optional Description", $tags="exContainerTag") + Rel_R(container, externalContainer, "uses") + + ContainerDb(containerDb, "ContainerDb", "Technology", "Optional Description") + ContainerDb_Ext(externalContainerDb, "External ContainerDb", "Technology", "Optional Description") +} + +Boundary(b4, "Boundary 4") { + Component(component, "Component", "Technology", "Optional Description", $tags="componentTag") + Component_Ext(externalComponent, "External Component", "Technology", "Optional Description", $tags="exComponentTag") + Rel_R(component, externalComponent, "uses") + + ComponentDb(componentDb, "ComponentDb", "Technology", "Optional Description") + ComponentDb_Ext(externalComponentDb, "External ComponentDb", "Technology", "Optional Description") +} + +Boundary(b5, "Boundary 5") { + Node(node, "Node", "Type", "Optional Description", $tags="nodeTag") + Node(node2, "Node2", "Type", "Optional Description") +} + +Lay_D(b1,b2) +Lay_D(b2,b3) +Lay_D(b3,b4) +Lay_R(b4,b5) + +SHOW_FLOATING_LEGEND() +@enduml From 451e33718146b40c4c0594d74f53d31e8e19d8c9 Mon Sep 17 00:00:00 2001 From: kirchsth Date: Thu, 21 Mar 2024 19:40:03 +0100 Subject: [PATCH 2/2] #342 Legend displays (unknown) $borderStyle correct --- C4.puml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4.puml b/C4.puml index 3d7e3306..42639f06 100644 --- a/C4.puml +++ b/C4.puml @@ -729,7 +729,7 @@ $elementSkin !elseif ($borderStyle == $SOLID_LINE) !$tagDetails = $tagDetails + $LEGEND_SOLID_LINE + ", " !else - !$tagDetails = $tagDetails + $lineStyle + ", " + !$tagDetails = $tagDetails + $borderStyle + ", " !endif !endif !if ($borderThickness != "")