Skip to content

Commit 6ab60f8

Browse files
authored
add icon to symfony profiler (#193)
- hide automapper from profiler if there's no map action - add icon to symfony profiler I'm using this icon https://tabler.io/icons/icon/topology-full let me know if the icon needs to be changed
2 parents 9de87a7 + e12404d commit 6ab60f8

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- [GH#180](https://github.com/jolicode/automapper/pull/180) Add configuration to generate code with strict types
1111
- [GH#183](https://github.com/jolicode/automapper/pull/183) Ability to change reload strategy from AutoMapper::create()
12+
- [GH#193](https://github.com/jolicode/automapper/pull/193) add icon to symfony profiler
1213

1314
### Fixed
1415
- [GH#184](https://github.com/jolicode/automapper/pull/184) Fix error when mapping from stdClass to constructor with nullable/optional arguments
Lines changed: 13 additions & 0 deletions
Loading

src/Symfony/Bundle/Resources/views/DataCollector/metadata.html.twig

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
22

33
{% block toolbar %}
4-
{% set text %}
5-
{% if collector.metadatas|length == 0 %}
6-
<div class="sf-toolbar-info-piece">
7-
<b>AutoMapper</b>
8-
<span>No Mapper</span>
9-
</div>
10-
{% endif %}
11-
{% for metadata in collector.metadatas %}
12-
<div class="sf-toolbar-info-piece">
13-
<b>AutoMapper</b>
14-
<span>{{ metadata.source }} to {{ metadata.target }}</span>
15-
</div>
16-
{% endfor %}
17-
{% endset %}
18-
19-
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
4+
{% if collector.metadatas|length > 0 %}
5+
{% set icon %}
6+
{{ source('@AutoMapper/DataCollector/icon.svg') }}
7+
<span class="sf-toolbar-value">{{ collector.metadatas|length }}</span>
8+
{% endset %}
9+
10+
{% set text %}
11+
{% for metadata in collector.metadatas %}
12+
<div class="sf-toolbar-info-piece">
13+
<b>AutoMapper</b>
14+
<span>{{ metadata.source }} to {{ metadata.target }}</span>
15+
</div>
16+
{% endfor %}
17+
{% endset %}
18+
19+
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
20+
{% endif %}
2021
{% endblock %}
2122

2223
{% block menu %}
2324
<span class="label{{ collector.metadatas|length > 0 ? '' : ' disabled' }}">
25+
<span class="icon">{{ source('@AutoMapper/DataCollector/icon.svg') }}</span>
2426
<strong>AutoMapper</strong>
2527
{% if collector.metadatas|length > 0 %}
2628
<span class="count">
@@ -185,4 +187,4 @@
185187
{% endfor %}
186188
</div>
187189
{% endif %}
188-
{% endblock %}
190+
{% endblock %}

0 commit comments

Comments
 (0)