Skip to content

Commit

Permalink
Add stack.getClientSlug, remove slugify extension
Browse files Browse the repository at this point in the history
  • Loading branch information
sowbiba committed Jan 3, 2019
1 parent cb2090e commit 9dd2636
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 51 deletions.
7 changes: 1 addition & 6 deletions CHANGELOG.md
Expand Up @@ -2,12 +2,6 @@

The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.

## 1.14.1

### Fixed

- Profiler does not display stack when client name contains dots

## 1.14.0

### Added
Expand All @@ -21,6 +15,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
### Fixed

- Fix deprecated notice when using symfony/config > 4.2
- Profiler does not display stack when client name contains dots

## 1.13.1 - 2018-11-28

Expand Down
8 changes: 8 additions & 0 deletions Collector/Stack.php
Expand Up @@ -340,4 +340,12 @@ public function setCurlCommand($curlCommand)
{
$this->curlCommand = $curlCommand;
}

/**
* @return string
*/
public function getClientSlug()
{
return preg_replace('/[^a-zA-Z0-9_-]/u', '_', $this->client);
}
}
36 changes: 0 additions & 36 deletions Collector/Twig/HttpPlugSlugifyExtension.php

This file was deleted.

4 changes: 0 additions & 4 deletions Resources/config/data-collector.xml
Expand Up @@ -26,10 +26,6 @@
<tag name="twig.extension" />
</service>

<service id="httplug.collector.twig.httplug_slugify" class="Http\HttplugBundle\Collector\Twig\HttpPlugSlugifyExtension" public="false">
<tag name="twig.extension" />
</service>

<!-- Discovered clients -->
<service id="httplug.collector.auto_discovered_client" class="Http\HttplugBundle\Collector\ProfileClient" decorates="httplug.auto_discovery.auto_discovered_client" public="false">
<argument type="service" id="httplug.collector.auto_discovered_client.inner"/>
Expand Down
10 changes: 5 additions & 5 deletions Resources/views/stack.html.twig
@@ -1,4 +1,4 @@
<div class="httplug-stack-header httplug-toggle" data-toggle="#httplug-{{ client|httplug_slugify }}-{{ id }}-details">
<div class="httplug-stack-header httplug-toggle" data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-details">
<div>
{% if stack.failed %}
<span class="httplug-stack-failed">✘</span>
Expand All @@ -23,14 +23,14 @@
{% endif %}
</div>
</div>
<div id="httplug-{{ client|httplug_slugify }}-{{ id }}-details" class="httplug-hidden">
<div id="httplug-{{ stack.clientSlug }}-{{ id }}-details" class="httplug-hidden">
<div class="httplug-toolbar">
<div class="httplug-copy-as-curl">
<input readonly="readonly" type="text" value="{{ stack.curlCommand }}" />
<button class="btn tooltip-toggle" aria-label="Copy to clipboard">Copy to clipboard</button>
</div>
<button data-toggle="#httplug-{{ client|httplug_slugify }}-{{ id }}-stack" class="httplug-toggle btn" >Toggle plugin stack</button>
<button data-toggle="#httplug-{{ client|httplug_slugify }}-{{ id }}-details .httplug-http-body" class="httplug-toggle btn">Toggle body</button>
<button data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-stack" class="httplug-toggle btn" >Toggle plugin stack</button>
<button data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-details .httplug-http-body" class="httplug-toggle btn">Toggle body</button>
</div>
<div class="httplug-messages">
<div class="httplug-message card">
Expand All @@ -43,7 +43,7 @@
</div>
</div>
{% if stack.profiles %}
<div id="httplug-{{ client|httplug_slugify }}-{{ id }}-stack" class="httplug-hidden card">
<div id="httplug-{{ stack.clientSlug }}-{{ id }}-stack" class="httplug-hidden card">
{% for profile in stack.profiles %}
<h3 class="httplug-plugin-name">{{ profile.plugin }}</h3>
<div class="httplug-messages">
Expand Down

0 comments on commit 9dd2636

Please sign in to comment.