Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d329a7a

Browse files
committed
minor #26674 Updated the Messenger profiler panel (javiereguiluz)
This PR was squashed before being merged into the 4.1-dev branch (closes #26674). Discussion ---------- Updated the Messenger profiler panel | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The profiler icon of the new Messenger component was still pending. After talking with @sroze, we settled on two possible ideas for the icon: 1) focus on "messages"; 2) focus on "bus" / "message bus". These are the icons for the two proposals: | "Messages" | "Message Bus" | --- | --- | ![icon-1](https://user-images.githubusercontent.com/73419/37912058-da8aabb8-3111-11e8-972c-e3535ab9e1e8.png) | ![icon-2](https://user-images.githubusercontent.com/73419/37912063-dc2df556-3111-11e8-9fe8-c52a2ea0e008.png) This is how they look inside the profiler: "Messages" ![icon-1-profiler](https://user-images.githubusercontent.com/73419/37912208-43c402f0-3112-11e8-9a33-4e45ceb44b8b.png) "Message Bus" ![icon-2-profiler](https://user-images.githubusercontent.com/73419/37912106-f3912f10-3111-11e8-827b-c8cc06c71ebe.png) ----- My opinion: * "Messages" look like "forum messages" or "chat messages". It looks wrong to me. * Inside the profiler, "Messages" looks similar to "Translation" and we already have another "messages" icon for the "Mailer". * For these reasons, I'd use "Message Bus". Now, let's hear the community opinion. Thanks! ----- If you want to test then on your computer: "Messages" ```svg <svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><path fill="#aaa" d="M11.32 9.06h-8a3.07 3.07 0 0 0-3.35 3v5a3.09 3.09 0 0 0 3.35 3h2.75l4 3.69c.42.35.89.21.89-.34v-3c2 0 4-1.5 4-3.35v-5c.04-1.85-1.79-3-3.64-3zM11 16.5H4a.5.5 0 1 1 0-1h7a.5.5 0 0 1 0 1zm0-2.63H4a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5zM21.29.06h-6.46A2.83 2.83 0 0 0 12 2.89v5.33c3.31 0 4 2.28 4 4.72 0 .44.46.56.8.28l3.31-3.16h1.21A2.71 2.71 0 0 0 24 7.35V2.77A2.71 2.71 0 0 0 21.29.06zm-.81 6.66h-5a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5zm0-2.63h-5a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5z"/></svg> ``` "Message Bus" ```svg <svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" height="24" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><path fill="#aaa" d="M16 9a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2h-3V4a1 1 0 0 0-1-1H8a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2h3v6H8a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2h3v9a1 1 0 0 0 2 0v-5h3a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2h-3V9zm2.52-2.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm0 1.63h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.52zm-13-2.82h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm0-1.62h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm0 9.62h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm0-1.62h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.54.48zm13 2.81h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm0 1.63h3a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.52z"/></svg> ``` Commits ------- 92a041c Updated the Messenger profiler panel
2 parents 6806f66 + 92a041c commit d329a7a

File tree

5 files changed

+62
-71
lines changed

5 files changed

+62
-71
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/messenger.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
</service>
5454

5555
<service id="data_collector.messenger" class="Symfony\Bundle\FrameworkBundle\DataCollector\MessengerDataCollector">
56-
<tag name="data_collector" template="@WebProfiler/Collector/messages.html.twig" id="messages" priority="100" />
56+
<tag name="data_collector" template="@WebProfiler/Collector/messenger.html.twig" id="messenger" priority="100" />
5757
<tag name="message_bus_middleware" />
5858
</service>
5959

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/messages.html.twig

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{% extends '@WebProfiler/Profiler/layout.html.twig' %}
2+
3+
{% import _self as helper %}
4+
5+
{% block toolbar %}
6+
{% if collector.messages|length > 0 %}
7+
{% set icon %}
8+
{{ include('@WebProfiler/Icon/messenger.svg') }}
9+
<span class="sf-toolbar-value">{{ collector.messages|length }}</span>
10+
{% endset %}
11+
12+
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: 'messenger' }) }}
13+
{% endif %}
14+
{% endblock %}
15+
16+
{% block menu %}
17+
<span class="label">
18+
<span class="icon">{{ include('@WebProfiler/Icon/messenger.svg') }}</span>
19+
<strong>Messages</strong>
20+
21+
<span class="count">
22+
<span>{{ collector.messages|length }}</span>
23+
</span>
24+
</span>
25+
{% endblock %}
26+
27+
{% block panel %}
28+
<h2>Messages</h2>
29+
30+
{% if collector.messages is empty %}
31+
<div class="empty">
32+
<p>No messages have been collected.</p>
33+
</div>
34+
{% else %}
35+
<table>
36+
<thead>
37+
<tr>
38+
<th>Message</th>
39+
<th>Result</th>
40+
</tr>
41+
</thead>
42+
<tbody>
43+
{% for message in collector.messages %}
44+
<tr>
45+
<td>{{ message.message.type }}</td>
46+
<td>
47+
{% if message.result.type is defined %}
48+
{{ message.result.type }}
49+
{% endif %}
50+
51+
{% if message.exception.type is defined %}
52+
{{ message.exception.type }}
53+
{% endif %}
54+
</td>
55+
</tr>
56+
{% endfor %}
57+
</tbody>
58+
</table>
59+
{% endif %}
60+
{% endblock %}

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Icon/messages.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)