Skip to content

Commit

Permalink
added leaf object counts
Browse files Browse the repository at this point in the history
  • Loading branch information
vik378 committed Oct 17, 2023
1 parent ce86648 commit a95ca59
Showing 1 changed file with 54 additions and 46 deletions.
100 changes: 54 additions & 46 deletions report.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
padding-left: 1em;
border-left: 1px solid #ccc;
}
.deleted {
.deleted, del {
color: red;
}
.created {
.created, ins {
color: #00aa00;
}
/* nice table style with borders, bold th*/
Expand Down Expand Up @@ -99,6 +99,51 @@
{% if stats.modified %}<span style="color:blue">Δ{{stats["modified"]}}</span>{% endif %}
)</span>
{% endmacro %}


{% macro display_basic_changes(key, objects, color) %}
{% if key in objects %}
<h4 style="color: {{color}}">{{key | upper}} ({{ objects[key] | length }})</h4>
<div class="section">
<ul>
{% for obj in objects[key] %}
<li>{{obj["display_name"]}}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endmacro %}


{% macro spell_changes_out(changes) %}
<div class="created-modified-delited">
{{ display_basic_changes("created", changes, "#009900") }}
{% if "modified" in changes %}
<h4 style="color: blue">MODIFIED ({{ changes["modified"] | length }})</h4>
<div class="section">
{% for obj in changes["modified"] %}
<p><b>{{ obj["display_name"] }}</b></p>
<div class="section">
<ul>
{% for change in obj["attributes"] %}
<li><b>{{ change }}</b>:
{% if "diff" in obj["attributes"][change] %}
{{ obj["attributes"][change]["diff"] }}
{% else %}
{{ obj["attributes"][change]["previous"] }} -> {{ obj["attributes"][change]["current"] }}
{% endif %}
</li>
{% endfor %}
</ul>
{{ display_basic_changes("introduced", obj, "#009900") }}
{{ display_basic_changes("removed", obj, "red") }}
</div>
{% endfor %}
</div>
{% endif %}
{{ display_basic_changes("deleted", changes, "red") }}
</div>
{% endmacro %}

<h1>Object Changes {{ pretty_stats(data["objects"].stats) }}</h1>
<p><b>Disclaimer:</b> current version of model comparison engine uses a selected list of objects of interest and will not report object changes for object types that were considered as "out of scope". For the objects of interest however we can assure completness and correctness of comparison.</p>
Expand All @@ -115,49 +160,7 @@
{% set obj_type_items = data["objects"][layer][obj_type] %}
{% if obj_type_items.stats %}
<h3>{{obj_type}} {{pretty_stats(obj_type_items.stats)}}</h3>
<div class="created-modified-delited">
{% if "created" in obj_type_items %}
<h4 style="color: #009900">Created</h4>
<div class="section">
<ul>
{% for obj in obj_type_items["created"] %}
<li>{{obj["display_name"]}}</li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if "modified" in obj_type_items %}
<h4 style="color: blue">Modified</h4>
<div class="section">
{% for obj in obj_type_items["modified"] %}
<p><b>{{ obj["display_name"] }}</b></p>
<ul>
{% for change in obj["attributes"] %}
<li><b>{{ change }}</b>:
{% if "diff" in obj["attributes"][change] %}
{{ obj["attributes"][change]["diff"] }}
{% else %}
{{ obj["attributes"][change]["previous"] }} -> {{ obj["attributes"][change]["current"] }}
{% endif %}
</li>
{% endfor %}
</ul>
{% endfor %}
</div>
{% endif %}

{% if "deleted" in obj_type_items %}
<h4 style="color: red">Deleted</h4>
<div class="section">
<ul>
{% for obj in obj_type_items["deleted"] %}
<li>{{obj["display_name"]}}</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
{{ spell_changes_out(obj_type_items) }}
{% endif %}
{% endfor %}
</div>
Expand All @@ -174,7 +177,12 @@
{% if layer_data and layer_data.stats %}
<h2>{{LAYER[layer]}} {{ pretty_stats(layer_data.stats) }}</h2>
<div class="section">
layer diagrams go here
{% for diag_type, diags in data.diagrams[layer].items() %}
{% if diags.stats %}
<h3>{{diag_type}} {{pretty_stats(diags.stats)}}</h3>
{{ spell_changes_out(diags) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% endfor %}
Expand Down

0 comments on commit a95ca59

Please sign in to comment.