8000 feature #47665 [WebProfilerBundle] [WebProfilerPanel] Update the conf… · symfony/symfony@5205e1f · GitHub
[go: up one dir, main page]

Skip to content

Commit 5205e1f

Browse files
committed
feature #47665 [WebProfilerBundle] [WebProfilerPanel] Update the configuration panel (javiereguiluz)
This PR was squashed before being merged into the 6.2 branch. Discussion ---------- [WebProfilerBundle] [WebProfilerPanel] Update the configuration panel | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - This PR proposes to update the "Symfony status" information in the "Config" panel of the Symfony Profiler. Today it's displayed as a table: <img width="1238" alt="config-panel-before" src="https://user-images.githubusercontent.com/73419/191730115-41988e01-4366-40d1-ab98-eabf8d201742.png"> I'd prefer to display that information more visually: <img width="1239" alt="config-panel-after" src="https://user-images.githubusercontent.com/73419/191739064-15276fa3-8dff-4c44-8981-5b2b2785238c.png"> The wording has been updated a bit too ("In development" vs "Unstable version") to better match the wording used at https://symfony.com/releases/6.2 Here's the case of a LTS version: <img width="1240" alt="config-panel-after-lts" src="https://user-images.githubusercontent.com/73419/191739099-613eae03-df1e-4ca9-adbf-7e6007f318cd.png"> And for an unmaintained version: <img width="1240" alt="config-panel-after-unmaintained" src="https://user-images.githubusercontent.com/73419/191739155-a516713c-c6d7-4a32-8e59-24ed4b355d81.png"> Commits ------- 48ec448 [WebProfilerBundle] [WebProfilerPanel] Update the configuration panel
2 parents 6e4ce77 + 48ec448 commit 5205e1f

File tree

2 files changed

+83
-27
lines changed

2 files changed

+83
-27
lines changed

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

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@
118118

119119
<div class="metrics">
120120
<div class="metric">
121-
<span class="value">{{ collector.symfonyversion }}</span>
121+
<span class="value">
122+
{{ collector.symfonyversion }}
123+
124+
{% if collector.symfonylts %}
125+
<abbr class="config-symfony-version-lts" title="This is a Long-Term Support version">(LTS)</abbr>
126+
{% endif %}
127+
</span>
122128
<span class="label">Symfony version</span>
123129
</div>
124130

@@ -137,33 +143,39 @@
137143
{% endif %}
138144
</div>
139145

140-
{% set symfony_status = { dev: 'Unstable Version', stable: 'Stable Version', eom: 'Maintenance Ended', eol: 'Version Expired' } %}
146+
{% set symfony_status = { dev: 'In Development', stable: 'Maintained', eom: 'Security Fixes Only', eol: 'Unmaintained' } %}
141147
{% set symfony_status_class = { dev: 'warning', stable: 'success', eom: 'warning', eol: 'error' } %}
142-
<table>
143-
<thead class="small">
144-
<tr>
145-
<th>Symfony Status</th>
146-
<th>Bugs {{ collector.symfonystate in ['eom', 'eol'] ? 'were' : 'are' }} fixed until</th>
147-
<th>Security issues {{ collector.symfonystate == 'eol' ? 'were' : 'are' }} fixed until</th>
148-
<th></th>
149-
</tr>
150-
</thead>
151-
<tbody>
152-
<tr>
153-
<td class="font-normal">
154-
<span class="label status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
155-
{% if collector.symfonylts %}
156-
&nbsp; <span class="label status-success">Long-Term Support</span>
157-
{% endif %}
158-
</td>
159-
<td class="font-normal">{{ collector.symfonyeom }}</td>
160-
<td class="font-normal">{{ collector.symfonyeol }}</td>
161-
<td class="font-normal">
162-
<a href="https://symfony.com/releases/{{ collector.symfonyminorversion }}#release-checker">View roadmap</a>
163-
</td>
164-
</tr>
165-
</tbody>
166-
</table>
148+
149+
<div class="metrics">
150+
<div class="metric-group">
151+
<div class="metric">
152+
<span class="value">
153+
<span class="config-symfony-version-status-badge status-{{ symfony_status_class[collector.symfonystate] }}">{{ symfony_status[collector.symfonystate]|upper }}</span>
154+
</span>
155+
<span class="label">Your Symfony version status</span>
156+
</div>
157+
158+
{% if collector.symfonylts %}
159+
<div class="metric">
160+
<span class="value config-symfony-eol">
161+
{{ collector.symfonyeom }}
162+
</span>
163+
<span class="label">Bug fixes {{ collector.symfonystate in ['eom', 'eol'] ? 'ended on' : 'until' }}</span>
164+
</div>
165+
{% endif %}
166+
167+
<div class="metric">
168+
<span class="value config-symfony-eol">
169+
{{ collector.symfonyeol }}
170+
</span>
171+
<span class="label">
172+
{{ collector.symfonylts ? 'Security fixes' : 'Bug fixes and security fixes' }}
173+
{{ 'eol' == collector.symfonystate ? 'ended on' : 'until' }}</span>
174+
</div>
175+
</div>
176+
</div>
177+
178+
<a class="config-symfony-version-roadmap-link" href="https://symfony.com/releases/{{ collector.symfonyminorversion }}">View Symfony {{ collector.symfonyversion }} release details</a>
167179

168180
<h2>PHP Configuration</h2>
169181

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ table tbody td.num-col {
665665
text-align: center;
666666
}
667667
.metric-group {
668+
align-items: stretch;
668669
flex-direction: row;
669670
padding: 10px 0;
670671
}
@@ -673,6 +674,7 @@ table tbody td.num-col {
673674
border: none;
674675
border-radius: 0;
675676
box-shadow: none;
677+
justify-content: flex-end;
676678
margin: 0;
677679
min-height: auto;
678680
padding: 0 15px;
@@ -2050,6 +2052,48 @@ pre.sf-dump, pre.sf-dump .sf-dump-default {
20502052
text-decoration: none;
20512053
}
20522054

2055+
{# Configuration panel
2056+
========================================================================= #}
2057+
.config-symfony-version-lts {
2058+
border: 0;
2059+
color: var(--color-muted);
2060+
font-size: 21px;
2061+
line-height: 33px;
2062+
}
2063+
.config-symfony-version-lts[title] {
2064+
text-decoration: none;
2065+
}
2066+
.config-symfony-version-status-badge {
2067+
background-color: var(--badge-background);
2068+
border-radius: 4px;
2069+
color: var(--badge-color);
2070+
display: inline-block;
2071+
font-size: 15px;
2072+
font-weight: bold;
2073+
margin: 10px 0 5px;
2074+
padding: 3px 7px;
2075+
white-space: nowrap;
2076+
}
2077+
.config-symfony-version-status-badge.status-success {
2078+
background-color: var(--badge-success-background);
2079+
color: var(--badge-success-color);
2080+
}
2081+
.config-symfony-version-status-badge.status-warning {
2082+
background-color: var(--badge-warning-background);
2083+
color: var(--badge-warning-color);
2084+
}
2085+
.config-symfony-version-status-badge.status-error {
2086+
background-color: var(--badge-danger-background);
2087+
color: var(--badge-danger-color);
2088+
}
2089+
.config-symfony-version-roadmap-link {
2090+
display: inline-block;
2091+
margin: 10px 5px 5px;
2092+
}
2093+
.config-symfony-eol {
2094+
margin-top: 5px;
2095+
}
2096+
20532097
{# Search Results page
20542098
========================================================================= #}
20552099
#search-results td {

0 commit comments

Comments
 (0)
0