Skip to content

Commit

Permalink
update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
haidaraM committed May 25, 2023
1 parent 76253cb commit ab9990a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
- 🚀🚀Add support for MermaidJS 🚀🚀. See https://github.com/haidaraM/ansible-playbook-grapher/issues/137
- Update various Dependencies: pytest, pytest-cov, ansible-core, pyquery etc...
- ci: Add dependabot for github-actions
- When using `--group-roles-by-name`, the roles used multiple times will include a counter corresponding to the number
of times they are used.
- Rename some tests files
- Rename some tests files..

## Breaking changes

Expand Down
4 changes: 1 addition & 3 deletions ansibleplaybookgrapher/renderer/graphviz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,18 @@ def build_role(self, role_node: RoleNode, color: str, fontcolor: str, **kwargs):
url = self.get_node_url(role_node, "folder")

plays_using_this_role = self.roles_usage[role_node]
name_suffix = ""
if len(plays_using_this_role) > 1:
# If the role is used in multiple plays, we take black as the default color
role_color = "black"
fontcolor = "#ffffff"
name_suffix = f"({len(plays_using_this_role)})"
else:
role_color, fontcolor = list(plays_using_this_role)[0].colors

with digraph.subgraph(name=role_node.name, node_attr={}) as role_subgraph:
role_subgraph.node(
role_node.id,
id=role_node.id,
label=f"[role] {role_node.name} {name_suffix}".strip(),
label=f"[role] {role_node.name}",
style="filled",
tooltip=role_node.name,
fontcolor=fontcolor,
Expand Down
4 changes: 1 addition & 3 deletions ansibleplaybookgrapher/renderer/mermaid.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,9 @@ def build_role(self, role_node: RoleNode, color: str, fontcolor: str, **kwargs):

plays_using_this_role = len(self.roles_usage[role_node])
node_color = color
name_suffix = ""
if plays_using_this_role > 1:
# If the role is used in multiple plays, we take black as the default color
node_color = "#000000" # black
name_suffix = f"({plays_using_this_role})"

# From parent to role
self.add_link(
Expand All @@ -241,7 +239,7 @@ def build_role(self, role_node: RoleNode, color: str, fontcolor: str, **kwargs):
self.roles_built.add(role_node)

# Role node
self.add_text(f'{role_node.id}("[role] {role_node.name} {name_suffix}")')
self.add_text(f'{role_node.id}("[role] {role_node.name}")')
self.add_text(
f"style {role_node.id} fill:{node_color},color:{fontcolor},stroke:{node_color}"
)
Expand Down

0 comments on commit ab9990a

Please sign in to comment.