Skip to content

Commit

Permalink
add icon to symfony profiler (#193)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
Korbeil authored Oct 5, 2024
2 parents 9de87a7 + e12404d commit 6ab60f8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- [GH#180](https://github.com/jolicode/automapper/pull/180) Add configuration to generate code with strict types
- [GH#183](https://github.com/jolicode/automapper/pull/183) Ability to change reload strategy from AutoMapper::create()
- [GH#193](https://github.com/jolicode/automapper/pull/193) add icon to symfony profiler

### Fixed
- [GH#184](https://github.com/jolicode/automapper/pull/184) Fix error when mapping from stdClass to constructor with nullable/optional arguments
Expand Down
13 changes: 13 additions & 0 deletions src/Symfony/Bundle/Resources/views/DataCollector/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 19 additions & 17 deletions src/Symfony/Bundle/Resources/views/DataCollector/metadata.html.twig
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
{% extends '@WebProfiler/Profiler/layout.html.twig' %}

{% block toolbar %}
{% set text %}
{% if collector.metadatas|length == 0 %}
<div class="sf-toolbar-info-piece">
<b>AutoMapper</b>
<span>No Mapper</span>
</div>
{% endif %}
{% for metadata in collector.metadatas %}
<div class="sf-toolbar-info-piece">
<b>AutoMapper</b>
<span>{{ metadata.source }} to {{ metadata.target }}</span>
</div>
{% endfor %}
{% endset %}

{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
{% if collector.metadatas|length > 0 %}
{% set icon %}
{{ source('@AutoMapper/DataCollector/icon.svg') }}
<span class="sf-toolbar-value">{{ collector.metadatas|length }}</span>
{% endset %}

{% set text %}
{% for metadata in collector.metadatas %}
<div class="sf-toolbar-info-piece">
<b>AutoMapper</b>
<span>{{ metadata.source }} to {{ metadata.target }}</span>
</div>
{% endfor %}
{% endset %}

{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { 'link': true }) }}
{% endif %}
{% endblock %}

{% block menu %}
<span class="label{{ collector.metadatas|length > 0 ? '' : ' disabled' }}">
<span class="icon">{{ source('@AutoMapper/DataCollector/icon.svg') }}</span>
<strong>AutoMapper</strong>
{% if collector.metadatas|length > 0 %}
<span class="count">
Expand Down Expand Up @@ -185,4 +187,4 @@
{% endfor %}
</div>
{% endif %}
{% endblock %}
{% endblock %}

0 comments on commit 6ab60f8

Please sign in to comment.